Skip to content

Commit 21b4c01

Browse files
authored
Merge pull request #13597 from Jayapraksh1234/Jayapraksh1234-patch-1
Jayapraksh1234 patch 1
2 parents 39756f6 + 602b579 commit 21b4c01

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

sormas-ui/src/main/java/de/symeda/sormas/ui/dashboard/sample/components/SampleDashboardMapComponent.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected void addComponents() {
6161
displayedHumanSamples =
6262
new HashSet<>(Arrays.asList(SampleAssociationType.CASE, SampleAssociationType.CONTACT, SampleAssociationType.EVENT_PARTICIPANT));
6363
if (UiUtil.permitted(FeatureType.ENVIRONMENT_MANAGEMENT, UserRight.ENVIRONMENT_SAMPLE_VIEW)) {
64-
showEnvironmentalSamples = true;
64+
showEnvironmentalSamples = false; // Changed to false: environment samples are OFF by default
6565
}
6666

6767
super.addComponents();
@@ -243,14 +243,9 @@ protected void addLayerOptions(VerticalLayout layersLayout) {
243243
CheckBox showEnvironmentSamplesCheckBox = new CheckBox();
244244
showEnvironmentSamplesCheckBox.setId(Captions.sampleDashboardShowEnvironmentSamples);
245245
showEnvironmentSamplesCheckBox.setCaption(I18nProperties.getCaption(Captions.sampleDashboardShowEnvironmentSamples));
246-
showEnvironmentSamplesCheckBox.setValue(shouldShowEventParticipantSamples());
246+
showEnvironmentSamplesCheckBox.setValue(showEnvironmentalSamples); // Use the correct state!
247247
showEnvironmentSamplesCheckBox.addValueChangeListener(e -> {
248-
if ((boolean) e.getProperty().getValue()) {
249-
showEnvironmentalSamples = true;
250-
} else {
251-
showEnvironmentalSamples = false;
252-
}
253-
248+
showEnvironmentalSamples = (boolean) e.getProperty().getValue();
254249
refreshMap(true);
255250
});
256251
layersLayout.addComponent(showEnvironmentSamplesCheckBox);

0 commit comments

Comments
 (0)