Skip to content

Commit

Permalink
#12468 - Add environment sample list to app
Browse files Browse the repository at this point in the history
  • Loading branch information
MateStrysewske committed Sep 4, 2023
1 parent fee805d commit b6ff8b1
Show file tree
Hide file tree
Showing 16 changed files with 1,235 additions and 390 deletions.
6 changes: 6 additions & 0 deletions sormas-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@
android:launchMode="singleTop">
</activity>

<activity
android:name=".environmentsample.list.EnvironmentSampleListActivity"
android:theme="@style/ActivityWithOverflowMenuTheme"
android:screenOrientation="portrait"
android:launchMode="singleTop">
</activity>

<!-- Only needed for androidTest - found no other way to manifest this -->
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ public boolean onNavigationItemSelected(MenuItem item) {
NavigationHelper.goToSamples(getContext());
} else if (id == R.id.menu_item_environments) {
NavigationHelper.goToEnvironments(getContext());
} else if (id == R.id.menu_item_environment_samples) {
NavigationHelper.goToEnvironmentSamples(getContext());
} else if (id == R.id.menu_item_immunizations) {
NavigationHelper.goToImmunizations(getContext());
} else if (id == R.id.menu_item_campaigns) {
Expand Down Expand Up @@ -413,6 +415,7 @@ private void setupDrawer(NavigationView navView) {
MenuItem eventMenu = menuNav.findItem(R.id.menu_item_events);
MenuItem sampleMenu = menuNav.findItem(R.id.menu_item_samples);
MenuItem environmentMenu = menuNav.findItem(R.id.menu_item_environments);
MenuItem environmentSampleMenu = menuNav.findItem(R.id.menu_item_environment_samples);
MenuItem immunizationMenu = menuNav.findItem(R.id.menu_item_immunizations);
MenuItem reportMenu = menuNav.findItem(R.id.menu_item_reports);
MenuItem campaignMenu = menuNav.findItem(R.id.menu_item_campaigns);
Expand Down Expand Up @@ -447,6 +450,12 @@ private void setupDrawer(NavigationView navView) {
&& !DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.ENVIRONMENT_MANAGEMENT));
}

if (environmentSampleMenu != null) {
environmentSampleMenu.setVisible(
ConfigProvider.hasUserRight(UserRight.ENVIRONMENT_SAMPLE_VIEW)
&& !DatabaseHelper.getFeatureConfigurationDao().isFeatureDisabled(FeatureType.ENVIRONMENT_MANAGEMENT));
}

if (immunizationMenu != null)
immunizationMenu.setVisible(
ConfigProvider.hasUserRight(UserRight.IMMUNIZATION_VIEW)
Expand Down
Loading

0 comments on commit b6ff8b1

Please sign in to comment.