Skip to content

Commit

Permalink
Merge pull request #111 from DP-3T/develop
Browse files Browse the repository at this point in the history
v1.5.1
  • Loading branch information
martinalig authored May 25, 2021
2 parents b9bc154 + 6f7d361 commit 95f3829
Show file tree
Hide file tree
Showing 18 changed files with 263 additions and 79 deletions.
23 changes: 2 additions & 21 deletions dpppt-config-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>ch.ubique.openapi</groupId>
<artifactId>doc-annotations</artifactId>
<version>1.0.1</version>
<version>1.0.4</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -180,27 +180,8 @@
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>ubique-oss-springboot-swagger3</id>
<name>bintray</name>
<url>https://dl.bintray.com/ubique-oss/springboot-swagger3</url>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>ubique-oss-springboot-swagger3</id>
<name>bintray</name>
<url>https://dl.bintray.com/ubique-oss/springboot-swagger3</url>
</pluginRepository>
</pluginRepositories>

<build>
<finalName>
dpppt-config-backend
Expand Down Expand Up @@ -296,7 +277,7 @@
<plugin>
<groupId>ch.ubique.openapi</groupId>
<artifactId>springboot-swagger-3</artifactId>
<version>1.2.8</version>
<version>1.3.3</version>
<configuration>
<apiVersion>1.0-gapple</apiVersion>
<basePackages>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public GaenConfigController(Messages messages,
@Documentation(description = "Build number of the app", example = "ios-200619.2333.175") @RequestParam String buildnr) {
ConfigResponse config = new ConfigResponse();
config.setInterOpsCountries(interOpsCountryCodes);
config.setTestInformationUrls(testLocationHelper.getTestInfoUrls());
config.setWhatToDoPositiveTestTexts(whatToDoPositiveTestTexts(messages));
config.setTestLocations(testLocationHelper.getTestLocations());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.dpppt.switzerland.backend.sdk.config.ws.helper;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import org.dpppt.switzerland.backend.sdk.config.ws.model.TestLocation;
import org.dpppt.switzerland.backend.sdk.config.ws.model.TestLocationCollection;
Expand All @@ -18,6 +20,7 @@ public class TestLocationHelper {

private final Messages messages;
private final TestLocationCollection testLocationCollection;
private final Map<String, String> testInfoUrls;

private static final List<String> ALL_CANTONS_AND_LIECHTENSTEIN = List.of("canton_aargau",
"canton_appenzell_ausserrhoden", "canton_appenzell_innerrhoden", "canton_basel_country",
Expand All @@ -44,6 +47,22 @@ public TestLocationHelper(Messages messages) {
testLocationCollection.setSr(getTestLocationsForLanguage(Locale.forLanguageTag("sr")));
testLocationCollection.setTi(getTestLocationsForLanguage(Locale.forLanguageTag("ti")));
testLocationCollection.setTr(getTestLocationsForLanguage(Locale.forLanguageTag("tr")));

this.testInfoUrls = new HashMap<>();
testInfoUrls.put("bs", messages.getMessage("test_info_url", Locale.forLanguageTag("bs")));
testInfoUrls.put("de", messages.getMessage("test_info_url", Locale.forLanguageTag("de")));
testInfoUrls.put("en", messages.getMessage("test_info_url", Locale.forLanguageTag("en")));
testInfoUrls.put("es", messages.getMessage("test_info_url", Locale.forLanguageTag("es")));
testInfoUrls.put("fr", messages.getMessage("test_info_url", Locale.forLanguageTag("fr")));
testInfoUrls.put("hr", messages.getMessage("test_info_url", Locale.forLanguageTag("hr")));
testInfoUrls.put("it", messages.getMessage("test_info_url", Locale.forLanguageTag("it")));
testInfoUrls.put("pt", messages.getMessage("test_info_url", Locale.forLanguageTag("pt")));
testInfoUrls.put("rm", messages.getMessage("test_info_url", Locale.forLanguageTag("rm")));
testInfoUrls.put("sq", messages.getMessage("test_info_url", Locale.forLanguageTag("sq")));
testInfoUrls.put("sr", messages.getMessage("test_info_url", Locale.forLanguageTag("sr")));
testInfoUrls.put("ti", messages.getMessage("test_info_url", Locale.forLanguageTag("ti")));
testInfoUrls.put("tr", messages.getMessage("test_info_url", Locale.forLanguageTag("tr")));

}

private List<TestLocation> getTestLocationsForLanguage(Locale language) {
Expand All @@ -57,5 +76,9 @@ private List<TestLocation> getTestLocationsForLanguage(Locale language) {
public TestLocationCollection getTestLocations() {
return this.testLocationCollection;
}

public Map<String, String> getTestInfoUrls() {
return this.testInfoUrls;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import ch.ubique.openapi.docannotations.Documentation;
Expand Down Expand Up @@ -39,6 +40,9 @@ public class ConfigResponse {

@Documentation(description = "list of ISO 3166-1 alpha-2 country codes describing the available interops countries")
private List<String> interOpsCountries = new ArrayList<>();

@Documentation(description = "Localized urls to test information website")
private Map<String, String> testInformationUrls;

public boolean isForceUpdate() {
return forceUpdate;
Expand Down Expand Up @@ -95,4 +99,12 @@ public List<String> getInterOpsCountries() {
public void setInterOpsCountries(List<String> interOpsCountries) {
this.interOpsCountries = interOpsCountries;
}

public Map<String, String> getTestInformationUrls() {
return testInformationUrls;
}

public void setTestInformationUrls(Map<String, String> testInformationUrls) {
this.testInformationUrls = testInformationUrls;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ bs:
faq_button_title: Često postavljana pitanja
meldungen_nomeldungen_faq1_title: Šta su poruke?
meldungen_nomeldungen_faq1_text: Aplikacija redovno proverava da li su drugi korisnici sa kojima ste bili u kontaktu prijavili pozitivan test.\n\nU slučaju moguće infekcije, dobićete obaveštenje na zaključanom ekranu.
meldungen_nomeldungen_faq2_titel: Šta je moguća infekcija?
meldungen_nomeldungen_faq2_text: Aplikacija ne samo da proverava da li ste imali kontakte sa inficiranim osobama, već i koliko dugo su oni trajali i koliko bliski su bili.\n\nBićete obavešteni samo ako postoji dovoljno velika mogućnost infekcije.
meldungen_detail_explanation_text3: Preko info linije aplikacije SwissCovid možete da dobijete savete o mogućnosti besplatnog testiranja.
meldungen_meldungen_faq1_title: Da li moram da pozovem?
meldungen_meldungen_faq1_text: Preporučuje se da pozovete svaki put kada dobijete novu poruku.\n\nPritom ostajete anonimni. Lični podaci se ne prikupljaju.\n\nSavetovanje je besplatno; plaćaju se samo troškovi poziva.
Expand Down Expand Up @@ -491,3 +489,4 @@ bs:
meldungen_detail_free_test_in_x_tagen: Za {COUNT} dana
meldungen_detail_free_test_now: Sada
meldungen_detail_free_test_tomorrow: Za 1 dan
test_info_url: https://www.bag.admin.ch/bag/en/home/krankheiten/ausbrueche-epidemien-pandemien/aktuelle-ausbrueche-epidemien/novel-cov/testen.html
Loading

0 comments on commit 95f3829

Please sign in to comment.