Skip to content

Commit 98349bd

Browse files
Merge branch 'development' into 13311-move-email-server-configuration-to-user-interface
2 parents 9b66dd2 + e52db8c commit 98349bd

File tree

7 files changed

+35
-32
lines changed

7 files changed

+35
-32
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/systemconfiguration/SystemConfigurationValueDiseasesProvider.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
3+
* Copyright © 2016-2026 SORMAS Foundation gGmbH
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
66
* the Free Software Foundation, either version 3 of the License, or
@@ -17,6 +17,7 @@
1717

1818
import java.util.Arrays;
1919
import java.util.Collections;
20+
import java.util.Comparator;
2021
import java.util.Map;
2122
import java.util.Set;
2223
import java.util.stream.Collectors;
@@ -68,9 +69,10 @@ public Map<String, String> getOptions() {
6869
public void applyValues(final Map<String, String> values, final SystemConfigurationValueDto dto) {
6970

7071
if (null == values || values.isEmpty()) {
72+
dto.setValue("");
7173
return;
7274
}
73-
final String pipeSeparatedValues = values.keySet().stream().collect(Collectors.joining("|"));
75+
final String pipeSeparatedValues = values.keySet().stream().sorted(Comparator.naturalOrder()).collect(Collectors.joining("|"));
7476
dto.setValue(pipeSeparatedValues);
7577
}
7678

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,7 @@ UserRight.SURVEY_TOKEN_CREATE=Create survey tokens
16501650
UserRight.SURVEY_TOKEN_EDIT=Edit survey tokens
16511651
UserRight.SURVEY_TOKEN_DELETE=Delete survey tokens
16521652
UserRight.SURVEY_TOKEN_IMPORT=Import survey tokens
1653+
UserRight.SYSTEM_CONFIGURATION=System configuration
16531654

16541655
# UserRight descriptions
16551656
UserRight.Desc.CASE_ARCHIVE = Able to archive cases
@@ -1887,6 +1888,7 @@ UserRight.Desc.SURVEY_TOKEN_CREATE=Able to create survey tokens
18871888
UserRight.Desc.SURVEY_TOKEN_EDIT=Able to edit survey tokens
18881889
UserRight.Desc.SURVEY_TOKEN_DELETE=Able to delete survey tokens
18891890
UserRight.Desc.SURVEY_TOKEN_IMPORT=Able to import survey tokens
1891+
UserRight.Desc.SYSTEM_CONFIGURATION=Able to access system configuration
18901892

18911893
# UserRightGroup
18921894
UserRightGroup.GENERAL = General

sormas-api/src/test/java/de/symeda/sormas/api/systemconfiguration/SystemConfigurationValueDiseasesProviderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void testApplyValuesWithEmptyValues() {
102102

103103
provider.applyValues(values, dto);
104104

105-
assertThat(dto.getValue(), is((String) null));
105+
assertThat(dto.getValue(), is(""));
106106
}
107107

108108
/**
@@ -127,7 +127,7 @@ void testApplyValuesWithNullValues() {
127127

128128
provider.applyValues(values, dto);
129129

130-
assertThat(dto.getValue(), is((String) null));
130+
assertThat(dto.getValue(), is(""));
131131
}
132132

133133
/**

sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/system/SystemConfigurationController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2026 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
3+
* Copyright © 2016-2026 SORMAS Foundation gGmbH
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
66
* the Free Software Foundation, either version 3 of the License, or
@@ -15,10 +15,8 @@
1515

1616
package de.symeda.sormas.ui.configuration.system;
1717

18-
import org.slf4j.Logger;
19-
import org.slf4j.LoggerFactory;
20-
2118
import com.vaadin.ui.Notification;
19+
import com.vaadin.ui.Window;
2220

2321
import de.symeda.sormas.api.FacadeProvider;
2422
import de.symeda.sormas.api.i18n.I18nProperties;
@@ -54,6 +52,8 @@ public void editSystemConfigurationValue(String uuid) {
5452
SormasUI.get().getNavigator().navigateTo(SystemConfigurationView.VIEW_NAME);
5553
});
5654

57-
VaadinUiUtil.showModalPopupWindow(cdw, EDIT + " " + systemConfigurationValue.getKey());
55+
Window window = VaadinUiUtil.showModalPopupWindow(cdw, EDIT + " " + systemConfigurationValue.getKey());
56+
5857
}
58+
5959
}

sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/system/SystemConfigurationValueDynamicInput.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
3+
* Copyright © 2016-2026 SORMAS Foundation gGmbH
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
66
* the Free Software Foundation, either version 3 of the License, or
@@ -16,6 +16,8 @@
1616
package de.symeda.sormas.ui.configuration.system;
1717

1818
import java.lang.reflect.Method;
19+
import java.util.ArrayList;
20+
import java.util.Comparator;
1921
import java.util.HashMap;
2022
import java.util.Map;
2123
import java.util.Objects;
@@ -30,7 +32,6 @@
3032
import com.vaadin.ui.PasswordField;
3133
import com.vaadin.ui.TextField;
3234
import com.vaadin.ui.VerticalLayout;
33-
import com.vaadin.ui.themes.ValoTheme;
3435
import com.vaadin.util.ReflectTools;
3536

3637
import de.symeda.sormas.api.systemconfiguration.SystemConfigurationValueDataProvider;
@@ -86,6 +87,8 @@ public ValueChangeEvent(final Component source) {
8687

8788
private static final String STYLE_NAME_DYNAMIC_INPUT = "system-configuration-dynamic-input";
8889

90+
private static final String STYLE_NAME_DYNAMIC_INPUT_FIXED_SIZE = "system-configuration-dynamic-input-fixed-size";
91+
8992
private static final String STYLE_NAME_TOGGLE_PASSWORD = "toggle-password";
9093

9194
private static final String STYLE_NAME_WRAPPING_CHECKBOX_GROUP = "wrapping-checkbox-group";
@@ -174,6 +177,7 @@ protected Component initContent() {
174177
break;
175178
case CHECKBOX_GRID:
176179
mainLayout.addComponent(createCheckboxGrid());
180+
mainLayout.addStyleName(STYLE_NAME_DYNAMIC_INPUT_FIXED_SIZE);
177181
break;
178182
case PASSWORD:
179183
mainLayout.addComponent(createPasswordField());
@@ -273,10 +277,11 @@ private ComboBox<String> createDropdown() {
273277
private CheckBoxGroup<String> createCheckboxGrid() {
274278

275279
final var cbg = new CheckBoxGroup<String>();
276-
cbg.setItems(getValue().getDataProvider().getOptions().values());
280+
ArrayList<String> values = new ArrayList<>(getValue().getDataProvider().getOptions().values());
281+
values.sort(Comparator.naturalOrder());
282+
cbg.setItems(values);
277283
cbg.select(getValue().getDataProvider().getMappedValues(getValue()).values().toArray(new String[] {}));
278284
cbg.addValueChangeListener(event -> fireValueChange(cbg));
279-
cbg.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
280285
cbg.addStyleName(STYLE_NAME_WRAPPING_CHECKBOX_GROUP);
281286
cbg.setWidthFull();
282287
return cbg;

sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/system/SystemConfigurationView.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
3-
* Copyright © 2016-2026 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
3+
* Copyright © 2016-2026 SORMAS Foundation gGmbH
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
66
* the Free Software Foundation, either version 3 of the License, or
@@ -21,7 +21,6 @@
2121
import com.vaadin.ui.VerticalLayout;
2222

2323
import de.symeda.sormas.api.FacadeProvider;
24-
import de.symeda.sormas.api.customizableenum.CustomizableEnumCriteria;
2524
import de.symeda.sormas.api.i18n.Captions;
2625
import de.symeda.sormas.api.i18n.I18nProperties;
2726
import de.symeda.sormas.api.i18n.Strings;
@@ -30,7 +29,6 @@
3029
import de.symeda.sormas.api.systemconfiguration.SystemConfigurationValueDto;
3130
import de.symeda.sormas.ui.ViewModelProviders;
3231
import de.symeda.sormas.ui.configuration.AbstractConfigurationView;
33-
import de.symeda.sormas.ui.configuration.customizableenum.CustomizableEnumValuesView;
3432
import de.symeda.sormas.ui.configuration.infrastructure.components.SearchField;
3533
import de.symeda.sormas.ui.utils.ButtonHelper;
3634
import de.symeda.sormas.ui.utils.CssStyles;
@@ -119,7 +117,7 @@ private HorizontalLayout createFilterBar() {
119117
filterLayout.addComponent(categoryFilter);
120118

121119
filterLayout.addComponent(ButtonHelper.createButton(Captions.actionResetFilters, event -> {
122-
ViewModelProviders.of(CustomizableEnumValuesView.class).remove(CustomizableEnumCriteria.class);
120+
ViewModelProviders.of(SystemConfigurationView.class).remove(SystemConfigurationValueCriteria.class);
123121
navigateTo(null);
124122
}, CssStyles.FORCE_CAPTION));
125123

sormas-ui/src/main/webapp/VAADIN/themes/sormas/global.scss

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -443,41 +443,37 @@
443443
opacity: 0.5;
444444
}
445445

446+
.system-configuration-dynamic-input .system-configuration-dynamic-input-fixed-size {
447+
height: 30rem;
448+
overflow: auto;
449+
}
450+
446451
.system-configuration-dynamic-input .v-select-optiongroup-wrapping-checkbox-group {
447452
display: flex;
448453
flex-wrap: wrap;
449454
}
450455

451456
.system-configuration-dynamic-input .v-select-optiongroup-wrapping-checkbox-group > .v-checkbox {
452457
display: flex;
453-
flex-grow: 1;
454-
flex-shrink: 1;
455-
align-items:stretch;
456-
align-content:stretch;
457-
}
458-
459-
.system-configuration-dynamic-input .v-select-optiongroup-wrapping-checkbox-group > .v-checkbox label {
460-
width:100%;
461-
text-align:center;
462-
border:1px solid;
458+
width: calc(33.33% - 1.5rem);
463459
}
464460

465461
.system-configuration-dynamic-input .toggle-password .v-spacing {
466-
display:none;
462+
display: none;
467463
}
468464

469465
.system-configuration-dynamic-input .toggle-password .v-slot {
470-
width:100% !important;
466+
width: 100% !important;
471467

472468
}
473469

474470
.system-configuration-dynamic-input .toggle-password input {
475-
height:36px;
471+
height: 36px;
476472
}
477473

478474
.system-configuration-dynamic-input .toggle-password .v-button {
479-
margin-left:-4rem;
480-
margin-top:2px;
475+
margin-left: -4rem;
476+
margin-top: 2px;
481477
}
482478

483479
.case-notifier-side-view {

0 commit comments

Comments
 (0)