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

Commit 5d5a6c9

Browse files
author
vlad-ciucescu
authored
Merge pull request SORMAS-Foundation#3555 from hzi-braunschweig/2993-countries
Countries view fixes
2 parents b878a59 + c79ed40 commit 5d5a6c9

10 files changed

Lines changed: 45 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,9 @@ public interface Captions {
560560
String Country_externalId = "Country.externalId";
561561
String Country_isoCode = "Country.isoCode";
562562
String Country_unoCode = "Country.unoCode";
563+
String countryActiveCountries = "countryActiveCountries";
564+
String countryAllCountries = "countryAllCountries";
565+
String countryArchivedCountries = "countryArchivedCountries";
563566
String creationDate = "creationDate";
564567
String dashboardAlive = "dashboardAlive";
565568
String dashboardApplyCustomFilter = "dashboardApplyCustomFilter";

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,10 @@ PrescriptionExport.caseUuid=Case ID
13321332
PrescriptionExport.caseName=Case name
13331333

13341334
# Country
1335+
countryActiveCountries=Active countries
1336+
countryArchivedCountries=Archived countries
1337+
countryAllCountries=All countries
1338+
13351339
Country.archived=Archived
13361340
Country.externalId=External ID
13371341
Country.defaultName=Default name
-2.97 KB
Binary file not shown.
-2 Bytes
Binary file not shown.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ messageMissingEpiWeekFilter = Please fill in both epi week filter fields
673673
messageNoCasesSelected = You have not selected any cases
674674
messageNoClinicalVisitsSelected = You have not selected any clinical assessments
675675
messageNoContactsSelected = You have not selected any contacts
676-
messageNoCsvFile = You have not selected a file to upload. Please select a .csv file containing the cases you want to import from your computer.
676+
messageNoCsvFile = You have not selected a file to upload. Please select a .csv file containing the data you want to import from your computer.
677677
messageNoDocumentTemplateUploadFile = You have not selected a file to upload. Please select a .docx template file you want to import from your computer.
678678
messageNoDocumentUploadFile = You have not selected a file to upload. Please select a file you want to import from your computer.
679679
messageNoEventParticipantsSelected = You have not selected any event participants

sormas-api/src/main/resources/strings_de-CH.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ messageMissingEpiWeekFilter = Bitte beide Epi-Wochen-Filterfelder ausfüllen
657657
messageNoCasesSelected = Sie haben keine Fälle ausgewählt
658658
messageNoClinicalVisitsSelected = Sie haben keine klinischen Bewertungen ausgewählt
659659
messageNoContactsSelected = Sie haben keine Kontakte ausgewählt
660-
messageNoCsvFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine .csv-Datei, die die Fälle, die Sie von Ihrem Computer importieren möchten, enthält.
660+
messageNoCsvFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine .csv-Datei, die die Daten, die Sie von Ihrem Computer importieren möchten, enthält.
661661
messageNoDocumentTemplateUploadFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine .docx Dateivorlage, die Sie von Ihrem Computer importieren möchten.
662662
messageNoDocumentUploadFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine Datei aus, die Sie von Ihrem Computer importieren möchten.
663663
messageNoEventParticipantsSelected = Sie haben keine Teilnehmer*innen ausgewählt

sormas-api/src/main/resources/strings_de-DE.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ messageMissingEpiWeekFilter = Bitte beide Epi-Wochen-Filterfelder ausfüllen
657657
messageNoCasesSelected = Sie haben keine Fälle ausgewählt
658658
messageNoClinicalVisitsSelected = Sie haben keine klinischen Bewertungen ausgewählt
659659
messageNoContactsSelected = Sie haben keine Kontakte ausgewählt
660-
messageNoCsvFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine .csv-Datei, die die Fälle, die Sie von Ihrem Computer importieren möchten, enthält.
660+
messageNoCsvFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine .csv-Datei, die die Daten, die Sie von Ihrem Computer importieren möchten, enthält.
661661
messageNoDocumentTemplateUploadFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine .docx Dateivorlage, die Sie von Ihrem Computer importieren möchten.
662662
messageNoDocumentUploadFile = Sie haben keine Datei zum Hochladen ausgewählt. Bitte wählen Sie eine Datei aus, die Sie von Ihrem Computer importieren möchten.
663663
messageNoEventParticipantsSelected = Sie haben keine Teilnehmer*innen ausgewählt

sormas-api/src/test/java/de/symeda/sormas/api/doc/DataDictionaryGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.Date;
2828
import java.util.List;
2929

30+
import de.symeda.sormas.api.region.CountryDto;
3031
import org.apache.poi.ss.SpreadsheetVersion;
3132
import org.apache.poi.ss.usermodel.CellStyle;
3233
import org.apache.poi.ss.util.AreaReference;
@@ -102,6 +103,7 @@ public void generateDataDictionary() throws FileNotFoundException, IOException {
102103
createEntitySheet(workbook, EventDto.class, EventDto.I18N_PREFIX);
103104
createEntitySheet(workbook, EventParticipantDto.class, EventParticipantDto.I18N_PREFIX);
104105
createEntitySheet(workbook, FacilityDto.class, FacilityDto.I18N_PREFIX);
106+
createEntitySheet(workbook, CountryDto.class, CountryDto.I18N_PREFIX);
105107
createEntitySheet(workbook, RegionDto.class, RegionDto.I18N_PREFIX);
106108
createEntitySheet(workbook, DistrictDto.class, DistrictDto.I18N_PREFIX);
107109
createEntitySheet(workbook, CommunityDto.class, CommunityDto.I18N_PREFIX);

sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/infrastructure/CountriesView.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.Date;
44

55
import com.vaadin.icons.VaadinIcons;
6+
import com.vaadin.navigator.ViewChangeListener;
67
import com.vaadin.server.FileDownloader;
78
import com.vaadin.server.StreamResource;
89
import com.vaadin.ui.Alignment;
@@ -185,6 +186,9 @@ private HorizontalLayout createFilterBar() {
185186
relevanceStatusFilter.setWidth(220, Unit.PERCENTAGE);
186187
relevanceStatusFilter.setNullSelectionAllowed(false);
187188
relevanceStatusFilter.addItems((Object[]) EntityRelevanceStatus.values());
189+
relevanceStatusFilter.setItemCaption(EntityRelevanceStatus.ACTIVE, I18nProperties.getCaption(Captions.countryActiveCountries));
190+
relevanceStatusFilter.setItemCaption(EntityRelevanceStatus.ARCHIVED, I18nProperties.getCaption(Captions.countryArchivedCountries));
191+
relevanceStatusFilter.setItemCaption(EntityRelevanceStatus.ALL, I18nProperties.getCaption(Captions.countryAllCountries));
188192
relevanceStatusFilter.addValueChangeListener(e -> {
189193
criteria.relevanceStatus((EntityRelevanceStatus) e.getProperty().getValue());
190194
navigateTo(criteria);
@@ -225,4 +229,31 @@ private HorizontalLayout createFilterBar() {
225229
return filterLayout;
226230
}
227231

232+
@Override
233+
public void enter(ViewChangeListener.ViewChangeEvent event) {
234+
235+
super.enter(event);
236+
String params = event.getParameters().trim();
237+
if (params.startsWith("?")) {
238+
params = params.substring(1);
239+
criteria.fromUrlParams(params);
240+
}
241+
updateFilterComponents();
242+
grid.reload();
243+
}
244+
245+
public void updateFilterComponents() {
246+
247+
// TODO replace with Vaadin 8 databinding
248+
applyingCriteria = true;
249+
250+
resetButton.setVisible(criteria.hasAnyFilterActive());
251+
252+
if (relevanceStatusFilter != null) {
253+
relevanceStatusFilter.setValue(criteria.getRelevanceStatus());
254+
}
255+
searchField.setValue(criteria.getNameCodeLike());
256+
257+
applyingCriteria = false;
258+
}
228259
}

sormas-ui/src/main/java/de/symeda/sormas/ui/configuration/infrastructure/InfrastructureController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import de.symeda.sormas.api.region.AreaDto;
4343
import de.symeda.sormas.api.region.CommunityDto;
4444
import de.symeda.sormas.api.region.CountryDto;
45+
import de.symeda.sormas.api.region.CountryIndexDto;
4546
import de.symeda.sormas.api.region.DistrictDto;
4647
import de.symeda.sormas.api.region.DistrictIndexDto;
4748
import de.symeda.sormas.api.region.RegionDto;
@@ -682,7 +683,7 @@ public void archiveOrDearchiveAllSelectedItems(
682683
}
683684
break;
684685
case COUNTRY:
685-
for (CountryDto selectedRow : (Collection<CountryDto>) selectedRows) {
686+
for (CountryIndexDto selectedRow : (Collection<CountryIndexDto>) selectedRows) {
686687
if (archive) {
687688
FacadeProvider.getCountryFacade().archive(selectedRow.getUuid());
688689
} else {

0 commit comments

Comments
 (0)