Skip to content

Commit e93a8a1

Browse files
committed
Visual is okay, SQL was updated to also contain the new property.
Before refactoring code
1 parent e891043 commit e93a8a1

File tree

5 files changed

+32
-13
lines changed

5 files changed

+32
-13
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Validations.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ public interface Validations {
275275
String systemConfigurationValueInvalidValue = "systemConfigurationValueInvalidValue";
276276
String systemConfigurationValuePatternNotMatched = "systemConfigurationValuePatternNotMatched";
277277
String systemConfigurationValueValidationInvalidBackgroundColor = "systemConfigurationValueValidationInvalidBackgroundColor";
278+
String systemConfigurationValueValidationMenuSubtitle = "systemConfigurationValueValidationMenuSubtitle";
278279
String systemConfigurationValueValidationNotADirectory = "systemConfigurationValueValidationNotADirectory";
279280
String systemConfigurationValueValidationNotAEmail = "systemConfigurationValueValidationNotAEmail";
280281
String systemConfigurationValueValidationNotAFile = "systemConfigurationValueValidationNotAFile";

sormas-api/src/main/resources/validations.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,4 @@ systemConfigurationValueValidationNotAValidSmsSenderName = Value is not a valid
331331
smsAuthKeyValueValidation = SMS Auth key value is not valid
332332
smsAuthSecretValueValidation = SMS Auth secret value is not valid
333333
systemConfigurationValueValidationInvalidBackgroundColor=Pre-defined values are: green, red, indigo, gray, default (case-sensitive) otherwise must match hexadecimal format, example: #dd2b0e or #4AA
334+
systemConfigurationValueValidationMenuSubtitle=Can be empty or up to 16 (any) characters. Can be used to define name of the environment: PRODUCTION - TEST etc.

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15086,7 +15086,8 @@ $$
1508615086
RETURNING id INTO general_configuration_id;
1508715087
END IF;
1508815088

15089-
-- Insert new configuration if missing
15089+
-- Insert new configurations if missing
15090+
-- Background color
1509015091
INSERT INTO systemconfigurationvalue(config_key, config_value, category_id, value_optional, value_pattern,
1509115092
value_encrypt, data_provider, validation_message, changedate, creationdate,
1509215093
id,
@@ -15097,6 +15098,19 @@ $$
1509715098
'i18n/systemConfigurationValueValidationInvalidBackgroundColor', now(), now(), nextval('entity_seq'),
1509815099
generate_base32_uuid())
1509915100
ON CONFLICT (config_key) DO NOTHING;
15101+
15102+
-- Menu Subtitle
15103+
INSERT INTO systemconfigurationvalue(config_key, config_value, category_id, value_optional, value_pattern,
15104+
value_encrypt, data_provider, validation_message, changedate, creationdate,
15105+
id,
15106+
uuid)
15107+
VALUES ('MENU_SUBTITLE', '', general_configuration_id, true,
15108+
'^\w{0,16}$', false,
15109+
null,
15110+
'i18n/systemConfigurationValueValidationMenuSubtitle', now(), now(), nextval('entity_seq'),
15111+
generate_base32_uuid())
15112+
ON CONFLICT (config_key) DO NOTHING;
15113+
1510015114
END
1510115115
$$
1510215116
LANGUAGE plpgsql;

sormas-ui/src/main/java/de/symeda/sormas/ui/Menu.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ public Menu(Navigator navigator) {
8888
// header of the menu
8989
VerticalLayout topContainer = new VerticalLayout();
9090
topContainer.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
91-
topContainer.addStyleName(ValoTheme.MENU_TITLE);
91+
CssStyles.style(topContainer, ValoTheme.MENU_TITLE, "top-menu-container");
92+
topContainer.setSpacing(false);
93+
topContainer.setSpacing(false);
94+
9295
HorizontalLayout top = new HorizontalLayout();
9396
top.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
9497
top.setSpacing(true);
@@ -107,19 +110,16 @@ public Menu(Navigator navigator) {
107110
CssStyles.style(image, ValoTheme.MENU_LOGO, ValoTheme.BUTTON_LINK);
108111
top.addComponent(image);
109112
top.addComponent(title);
113+
110114
topContainer.addLayoutClickListener(listener -> SormasUI.get().getNavigator().navigateTo(SurveillanceDashboardView.VIEW_NAME));
111115
topContainer.addComponent(top);
112116
// TODO: new code to format
113117

114-
final HorizontalLayout environmentTitleContainer = new HorizontalLayout();
115-
environmentTitleContainer.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
116-
environmentTitleContainer.setSpacing(false);
117-
Label systemConfigurationLabel = new Label("QA");
118+
// max allowed length: 1234567891011121
119+
Label systemConfigurationLabel = new Label("1234567891011121");
118120
systemConfigurationLabel.setSizeUndefined();
119-
CssStyles.style(systemConfigurationLabel, CssStyles.LABEL_UNDERLINE);
120-
environmentTitleContainer.addComponent(systemConfigurationLabel);
121-
environmentTitleContainer.setStyleName("environment-name");
122-
topContainer.addComponent(environmentTitleContainer);
121+
CssStyles.style(systemConfigurationLabel, CssStyles.LABEL_UNDERLINE, "environment-name");
122+
topContainer.addComponent(systemConfigurationLabel);
123123

124124
menuPart.addComponent(topContainer);
125125

sormas-ui/src/main/webapp/VAADIN/themes/sormas/components/menu.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ $valo-menu-background-color: $s-default-color !default;
126126
}
127127
}
128128

129-
.v-horizontallayout-environment-name {
130-
font-size: 24px;
131-
margin-bottom: -30px;
129+
.top-menu-container {
130+
max-height: 115px;
131+
}
132+
133+
.environment-name {
134+
font-size: 26px;
132135
}
133136
}

0 commit comments

Comments
 (0)