Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ public interface Strings {
String infoSyncUsers = "infoSyncUsers";
String infoSystemConfigurationValueDescriptionEmailSenderAddress = "infoSystemConfigurationValueDescriptionEmailSenderAddress";
String infoSystemConfigurationValueDescriptionEmailSenderName = "infoSystemConfigurationValueDescriptionEmailSenderName";
String infoSystemConfigurationValueDescriptionMenuBackgroundColor = "infoSystemConfigurationValueDescriptionMenuBackgroundColor";
String infoSystemConfigurationValueDescriptionSmsAuthKey = "infoSystemConfigurationValueDescriptionSmsAuthKey";
String infoSystemConfigurationValueDescriptionSmsAuthSecret = "infoSystemConfigurationValueDescriptionSmsAuthSecret";
String infoSystemConfigurationValueDescriptionSmsSenderName = "infoSystemConfigurationValueDescriptionSmsSenderName";
Expand Down
1 change: 1 addition & 0 deletions sormas-api/src/main/resources/strings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,7 @@ infoSystemConfigurationValueDescriptionSmsSenderName=Name that will be set as th
infoSystemConfigurationValueDescriptionSmsAuthKey=SORMAS supports the delivery of SMS notifications via Vonage (https://www.vonage.com/communications-apis/). You need to specify a valid authentication key and secret in order to use this feature. SORMAS will not attempt to send out SMS if these properties are left empty.
infoSystemConfigurationValueDescriptionSmsAuthSecret=Secret for SMS authentication.
infoSystemConfigurationValueDescriptionUseDeterminedVaccinationStatus=Use automatic vaccination status. The status will be derived from vaccination data.
infoSystemConfigurationValueDescriptionMenuBackgroundColor=Allows to change background color of the menu to distinguish between different SORMAS instances.

notificationCannotCreate=Cannot Create Or Edit Notification
notificationCreationNotAllowedWithoutSurveillanceReport=Notifier creation or modification is not allowed when a surveillance report already exists for this case.
Expand Down
2 changes: 1 addition & 1 deletion sormas-api/src/main/resources/validations.properties
Original file line number Diff line number Diff line change
Expand Up @@ -330,5 +330,5 @@ systemConfigurationValueValidationNotAValidEmailsenderName = Value is not a vali
systemConfigurationValueValidationNotAValidSmsSenderName = Value is not a valid name. Name should contain only letters and numbers without spaces & special characters. For more info please see https://developer.vonage.com/en/messaging/sms/guides/custom-sender-id .
smsAuthKeyValueValidation = SMS Auth key value is not valid
smsAuthSecretValueValidation = SMS Auth secret value is not valid
systemConfigurationValueValidationInvalidBackgroundColor = Pre-defined values are: green, red, indigo, gray, default (case-sensitive) otherwise must match hexadecimal format, example: #dd2b0e or #4AA
systemConfigurationValueValidationInvalidBackgroundColor = Pre-defined values are: green, red, indigo, gray, default (case-sensitive) otherwise must match hexadecimal format (with or without hash "#"), example: #dd2b0e or #4AA or dd2b0e
systemConfigurationValueValidationMenuSubtitle = Can be empty or up to 16 (any) characters. Can be used to define name of the environment: PRODUCTION - TEST etc.
15 changes: 14 additions & 1 deletion sormas-backend/src/main/resources/sql/sormas_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15770,4 +15770,17 @@ UPDATE diseaseconfiguration SET exposurecategories = 'VECTOR_BORNE' WHERE diseas

INSERT INTO schema_version (version_number, comment) VALUES (622, '#13887 default disease exposure category configuration');

-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
-- updated regexes for MENU system config values
UPDATE systemconfigurationvalue
SET value_pattern = '^(default|red|green|indigo|gray)$|^(#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}))$',
value_description = 'i18n/infoSystemConfigurationValueDescriptionMenuBackgroundColor',
validation_message = 'i18n/systemConfigurationValueValidationInvalidBackgroundColor'
WHERE config_key = 'MENU_BACKGROUND_COLOR';
Comment thread
coderabbitai[bot] marked this conversation as resolved.

UPDATE systemconfigurationvalue
SET value_pattern = '^[\w\s]{0,16}$'
WHERE config_key = 'MENU_SUBTITLE';

INSERT INTO schema_version (version_number, comment) VALUES (623, '#13552 - FIX menu regexes');

-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***
11 changes: 10 additions & 1 deletion sormas-ui/src/main/java/de/symeda/sormas/ui/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public class Menu extends CssLayout {
private static final String COLOR_BACKGROUND_STYLE_NAME = "color-background";
private static final String MENU_SUBTITLE_STYLE_NAME = "menu-subtitle";
private static final String TOP_MENU_CONTAINER_STYLE_NAME = "top-menu-container";
private static final String HASH = "#";


private final Navigator navigator;
private final Map<String, Button> viewButtons = new HashMap<>();
Expand Down Expand Up @@ -214,11 +216,18 @@ private static void defineMenuSubtitleIfSystemConfigured(VerticalLayout topConta
actualColorBackgroundColor = "#737278";
break;
default:
actualColorBackgroundColor = backgroundColor;
actualColorBackgroundColor = addHashIfMissing(backgroundColor);
}
return actualColorBackgroundColor;
}

private static String addHashIfMissing(String backgroundColor) {
if (!StringUtils.startsWith(backgroundColor, HASH)) {
return HASH + backgroundColor;
}
return backgroundColor;
}

private void showSettingsPopup() {

Window window = VaadinUiUtil.createPopupWindow();
Expand Down
Loading