Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 3bbbc3a

Browse files
SORMAS-Foundation#3572 - Show facility and POE config views based on enabled features
1 parent 4adc1c6 commit 3bbbc3a

1 file changed

Lines changed: 28 additions & 16 deletions

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/AbstractConfigurationView.java

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ public void refreshMenu(SubMenu menu, Label infoLabel, Label infoLabelSub, Strin
6666

6767
if (UserProvider.getCurrent().hasUserRight(UserRight.INFRASTRUCTURE_VIEW)) {
6868
menu.addView(
69-
CountriesView.VIEW_NAME,
70-
I18nProperties.getPrefixCaption("View", CountriesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
71-
null,
72-
false);
69+
CountriesView.VIEW_NAME,
70+
I18nProperties.getPrefixCaption("View", CountriesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
71+
null,
72+
false);
7373
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.INFRASTRUCTURE_TYPE_AREA)) {
7474
menu.addView(
7575
AreasView.VIEW_NAME,
@@ -92,16 +92,22 @@ public void refreshMenu(SubMenu menu, Label infoLabel, Label infoLabelSub, Strin
9292
I18nProperties.getPrefixCaption("View", CommunitiesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
9393
null,
9494
false);
95-
menu.addView(
96-
FacilitiesView.VIEW_NAME,
97-
I18nProperties.getPrefixCaption("View", FacilitiesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
98-
null,
99-
false);
100-
menu.addView(
101-
PointsOfEntryView.VIEW_NAME,
102-
I18nProperties.getPrefixCaption("View", PointsOfEntryView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
103-
null,
104-
false);
95+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)
96+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_SURVEILLANCE)
97+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.AGGREGATE_REPORTING)) {
98+
menu.addView(
99+
FacilitiesView.VIEW_NAME,
100+
I18nProperties.getPrefixCaption("View", FacilitiesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
101+
null,
102+
false);
103+
}
104+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)) {
105+
menu.addView(
106+
PointsOfEntryView.VIEW_NAME,
107+
I18nProperties.getPrefixCaption("View", PointsOfEntryView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
108+
null,
109+
false);
110+
}
105111

106112
if (UserProvider.getCurrent().hasUserRight(UserRight.POPULATION_MANAGE)) {
107113
menu.addView(
@@ -153,8 +159,14 @@ public static void registerViews(Navigator navigator) {
153159
navigator.addView(RegionsView.VIEW_NAME, RegionsView.class);
154160
navigator.addView(DistrictsView.VIEW_NAME, DistrictsView.class);
155161
navigator.addView(CommunitiesView.VIEW_NAME, CommunitiesView.class);
156-
navigator.addView(FacilitiesView.VIEW_NAME, FacilitiesView.class);
157-
navigator.addView(PointsOfEntryView.VIEW_NAME, PointsOfEntryView.class);
162+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)
163+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_SURVEILLANCE)
164+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.AGGREGATE_REPORTING)) {
165+
navigator.addView(FacilitiesView.VIEW_NAME, FacilitiesView.class);
166+
}
167+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)) {
168+
navigator.addView(PointsOfEntryView.VIEW_NAME, PointsOfEntryView.class);
169+
}
158170

159171
if (UserProvider.getCurrent().hasUserRight(UserRight.POPULATION_MANAGE)) {
160172
navigator.addView(PopulationDataView.VIEW_NAME, PopulationDataView.class);

0 commit comments

Comments
 (0)