diff --git a/.github/workflows/self-host-CD.yml b/.github/workflows/self-host-CD.yml index 0407e932..dbc1db4c 100644 --- a/.github/workflows/self-host-CD.yml +++ b/.github/workflows/self-host-CD.yml @@ -26,7 +26,8 @@ jobs: GOOGLE_API_KEY: ${{secrets.GOOGLE_API_KEY}} DAY_SMS_LIMIT: ${{secrets.DAY_SMS_LIMIT}} RISK_THRESHOLD: ${{secrets.RISK_THRESHOLD}} - run: sudo docker run -d --name disaster-alert-container --network disaster-net -p 8080:8080 \ + run: | + sudo docker run -d --name disaster-alert-container --network disaster-net -p 8080:8080 \ -e TWILIO_ACCOUNT_SID=$TWILIO_ACCOUNT_SID \ -e TWILIO_AUTH_TOKEN=$TWILIO_AUTH_TOKEN \ -e TWILIO_PHONE_NUMBER=$TWILIO_PHONE_NUMBER \ diff --git a/src/main/java/pl/ateam/disasteralerts/disasteralert/DisasterType.java b/src/main/java/pl/ateam/disasteralerts/disasteralert/DisasterType.java index d5a18517..46b87c07 100644 --- a/src/main/java/pl/ateam/disasteralerts/disasteralert/DisasterType.java +++ b/src/main/java/pl/ateam/disasteralerts/disasteralert/DisasterType.java @@ -1,5 +1,21 @@ package pl.ateam.disasteralerts.disasteralert; public enum DisasterType { - STORM, FIRE, FLOOD, HURRICANE, BLIZZARD, DROUGHT, HEAT + STORM("Burza"), + FIRE("Pożar"), + FLOOD("Powódź"), + HURRICANE("Huragan"), + BLIZZARD("Śnieżyca"), + DROUGHT("Susza"), + HEAT("Upał"); + + private final String polishName; + + DisasterType(String polishName) { + this.polishName = polishName; + } + + public String getPolishName() { + return polishName; + } } diff --git a/src/main/java/pl/ateam/disasteralerts/web/DisasterViewController.java b/src/main/java/pl/ateam/disasteralerts/web/DisasterViewController.java index ae17688c..932cd9c7 100644 --- a/src/main/java/pl/ateam/disasteralerts/web/DisasterViewController.java +++ b/src/main/java/pl/ateam/disasteralerts/web/DisasterViewController.java @@ -41,6 +41,7 @@ public String showAddDisasterForm(Model model, @AuthenticationPrincipal AppUser model.addAttribute("disasterAddDTO", new DisasterAddDTO(null, null, null, null)); model.addAttribute("selectedLocation", appUser.getUserDTO().location()); model.addAttribute("googleApiKey", googleApiKey); + model.addAttribute("disasterTypes", DisasterType.values()); return "addDisaster"; } @@ -73,6 +74,7 @@ public String showDisasterList(Model model, @AuthenticationPrincipal AppUser use model.addAttribute("googleApiKey", googleApiKey); model.addAttribute("inLocationDisasterAmount", inLocationDisastersAmount()); + model.addAttribute("disasterTypes", DisasterType.values()); return "listDisasters"; } diff --git a/src/main/resources/db/changelog/dev.sql b/src/main/resources/db/changelog/dev.sql index 3d7d0ad7..e5b7c7f7 100644 --- a/src/main/resources/db/changelog/dev.sql +++ b/src/main/resources/db/changelog/dev.sql @@ -150,4 +150,7 @@ CREATE TABLE sms_limits update_date TIMESTAMP WITHOUT TIME ZONE, limit_counter INT NOT NULL, CONSTRAINT pk_sms_limits PRIMARY KEY (id) -); \ No newline at end of file +); + +-- changeset jkuznik:1728934675080-26 +ALTER TABLE users DROP CONSTRAINT uc_users_username; \ No newline at end of file diff --git a/src/main/resources/templates/addDisaster.html b/src/main/resources/templates/addDisaster.html index 25a4069e..a876aad5 100644 --- a/src/main/resources/templates/addDisaster.html +++ b/src/main/resources/templates/addDisaster.html @@ -23,7 +23,7 @@

Dodaj + th:text="${type.getPolishName()}"> diff --git a/src/main/resources/templates/listDisasters.html b/src/main/resources/templates/listDisasters.html index 2e088803..81b9eb00 100644 --- a/src/main/resources/templates/listDisasters.html +++ b/src/main/resources/templates/listDisasters.html @@ -91,7 +91,7 @@

Sprawdź Rodzaj zdarzenia
@@ -119,7 +119,7 @@

Sprawdź - +