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

Commit 62a4332

Browse files
author
Martin Wahnschaffe
authored
Merge pull request SORMAS-Foundation#3642 from hzi-braunschweig/feature-3572-poe-and-facility-config-visibility
SORMAS-Foundation#3572 - Show facility and POE config views based on enabled features
2 parents 51354fa + 3bbbc3a commit 62a4332

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

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

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,22 @@ public void refreshMenu(SubMenu menu, Label infoLabel, Label infoLabelSub, Strin
9494
I18nProperties.getPrefixCaption("View", CommunitiesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
9595
null,
9696
false);
97-
menu.addView(
98-
FacilitiesView.VIEW_NAME,
99-
I18nProperties.getPrefixCaption("View", FacilitiesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
100-
null,
101-
false);
102-
menu.addView(
103-
PointsOfEntryView.VIEW_NAME,
104-
I18nProperties.getPrefixCaption("View", PointsOfEntryView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
105-
null,
106-
false);
97+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)
98+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_SURVEILLANCE)
99+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.AGGREGATE_REPORTING)) {
100+
menu.addView(
101+
FacilitiesView.VIEW_NAME,
102+
I18nProperties.getPrefixCaption("View", FacilitiesView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
103+
null,
104+
false);
105+
}
106+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)) {
107+
menu.addView(
108+
PointsOfEntryView.VIEW_NAME,
109+
I18nProperties.getPrefixCaption("View", PointsOfEntryView.VIEW_NAME.replaceAll("/", ".") + ".short", ""),
110+
null,
111+
false);
112+
}
107113

108114
if (UserProvider.getCurrent().hasUserRight(UserRight.POPULATION_MANAGE)) {
109115
menu.addView(
@@ -158,8 +164,14 @@ public static void registerViews(Navigator navigator) {
158164
navigator.addView(RegionsView.VIEW_NAME, RegionsView.class);
159165
navigator.addView(DistrictsView.VIEW_NAME, DistrictsView.class);
160166
navigator.addView(CommunitiesView.VIEW_NAME, CommunitiesView.class);
161-
navigator.addView(FacilitiesView.VIEW_NAME, FacilitiesView.class);
162-
navigator.addView(PointsOfEntryView.VIEW_NAME, PointsOfEntryView.class);
167+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)
168+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_SURVEILLANCE)
169+
|| FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.AGGREGATE_REPORTING)) {
170+
navigator.addView(FacilitiesView.VIEW_NAME, FacilitiesView.class);
171+
}
172+
if (FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_SURVEILANCE)) {
173+
navigator.addView(PointsOfEntryView.VIEW_NAME, PointsOfEntryView.class);
174+
}
163175

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

0 commit comments

Comments
 (0)