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

Commit dda21d7

Browse files
SORMAS-Foundation#2137 - Only display cases and contacts from the user's jurisdiction by default
1 parent 96b9386 commit dda21d7

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseFilterForm.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,16 @@ public void addMoreFilters(CustomLayout moreFiltersContainer) {
274274
I18nProperties.getDescription(Descriptions.descCaseFilterRelatedToEvent),
275275
CssStyles.CHECKBOX_FILTER_INLINE));
276276

277-
addField(
278-
moreFiltersContainer,
279-
CheckBox.class,
280-
FieldConfiguration.withCaptionAndStyle(
281-
CaseCriteria.INCLUDE_CASES_FROM_OTHER_JURISDICTIONS,
282-
I18nProperties.getCaption(Captions.caseFilterInludeCasesFromOtherJurisdictions),
283-
I18nProperties.getDescription(Descriptions.descCaseFilterIncludeCasesFromOtherJurisdictions),
284-
CssStyles.CHECKBOX_FILTER_INLINE));
277+
if (!UserProvider.getCurrent().hasUserRole(UserRole.NATIONAL_USER)) {
278+
addField(
279+
moreFiltersContainer,
280+
CheckBox.class,
281+
FieldConfiguration.withCaptionAndStyle(
282+
CaseCriteria.INCLUDE_CASES_FROM_OTHER_JURISDICTIONS,
283+
I18nProperties.getCaption(Captions.caseFilterInludeCasesFromOtherJurisdictions),
284+
I18nProperties.getDescription(Descriptions.descCaseFilterIncludeCasesFromOtherJurisdictions),
285+
CssStyles.CHECKBOX_FILTER_INLINE));
286+
}
285287

286288
moreFiltersContainer.addComponent(buildWeekAndDateFilter(), WEEK_AND_DATE_FILTER);
287289
}

sormas-ui/src/main/java/de/symeda/sormas/ui/contact/ContactsFilterForm.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,16 @@ public void addMoreFilters(CustomLayout moreFiltersContainer) {
293293
null,
294294
CHECKBOX_STYLE));
295295

296-
addField(
297-
moreFiltersContainer,
298-
CheckBox.class,
299-
FieldConfiguration.withCaptionAndStyle(
300-
ContactCriteria.INCLUDE_CONTACTS_FROM_OTHER_JURISDICTIONS,
301-
I18nProperties.getCaption(Captions.contactInludeContactsFromOtherJurisdictions),
302-
I18nProperties.getDescription(Descriptions.descContactIncludeContactsFromOtherJurisdictions),
303-
CHECKBOX_STYLE));
296+
if (!UserProvider.getCurrent().hasUserRole(UserRole.NATIONAL_USER)) {
297+
addField(
298+
moreFiltersContainer,
299+
CheckBox.class,
300+
FieldConfiguration.withCaptionAndStyle(
301+
ContactCriteria.INCLUDE_CONTACTS_FROM_OTHER_JURISDICTIONS,
302+
I18nProperties.getCaption(Captions.contactInludeContactsFromOtherJurisdictions),
303+
I18nProperties.getDescription(Descriptions.descContactIncludeContactsFromOtherJurisdictions),
304+
CHECKBOX_STYLE));
305+
}
304306

305307
moreFiltersContainer.addComponent(buildWeekAndDateFilter(), WEEK_AND_DATE_FILTER);
306308
}

0 commit comments

Comments
 (0)