Skip to content

Commit dcb3b6a

Browse files
authored
Merge pull request #5 from wet-boew/4-added-an-optional-parameter-hideplaceholdermenu-to-the-gcintranet-theme
Adding hidePlaceholderMenu parameter
2 parents 4c0ec07 + 066d695 commit dcb3b6a

7 files changed

Lines changed: 50 additions & 9 deletions

File tree

gocwebtemplate-core/gocwebtemplate-core-base/src/main/java/goc/webtemplate/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public abstract class Constants {
1515

1616
public static final String WEB_TEMPLATE_DISTRIBUTION_VERSION = "2.4.0";
1717

18-
public static final String CDTS_DEFAULT_VERSION = "v4_0_45";
18+
public static final String CDTS_DEFAULT_VERSION = "v4_0_46";
1919

2020
public static final String STATIC_FALLBACK_FILES_INTERNAL_PATH = "/goc/webtemplate/StaticFallbackFiles";
2121

gocwebtemplate-core/gocwebtemplate-core-base/src/main/java/goc/webtemplate/component/AbstractCoreBean.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ private enum Themes { GCWEB, GCINTRANET }
150150
private WebAnalyticsInfo webAnalytics = new WebAnalyticsInfo(Boolean.parseBoolean(this.getResourceBundleString("cdn", "goc.webtemplate.usewebanalytics"))); //will be false if not specified in config
151151
private boolean gcToolsModal = false;
152152
private String footerPath = null;
153+
private boolean hidePlaceholderMenu = false;
153154
//-------------------------------------------------------
154155

155156
//-------------------------------------------------------
@@ -457,7 +458,7 @@ public void setUseHttps(boolean value) {
457458
}
458459

459460
/**
460-
* Returns the version of the CDN files to use to build the page. (e.g v4_0_45)
461+
* Returns the version of the CDN files to use to build the page. (e.g v4_0_46)
461462
*
462463
* Set at application level via "wettemplate_version" property in cdn.properties,
463464
* can be overriden programatically.
@@ -478,7 +479,7 @@ public String getTemplateVersion() {
478479
}
479480

480481
/**
481-
* Sets the version of the CDN files to use to build the page. (e.g v4_0_45)
482+
* Sets the version of the CDN files to use to build the page. (e.g v4_0_46)
482483
*
483484
* Set at application level via "wettemplate_version" property in cdn.properties,
484485
* can be overriden programatically.
@@ -1452,6 +1453,25 @@ public void setCustomFooterSections(ArrayList<FooterSection> value) {
14521453
this.customFooterSections = value;
14531454
}
14541455

1456+
/**
1457+
* Returns whether the placeholder menu should be hidden while a custom menu is being loaded
1458+
*
1459+
* can be overriden programatically.
1460+
*/
1461+
public boolean getHidePlaceholderMenu() {
1462+
this.initializeOnce();
1463+
return this.hidePlaceholderMenu;
1464+
}
1465+
1466+
/**
1467+
* Sets whether the placeholder menu should be hidden while a custom menu is being loaded
1468+
*
1469+
* can be overriden programatically.
1470+
*/
1471+
public void setHidePlaceholderMenu(boolean value) {
1472+
this.hidePlaceholderMenu = value;
1473+
}
1474+
14551475
/**
14561476
* Returns a copy of the breadcrumb list, ready for JSON serialization
14571477
*/
@@ -1797,7 +1817,8 @@ public String getRenderTop() {
17971817
true, //siteMenu
17981818
this.getHasLeftMenuSections(), //topSecMenu, true if there is at least one left menu section defined
17991819
this.customSearch != null? Arrays.asList(this.customSearch): null,
1800-
this.gcToolsModal
1820+
this.gcToolsModal,
1821+
this.hidePlaceholderMenu
18011822
));
18021823
}
18031824

@@ -1822,7 +1843,8 @@ public String getRenderTransactionalTop() {
18221843
false, //siteMenu
18231844
this.getHasLeftMenuSections(), //topSecMenu, true if there is at least one left menu section defined
18241845
this.customSearch != null? Arrays.asList(this.customSearch): null,
1825-
this.gcToolsModal
1846+
this.gcToolsModal,
1847+
this.hidePlaceholderMenu
18261848
));
18271849
}
18281850

gocwebtemplate-core/gocwebtemplate-core-base/src/main/java/goc/webtemplate/component/jsonentities/Top.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class Top implements Serializable {
2727
private List<Breadcrumb> breadcrumbs;
2828
private String localPath;
2929
private boolean siteMenu;
30+
private boolean hidePlaceholderMenu;
3031

3132
@SerializedName("GCToolsModal")
3233
private boolean gcToolsModal;
@@ -41,7 +42,7 @@ public Top() {
4142

4243
public Top(String cdnEnv, String subTheme, List<IntranetTitle> intranetTitle, boolean search, List<LanguageLink> lngLinks,
4344
boolean showPreContent, List<Breadcrumb> breadcrumbs, String localPath, boolean siteMenu,
44-
boolean topSecMenu, List<CustomSearch> customSearch, boolean gcToolsModal) {
45+
boolean topSecMenu, List<CustomSearch> customSearch, boolean gcToolsModal, boolean hidePlaceholderMenu) {
4546
this.cdnEnv = cdnEnv;
4647
this.subTheme = subTheme;
4748
this.intranetTitle = intranetTitle;
@@ -54,6 +55,7 @@ public Top(String cdnEnv, String subTheme, List<IntranetTitle> intranetTitle, bo
5455
this.topSecMenu = topSecMenu;
5556
this.customSearch = customSearch;
5657
this.gcToolsModal = gcToolsModal;
58+
this.hidePlaceholderMenu = hidePlaceholderMenu;
5759
}
5860

5961
public String getCdnEnv() {
@@ -151,4 +153,12 @@ public boolean getGcToolsModal() {
151153
public void setGcToolsModal(boolean value) {
152154
this.gcToolsModal = value;
153155
}
156+
157+
public boolean getHidePlaceholderMenu() {
158+
return hidePlaceholderMenu;
159+
}
160+
161+
public void setHidePlaceholderMenu(boolean value) {
162+
this.hidePlaceholderMenu = value;
163+
}
154164
}

gocwebtemplate-core/gocwebtemplate-core-base/src/test/java/goc/webtemplate/component/abstractcorebeantest/RenderTopTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,13 @@ public void testGcToolsModalThrowsExceptionInGcWeb() {
4848
sut.getRenderTop();
4949
});
5050
}
51+
52+
@Test
53+
public void testHidePlaceholderMenuTrueRenders() {
54+
AbstractCoreBeanImpl sut = new AbstractCoreBeanImpl();
55+
56+
sut.setHidePlaceholderMenu(true);
57+
58+
assertTrue(sut.getRenderTop().contains("\"hidePlaceholderMenu\":true"));
59+
}
5160
}

gocwebtemplate-core/gocwebtemplate-core-base/src/test/resources/goc/webtemplate/global/config/cdn.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cdn_localdev_localpath=/loadtesting/app/cls/WET/{0}/{1}/
2929
#(blank values for theme, subtheme and version will use defaults from internal environment configuration)
3030
wettemplate_theme=
3131
wettemplate_subtheme=
32-
wettemplate_version=v4_0_45
32+
wettemplate_version=v4_0_46
3333
wettemplate_loadjqueryfromgoogle=false
3434
webtemplate_usehttps=true
3535
#

gocwebtemplate-core/gocwebtemplate-core-jsp/src/test/resources/goc/webtemplate/global/config/cdn.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cdn_localdev_localpath=/GoCWebTemplateSampleJSP/loadtesting/app/cls/WET/{0}/{1}/
2929
#(blank values for theme, subtheme and version will use defaults from internal environment configuration)
3030
wettemplate_theme=
3131
wettemplate_subtheme=
32-
wettemplate_version=v4_0_45
32+
wettemplate_version=v4_0_46
3333
wettemplate_loadjqueryfromgoogle=false
3434
webtemplate_usehttps=true
3535
#

gocwebtemplate-sample-jsp/src/main/resources/goc/webtemplate/global/config/cdn.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cdn_localdev_localpath=/GoCWebTemplateSampleJSP/loadtesting/app/cls/WET/{0}/{1}/
2929
#(blank values for theme, subtheme and version will use defaults from internal environment configuration)
3030
wettemplate_theme=
3131
wettemplate_subtheme=
32-
wettemplate_version=v4_0_45
32+
wettemplate_version=
3333
wettemplate_loadjqueryfromgoogle=false
3434
webtemplate_usehttps=true
3535
#

0 commit comments

Comments
 (0)