diff --git a/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRoleDto.java b/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRoleDto.java index d319f444150..8016b1f17db 100644 --- a/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRoleDto.java +++ b/sormas-api/src/main/java/de/symeda/sormas/api/user/UserRoleDto.java @@ -137,145 +137,145 @@ public void setPortHealthUser(boolean portHealthUser) { this.portHealthUser = portHealthUser; } - public JurisdictionLevel getJurisdictionLevel() { - return jurisdictionLevel; - } - - public void setJurisdictionLevel(JurisdictionLevel jurisdictionLevel) { - this.jurisdictionLevel = jurisdictionLevel; - } - - public Set getEmailNotificationTypes() { - return emailNotificationTypes; - } - - public void setEmailNotificationTypes(Set emailNotificationTypes) { - this.emailNotificationTypes = emailNotificationTypes; - } - - public Set getSmsNotificationTypes() { - return smsNotificationTypes; - } - - public void setSmsNotificationTypes(Set smsNotificationTypes) { - this.smsNotificationTypes = smsNotificationTypes; - } - - public UserRoleReferenceDto toReference() { - return new UserRoleReferenceDto(getUuid(), getCaption()); - } - - public static Set getUserRights(Collection userRoles) { - - return userRoles != null ? userRoles.stream().flatMap(role -> role.getUserRights().stream()).collect(Collectors.toSet()) : null; - } - - public DefaultUserRole getLinkedDefaultUserRole() { - return linkedDefaultUserRole; - } - - public void setLinkedDefaultUserRole(DefaultUserRole linkedDefaultUserRole) { - this.linkedDefaultUserRole = linkedDefaultUserRole; - } - - public static JurisdictionLevel getJurisdictionLevel(Collection roles) { - - boolean laboratoryJurisdictionPresent = false; - for (UserRoleDto role : roles) { - final JurisdictionLevel jurisdictionLevel = role.getJurisdictionLevel(); - if (roles.size() == 1 || (jurisdictionLevel != JurisdictionLevel.NONE && jurisdictionLevel != JurisdictionLevel.LABORATORY)) { - return jurisdictionLevel; - } else if (jurisdictionLevel == JurisdictionLevel.LABORATORY) { - laboratoryJurisdictionPresent = true; - } - } - - return laboratoryJurisdictionPresent ? JurisdictionLevel.LABORATORY : JurisdictionLevel.NONE; - } - - @JsonIgnore - public String i18nPrefix() { - return I18N_PREFIX; - } - - @Transient - public NotificationTypes getNotificationTypes() { - return NotificationTypes.of(smsNotificationTypes, emailNotificationTypes); - } - - @Transient - public void setNotificationTypes(NotificationTypes notificationTypes) { - this.smsNotificationTypes = notificationTypes.sms; - this.emailNotificationTypes = notificationTypes.email; - } - - public boolean isRestrictAccessToAssignedEntities() { - return restrictAccessToAssignedEntities; - } - - public void setRestrictAccessToAssignedEntities(boolean restrictAccessToAssignedEntities) { - this.restrictAccessToAssignedEntities = restrictAccessToAssignedEntities; - } - - @Override - public String buildCaption() { - return caption; - } - - @SuppressWarnings("serial") - public static class UserRoleValidationException extends ValidationException { - - private final UserRoleDto checkedUserRole; - private final UserRoleDto forbiddenUserRole; - - public UserRoleValidationException(UserRoleDto checkedUserRole, UserRoleDto forbiddenUserRole) { - super( - checkedUserRole.getCaption() + " " + I18nProperties.getString(Strings.messageUserRoleCombination) + " " - + forbiddenUserRole.getCaption()); - this.checkedUserRole = checkedUserRole; - this.forbiddenUserRole = forbiddenUserRole; - } - - public UserRoleDto getCheckedUserRole() { - return checkedUserRole; - } - - public UserRoleDto getForbiddenUserRole() { - return forbiddenUserRole; - } - } - - public static class NotificationTypes { - - private final Set sms; - private final Set email; - - private NotificationTypes(Set sms, Set email) { - this.sms = sms; - this.email = email; - } - - public static NotificationTypes of(Set sms, Set email) { - return new NotificationTypes(sms, email); - } - - public Set getSms() { - return sms; - } - - public Set getEmail() { - return email; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof NotificationTypes)) { - return false; - } - - NotificationTypes notificationTypes = (NotificationTypes) obj; - - return sms.equals(notificationTypes.sms) && email.equals(notificationTypes.email); - } - } + public JurisdictionLevel getJurisdictionLevel() { + return jurisdictionLevel; + } + + public void setJurisdictionLevel(JurisdictionLevel jurisdictionLevel) { + this.jurisdictionLevel = jurisdictionLevel; + } + + public Set getEmailNotificationTypes() { + return emailNotificationTypes; + } + + public void setEmailNotificationTypes(Set emailNotificationTypes) { + this.emailNotificationTypes = emailNotificationTypes; + } + + public Set getSmsNotificationTypes() { + return smsNotificationTypes; + } + + public void setSmsNotificationTypes(Set smsNotificationTypes) { + this.smsNotificationTypes = smsNotificationTypes; + } + + public UserRoleReferenceDto toReference() { + return new UserRoleReferenceDto(getUuid(), getCaption()); + } + + public static Set getUserRights(Collection userRoles) { + + return userRoles != null ? userRoles.stream().flatMap(role -> role.getUserRights().stream()).collect(Collectors.toSet()) : null; + } + + public DefaultUserRole getLinkedDefaultUserRole() { + return linkedDefaultUserRole; + } + + public void setLinkedDefaultUserRole(DefaultUserRole linkedDefaultUserRole) { + this.linkedDefaultUserRole = linkedDefaultUserRole; + } + + public static JurisdictionLevel getJurisdictionLevel(Collection roles) { + + boolean laboratoryJurisdictionPresent = false; + for (UserRoleDto role : roles) { + final JurisdictionLevel jurisdictionLevel = role.getJurisdictionLevel(); + if (roles.size() == 1 || (jurisdictionLevel != JurisdictionLevel.NONE && jurisdictionLevel != JurisdictionLevel.LABORATORY)) { + return jurisdictionLevel; + } else if (jurisdictionLevel == JurisdictionLevel.LABORATORY) { + laboratoryJurisdictionPresent = true; + } + } + + return laboratoryJurisdictionPresent ? JurisdictionLevel.LABORATORY : JurisdictionLevel.NONE; + } + + @JsonIgnore + public String i18nPrefix() { + return I18N_PREFIX; + } + + @Transient + public NotificationTypes getNotificationTypes() { + return NotificationTypes.of(smsNotificationTypes, emailNotificationTypes); + } + + @Transient + public void setNotificationTypes(NotificationTypes notificationTypes) { + this.smsNotificationTypes = notificationTypes.sms; + this.emailNotificationTypes = notificationTypes.email; + } + + public boolean isRestrictAccessToAssignedEntities() { + return restrictAccessToAssignedEntities; + } + + public void setRestrictAccessToAssignedEntities(boolean restrictAccessToAssignedEntities) { + this.restrictAccessToAssignedEntities = restrictAccessToAssignedEntities; + } + + @Override + public String buildCaption() { + return caption; + } + + @SuppressWarnings("serial") + public static class UserRoleValidationException extends ValidationException { + + private final UserRoleDto checkedUserRole; + private final UserRoleDto forbiddenUserRole; + + public UserRoleValidationException(UserRoleDto checkedUserRole, UserRoleDto forbiddenUserRole) { + super( + checkedUserRole.getCaption() + " " + I18nProperties.getString(Strings.messageUserRoleCombination) + " " + + forbiddenUserRole.getCaption()); + this.checkedUserRole = checkedUserRole; + this.forbiddenUserRole = forbiddenUserRole; + } + + public UserRoleDto getCheckedUserRole() { + return checkedUserRole; + } + + public UserRoleDto getForbiddenUserRole() { + return forbiddenUserRole; + } + } + + public static class NotificationTypes { + + private final Set sms; + private final Set email; + + private NotificationTypes(Set sms, Set email) { + this.sms = sms; + this.email = email; + } + + public static NotificationTypes of(Set sms, Set email) { + return new NotificationTypes(sms, email); + } + + public Set getSms() { + return sms; + } + + public Set getEmail() { + return email; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof NotificationTypes)) { + return false; + } + + NotificationTypes notificationTypes = (NotificationTypes) obj; + + return sms.equals(notificationTypes.sms) && email.equals(notificationTypes.email); + } + } } diff --git a/sormas-app/app/src/main/res/drawable/button_round_edges.xml b/sormas-app/app/src/main/res/drawable/button_round_edges.xml deleted file mode 100644 index 2f91b0416a5..00000000000 --- a/sormas-app/app/src/main/res/drawable/button_round_edges.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sormas-app/app/src/main/res/drawable/ic_baseline_check_.xml b/sormas-app/app/src/main/res/drawable/ic_baseline_check_.xml deleted file mode 100644 index 0432fa69bb7..00000000000 --- a/sormas-app/app/src/main/res/drawable/ic_baseline_check_.xml +++ /dev/null @@ -1,10 +0,0 @@ - - -