|
53 | 53 | import de.symeda.sormas.api.contact.ContactClassification; |
54 | 54 | import de.symeda.sormas.api.contact.MapContactDto; |
55 | 55 | import de.symeda.sormas.api.dashboard.AefiDashboardCriteria; |
| 56 | +import de.symeda.sormas.api.dashboard.DashboardCriteria; |
56 | 57 | import de.symeda.sormas.api.dashboard.DashboardEventDto; |
57 | 58 | import de.symeda.sormas.api.dashboard.GisDashboardCriteria; |
58 | 59 | import de.symeda.sormas.api.dashboard.SampleDashboardCriteria; |
@@ -159,7 +160,7 @@ public GisDashboardMapComponent(GisDashboardDataProvider dashboardDataProvider) |
159 | 160 | protected void addComponents() { |
160 | 161 | displayedHumanSamples = new HashSet<>(); |
161 | 162 | if (UiUtil.permitted(FeatureType.ENVIRONMENT_MANAGEMENT, UserRight.ENVIRONMENT_SAMPLE_VIEW)) { |
162 | | - showEnvironmentalSamples = true; |
| 163 | + showEnvironmentalSamples = false; |
163 | 164 | } |
164 | 165 |
|
165 | 166 | caseClassificationOption = MapCaseClassificationOption.ALL_CASES; |
@@ -244,7 +245,9 @@ protected Long getMarkerCount(Date fromDate, Date toDate, int maxCount) { |
244 | 245 | markerCount += FacadeProvider.getAefiDashboardFacade().countAefiForMap(dashboardDataProvider.buildAefiDashboardCriteria()); |
245 | 246 | } else if (loadEvents) { |
246 | 247 | if (showEvents) { |
247 | | - markerCount += dashboardDataProvider.getEvents().size(); |
| 248 | + DashboardCriteria eventDashboardCriteria = dashboardDataProvider.buildEventDashboardCriteria(); |
| 249 | + List<DashboardEventDto> events = FacadeProvider.getDashboardFacade().getNewEvents(eventDashboardCriteria); |
| 250 | + markerCount += events.size(); |
248 | 251 | } |
249 | 252 | } |
250 | 253 |
|
@@ -309,7 +312,7 @@ protected void loadMapData(Date fromDate, Date toDate) { |
309 | 312 | if (loadEvents) { |
310 | 313 | clearEventMarkers(); |
311 | 314 | if (showEvents) { |
312 | | - showEventMarkers(dashboardDataProvider.getEvents()); |
| 315 | + showEventMarkers(); |
313 | 316 | } |
314 | 317 | loadEvents = false; |
315 | 318 | } |
@@ -523,7 +526,7 @@ protected void addLayerOptions(VerticalLayout layersLayout) { |
523 | 526 | showEnvironmentSamplesCheckBox = new CheckBox(); |
524 | 527 | showEnvironmentSamplesCheckBox.setId(Captions.sampleDashboardShowEnvironmentSamples); |
525 | 528 | showEnvironmentSamplesCheckBox.setCaption(I18nProperties.getCaption(Captions.sampleDashboardShowEnvironmentSamples)); |
526 | | - showEnvironmentSamplesCheckBox.setValue(shouldShowEventParticipantSamples()); |
| 529 | + showEnvironmentSamplesCheckBox.setValue(showEnvironmentalSamples); |
527 | 530 | showEnvironmentSamplesCheckBox.addValueChangeListener(e -> { |
528 | 531 | if ((boolean) e.getProperty().getValue()) { |
529 | 532 | showEnvironmentalSamples = true; |
@@ -585,7 +588,7 @@ protected void addLayerOptions(VerticalLayout layersLayout) { |
585 | 588 | refreshMap(true); |
586 | 589 | }); |
587 | 590 | samplesLayers.addComponent(showEventsCheckBox); |
588 | | - showEventsCheckBox.setVisible(false); |
| 591 | + showEventsCheckBox.setVisible(true); |
589 | 592 | } |
590 | 593 |
|
591 | 594 | if (UiUtil.hasNationJurisdictionLevel() && UiUtil.permitted(UserRight.CASE_VIEW)) { |
@@ -1341,9 +1344,12 @@ private void clearEventMarkers() { |
1341 | 1344 | markerEvents.clear(); |
1342 | 1345 | } |
1343 | 1346 |
|
1344 | | - private void showEventMarkers(List<DashboardEventDto> events) { |
| 1347 | + private void showEventMarkers() { |
1345 | 1348 | clearEventMarkers(); |
1346 | 1349 |
|
| 1350 | + DashboardCriteria eventDashboardCriteria = dashboardDataProvider.buildEventDashboardCriteria(); |
| 1351 | + List<DashboardEventDto> events = FacadeProvider.getDashboardFacade().getNewEvents(eventDashboardCriteria); |
| 1352 | + |
1347 | 1353 | List<LeafletMarker> eventMarkers = new ArrayList<LeafletMarker>(); |
1348 | 1354 |
|
1349 | 1355 | for (DashboardEventDto event : events) { |
|
0 commit comments