From 24e5d3ec6e6f2c0e674bd3b9c833f602de4670e0 Mon Sep 17 00:00:00 2001 From: Der-Alex-K <18263366+Der-Alex-K@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:59:17 +0200 Subject: [PATCH 1/6] Feat/dave 200 anbindung featureservices (#216) * add default TagesTyp unspecified * prettier * remove unused code * an neue api angepasst * fix format bug * update versions * update versions * update versions * fix route --- apigateway/pom.xml | 4 +- frontend/package-lock.json | 83 ++++++++--------- frontend/package.json | 14 +-- frontend/pom.xml | 4 +- frontend/src/App.vue | 4 +- .../service/MessstelleOptionsmenuService.ts | 11 --- .../src/components/map/ZaehlstelleMap.vue | 7 +- .../components/messstelle/MessstelleInfo.vue | 17 ++-- .../components/messstelle/ValidWochentage.vue | 91 ++----------------- .../messstelle/charts/BannerMesstelleTabs.vue | 10 +- .../messstelle/charts/MessstelleDiagramme.vue | 72 +++++++++++---- .../optionsmenue/FilterOptionen.vue | 11 ++- .../optionsmenue/OptionsmenueMessstelle.vue | 2 +- .../optionsmenue/panels/ZeitPanel.vue | 3 +- frontend/src/store/MessstelleStore.ts | 16 ++++ frontend/src/types/enum/TagesTyp.ts | 2 + .../messstelle/LadeProcessedMessdatenDTO.ts | 3 + .../messstelle/ValidWochentageInPeriodDto.ts | 8 -- .../ValidWochentageInPeriodRequestDto.ts | 7 -- frontend/src/util/DateUtils.ts | 20 ++-- frontend/src/util/DefaultObjectCreator.ts | 44 ++++++++- frontend/src/util/GlobalInfoMessage.ts | 8 ++ 22 files changed, 229 insertions(+), 212 deletions(-) delete mode 100644 frontend/src/types/messstelle/ValidWochentageInPeriodDto.ts delete mode 100644 frontend/src/types/messstelle/ValidWochentageInPeriodRequestDto.ts diff --git a/apigateway/pom.xml b/apigateway/pom.xml index cf0c6cff..b8f7613f 100644 --- a/apigateway/pom.xml +++ b/apigateway/pom.xml @@ -16,7 +16,7 @@ ${java.version} ${java.version} ${java.version} - 3.3.3 + 3.3.4 2023.0.3 1.18.34 @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.5.1 ${jvm.options} diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 10794998..b3f26b7e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,27 +14,27 @@ "pinia": "^2.1.7", "sass": "^1.77.6", "vue": "^3.4.31", - "vue-router": "^4.4.0", + "vue-router": "^4.4.5", "vuetify": "^3.7.1" }, "devDependencies": { "@babel/types": "^7.23.0", - "@ianvs/prettier-plugin-sort-imports": "^4.1.1", + "@ianvs/prettier-plugin-sort-imports": "^4.3.1", "@muenchen/prettier-codeformat": "^1.0.1", "@svgdotjs/svg.js": "3.0.16", "@types/jsdom": "^21.1.4", "@types/leaflet": "^1.9.12", "@types/leaflet.fullscreen": "^3.0.2", "@types/leaflet.markercluster": "^1.5.4", - "@types/lodash": "^4.17.6", - "@types/node": "^18.18.8", + "@types/lodash": "^4.17.10", + "@types/node": "^18.19.55", "@vitejs/plugin-vue": "^4.4.0", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.1", "base64-blob": "1.4.1", "echarts": "^5.5.1", - "eslint": "^8.52.0", + "eslint": "^8.57.1", "eslint-plugin-vue": "^9.18.1", "html2canvas": "^1.4.1", "jsdom": "^22.1.0", @@ -43,11 +43,11 @@ "leaflet.markercluster": "^1.5.3", "leaflet.nontiledlayer": "^1.0.9", "lodash": "^4.17.21", - "prettier": "^3.0.3", + "prettier": "^3.3.3", "save-svg-as-png": "1.4.17", "typescript": "^5.2.2", "unplugin-fonts": "^1.0.3", - "vite": "^4.5.0", + "vite": "^4.5.5", "vite-plugin-vuetify": "^1.0.2", "vitest": "^0.34.6", "vue-echarts": "^6.6.1", @@ -882,9 +882,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -896,13 +896,13 @@ "integrity": "sha512-CnD7zLItIzt86q4Sj3kZUiLcBk1dSk81qcqgMGaZe7SQ1P8hFNxhMl5AZthK1zrDM5m74VVhaOpuMGIL4gagaA==" }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", "deprecated": "Use @eslint/config-array instead", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", + "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", "minimatch": "^3.0.5" }, @@ -931,9 +931,9 @@ "dev": true }, "node_modules/@ianvs/prettier-plugin-sort-imports": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@ianvs/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.0.tgz", - "integrity": "sha512-OOMtUcO4J3LoL63dOKAe7bn+lSRRPeit2DqNHpx+wvBp3Grejo2PMaK4Mp1mwy8pnat64ccSgk/lBZbsAdLErw==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@ianvs/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.3.1.tgz", + "integrity": "sha512-ZHwbyjkANZOjaBm3ZosADD2OUYGFzQGxfy67HmGZU94mHqe7g1LCMA7YYKB1Cq+UTPCBqlAYapY0KXAjKEw8Sg==", "dev": true, "dependencies": { "@babel/core": "^7.24.0", @@ -1346,15 +1346,15 @@ } }, "node_modules/@types/lodash": { - "version": "4.17.6", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", - "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==", + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-YpS0zzoduEhuOWjAotS6A5AVCva7X4lVlYLF0FYHAY9sdraBfnatttHItlWeZdGhuEkf+OzMNg2ZYAx8t+52uQ==", "dev": true }, "node_modules/@types/node": { - "version": "18.19.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz", - "integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==", + "version": "18.19.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.55.tgz", + "integrity": "sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1812,9 +1812,9 @@ } }, "node_modules/@vue/devtools-api": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.1.tgz", - "integrity": "sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA==" + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==" }, "node_modules/@vue/eslint-config-prettier": { "version": "8.0.0", @@ -2817,16 +2817,17 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -4639,9 +4640,9 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -5654,9 +5655,9 @@ } }, "node_modules/vite": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", - "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", + "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", "devOptional": true, "dependencies": { "esbuild": "^0.18.10", @@ -6077,11 +6078,11 @@ } }, "node_modules/vue-router": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.4.0.tgz", - "integrity": "sha512-HB+t2p611aIZraV2aPSRNXf0Z/oLZFrlygJm+sZbdJaW6lcFqEDQwnzUBXn+DApw+/QzDU/I9TeWx9izEjTmsA==", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.4.5.tgz", + "integrity": "sha512-4fKZygS8cH1yCyuabAXGUAsyi1b2/o/OKgu/RUb+znIYOxPRxdkytJEx+0wGcpBE1pX6vUgh5jwWOKRGvuA/7Q==", "dependencies": { - "@vue/devtools-api": "^6.5.1" + "@vue/devtools-api": "^6.6.4" }, "funding": { "url": "https://github.com/sponsors/posva" diff --git a/frontend/package.json b/frontend/package.json index dd157264..3e8f2087 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,27 +18,27 @@ "pinia": "^2.1.7", "sass": "^1.77.6", "vue": "^3.4.31", - "vue-router": "^4.4.0", + "vue-router": "^4.4.5", "vuetify": "^3.7.1" }, "devDependencies": { "@babel/types": "^7.23.0", - "@ianvs/prettier-plugin-sort-imports": "^4.1.1", + "@ianvs/prettier-plugin-sort-imports": "^4.3.1", "@muenchen/prettier-codeformat": "^1.0.1", "@svgdotjs/svg.js": "3.0.16", "@types/jsdom": "^21.1.4", "@types/leaflet": "^1.9.12", "@types/leaflet.fullscreen": "^3.0.2", "@types/leaflet.markercluster": "^1.5.4", - "@types/lodash": "^4.17.6", - "@types/node": "^18.18.8", + "@types/lodash": "^4.17.10", + "@types/node": "^18.19.55", "@vitejs/plugin-vue": "^4.4.0", "@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.1", "base64-blob": "1.4.1", "echarts": "^5.5.1", - "eslint": "^8.52.0", + "eslint": "^8.57.1", "eslint-plugin-vue": "^9.18.1", "html2canvas": "^1.4.1", "jsdom": "^22.1.0", @@ -47,11 +47,11 @@ "leaflet.markercluster": "^1.5.3", "leaflet.nontiledlayer": "^1.0.9", "lodash": "^4.17.21", - "prettier": "^3.0.3", + "prettier": "^3.3.3", "save-svg-as-png": "1.4.17", "typescript": "^5.2.2", "unplugin-fonts": "^1.0.3", - "vite": "^4.5.0", + "vite": "^4.5.5", "vite-plugin-vuetify": "^1.0.2", "vitest": "^0.34.6", "vue-echarts": "^6.6.1", diff --git a/frontend/pom.xml b/frontend/pom.xml index 706ebab9..eec7f33e 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -15,8 +15,8 @@ ${java.version} ${java.version} ${java.version} - 3.0.0 - 3.1.0 + 3.4.1 + 3.4.0 src,public src,public diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 11ee2cb2..bb563a3b 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -58,7 +58,7 @@ @@ -69,6 +69,7 @@ diff --git a/frontend/src/components/messstelle/charts/BannerMesstelleTabs.vue b/frontend/src/components/messstelle/charts/BannerMesstelleTabs.vue index a64ccd28..dc085ddf 100644 --- a/frontend/src/components/messstelle/charts/BannerMesstelleTabs.vue +++ b/frontend/src/components/messstelle/charts/BannerMesstelleTabs.vue @@ -5,10 +5,14 @@ size="36" icon="mdi-alert-decagram-outline" /> - {{ ZEITRAUM_GROESSER_FUENF_JAHRE }} +

+ {{ message }} +

diff --git a/frontend/src/components/messstelle/charts/MessstelleDiagramme.vue b/frontend/src/components/messstelle/charts/MessstelleDiagramme.vue index 3f636079..a301a2f2 100644 --- a/frontend/src/components/messstelle/charts/MessstelleDiagramme.vue +++ b/frontend/src/components/messstelle/charts/MessstelleDiagramme.vue @@ -40,16 +40,17 @@ width="100%" class="overflow-y-auto" > - - -

- {{ globalInfoMessage.NO_BELASTUNGSPLAN }} -

-
+ + - + + @@ -78,13 +86,20 @@ - + + @@ -92,14 +107,21 @@ - + + @@ -127,7 +149,6 @@ diff --git a/frontend/src/components/messstelle/optionsmenue/panels/ZeitauswahlRadiogroup.vue b/frontend/src/components/messstelle/optionsmenue/panels/ZeitauswahlRadiogroup.vue index 4a214ac7..3b38fd7f 100644 --- a/frontend/src/components/messstelle/optionsmenue/panels/ZeitauswahlRadiogroup.vue +++ b/frontend/src/components/messstelle/optionsmenue/panels/ZeitauswahlRadiogroup.vue @@ -123,11 +123,39 @@ function zeitauswahlChanged() { } else if (chosenOptionsCopy.value.zeitauswahl === Zeitauswahl.STUNDE) { chosenOptionsCopy.value.zeitblock = ZeitblockStuendlich.ZB_00_01; } else if ( - chosenOptionsCopy.value.zeitauswahl === Zeitauswahl.SPITZENSTUNDE_KFZ || - chosenOptionsCopy.value.zeitauswahl === Zeitauswahl.SPITZENSTUNDE_RAD || + chosenOptionsCopy.value.zeitauswahl === Zeitauswahl.SPITZENSTUNDE_KFZ + ) { + chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_00_06; + resetFahrzeuge(); + chosenOptionsCopy.value.fahrzeuge.kraftfahrzeugverkehr = true; + } else if ( + chosenOptionsCopy.value.zeitauswahl === Zeitauswahl.SPITZENSTUNDE_RAD + ) { + chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_00_06; + resetFahrzeuge(); + chosenOptionsCopy.value.fahrzeuge.radverkehr = true; + } else if ( chosenOptionsCopy.value.zeitauswahl === Zeitauswahl.SPITZENSTUNDE_FUSS ) { chosenOptionsCopy.value.zeitblock = Zeitblock.ZB_00_06; + resetFahrzeuge(); + chosenOptionsCopy.value.fahrzeuge.fussverkehr = true; + } + + function resetFahrzeuge() { + chosenOptionsCopy.value.fahrzeuge.kraftfahrzeugverkehr = false; + chosenOptionsCopy.value.fahrzeuge.schwerverkehr = false; + chosenOptionsCopy.value.fahrzeuge.gueterverkehr = false; + chosenOptionsCopy.value.fahrzeuge.schwerverkehrsanteilProzent = false; + chosenOptionsCopy.value.fahrzeuge.gueterverkehrsanteilProzent = false; + chosenOptionsCopy.value.fahrzeuge.radverkehr = false; + chosenOptionsCopy.value.fahrzeuge.fussverkehr = false; + chosenOptionsCopy.value.fahrzeuge.lastkraftwagen = false; + chosenOptionsCopy.value.fahrzeuge.lastzuege = false; + chosenOptionsCopy.value.fahrzeuge.busse = false; + chosenOptionsCopy.value.fahrzeuge.kraftraeder = false; + chosenOptionsCopy.value.fahrzeuge.personenkraftwagen = false; + chosenOptionsCopy.value.fahrzeuge.lieferwagen = false; } } From 7ac4bcade642783f1019a9e9f458bb18b8352b1a Mon Sep 17 00:00:00 2001 From: Der-Alex-K <18263366+Der-Alex-K@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:26:02 +0100 Subject: [PATCH 4/6] Bug/sammler (#226) * replace label through placeholder * fix speeddial overlap * add Tooltip to speeddials --- frontend/src/components/app/SearchInputField.vue | 2 +- frontend/src/components/messstelle/charts/SpeedDial.vue | 1 + frontend/src/components/zaehlstelle/ZaehldatenDiagramme.vue | 2 +- frontend/src/views/HomeView.vue | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/app/SearchInputField.vue b/frontend/src/components/app/SearchInputField.vue index 009bbdef..64ac747e 100644 --- a/frontend/src/components/app/SearchInputField.vue +++ b/frontend/src/components/app/SearchInputField.vue @@ -9,7 +9,7 @@ flat item-title="text" hide-details - label="Suche" + placeholder="Suche" no-filter prepend-inner-icon="mdi-magnify" return-object diff --git a/frontend/src/components/messstelle/charts/SpeedDial.vue b/frontend/src/components/messstelle/charts/SpeedDial.vue index d16e1f04..4b4239de 100644 --- a/frontend/src/components/messstelle/charts/SpeedDial.vue +++ b/frontend/src/components/messstelle/charts/SpeedDial.vue @@ -7,6 +7,7 @@ Date: Mon, 18 Nov 2024 11:42:01 +0100 Subject: [PATCH 5/6] DAVE-418 BUG Austausch Custom Date Picker durch vue3datepicker (#230) --- frontend/package-lock.json | 24 ++ frontend/package.json | 1 + frontend/src/components/common/DatePicker.vue | 143 ----------- .../src/components/common/DateRangePicker.vue | 223 ++++++++++++++++++ .../optionsmenue/OptionsmenueMessstelle.vue | 4 +- .../optionsmenue/panels/ZeitPanel.vue | 142 ++++------- .../optionsmenue/OptionsmenueZaehlstelle.vue | 4 +- 7 files changed, 292 insertions(+), 249 deletions(-) delete mode 100644 frontend/src/components/common/DatePicker.vue create mode 100644 frontend/src/components/common/DateRangePicker.vue diff --git a/frontend/package-lock.json b/frontend/package-lock.json index b3f26b7e..3f1ac776 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@fontsource/roboto": "^4.5.8", "@mdi/font": "7.3.67", + "@vuepic/vue-datepicker": "^10.0.0", "moment": "^2.29.4", "pinia": "^2.1.7", "sass": "^1.77.6", @@ -1957,6 +1958,20 @@ "vue-component-type-helpers": "^2.0.0" } }, + "node_modules/@vuepic/vue-datepicker": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@vuepic/vue-datepicker/-/vue-datepicker-10.0.0.tgz", + "integrity": "sha512-ujlk3ahftVQpyCJ8hq7TmOOHrf/XFJI1ZcAh/FRB5Ci62Vq5HmHf6xux5KVi5SPUFRTJY78m+uDhYy1M+8RZ9w==", + "dependencies": { + "date-fns": "^4.1.0" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "vue": ">=3.2.0" + } + }, "node_modules/@vuetify/loader-shared": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/@vuetify/loader-shared/-/loader-shared-1.7.1.tgz", @@ -2569,6 +2584,15 @@ "node": ">=14" } }, + "node_modules/date-fns": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index 3e8f2087..0d3bfb84 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "dependencies": { "@fontsource/roboto": "^4.5.8", "@mdi/font": "7.3.67", + "@vuepic/vue-datepicker": "^10.0.0", "moment": "^2.29.4", "pinia": "^2.1.7", "sass": "^1.77.6", diff --git a/frontend/src/components/common/DatePicker.vue b/frontend/src/components/common/DatePicker.vue deleted file mode 100644 index 34231828..00000000 --- a/frontend/src/components/common/DatePicker.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - diff --git a/frontend/src/components/common/DateRangePicker.vue b/frontend/src/components/common/DateRangePicker.vue new file mode 100644 index 00000000..838a9bd0 --- /dev/null +++ b/frontend/src/components/common/DateRangePicker.vue @@ -0,0 +1,223 @@ + + + diff --git a/frontend/src/components/messstelle/optionsmenue/OptionsmenueMessstelle.vue b/frontend/src/components/messstelle/optionsmenue/OptionsmenueMessstelle.vue index cf87030d..4f20cff7 100644 --- a/frontend/src/components/messstelle/optionsmenue/OptionsmenueMessstelle.vue +++ b/frontend/src/components/messstelle/optionsmenue/OptionsmenueMessstelle.vue @@ -112,9 +112,9 @@ const messstelle = computed(() => { const getContentSheetHeight = computed(() => { if (display.xl.value) { - return "650px"; + return "750px"; } - return "400px"; + return "500px"; }); const isAnwender = computed(() => { diff --git a/frontend/src/components/messstelle/optionsmenue/panels/ZeitPanel.vue b/frontend/src/components/messstelle/optionsmenue/panels/ZeitPanel.vue index 88fa28ff..5e95922d 100644 --- a/frontend/src/components/messstelle/optionsmenue/panels/ZeitPanel.vue +++ b/frontend/src/components/messstelle/optionsmenue/panels/ZeitPanel.vue @@ -18,58 +18,28 @@ /> - - - - - - - - - - - - + -
+

Hinweise:

Als Anwender beträgt der maximal mögliche Auswahlzeitraum 5 Jahre.

-

+

Alle Auswertungen stellen Durchschnittswerte des ausgewählten Zeitraums dar.

@@ -79,11 +49,11 @@ - + 1); + +const isDateRange = computed(() => { + const startDate = head(chosenOptionsCopy.value.zeitraum); + const isValidStartDate = moment(startDate, "YYYY-MM-DD", true).isValid(); + const endDate = last(chosenOptionsCopy.value.zeitraum); + const isValidEndDate = moment(endDate, "YYYY-MM-DD", true).isValid(); + return isValidStartDate && isValidEndDate && !isEqual(startDate, endDate); +}); onMounted(() => { const messstelleId = route.params.messstelleId as string; @@ -163,46 +141,35 @@ const isAnwender = computed(() => { }); const minDate = computed(() => { - if (messstelleInfo.value.realisierungsdatum >= "2006-01-01") - return messstelleInfo.value.realisierungsdatum; - else return "2006-01-01"; -}); - -const minDateRange = computed(() => { - return dateUtils.formatDateToISO(nextDayOfVon.value); -}); - -const nextDayOfVon = computed(() => { - const nextDay = new Date(dateVon.value); - nextDay.setDate(dateVon.value.getDate() + 1); - return nextDay; + const startdatum = new Date("2006-01-01"); + const realisierungsdatum = new Date(messstelleInfo.value.realisierungsdatum); + if ( + !isNil(messstelleInfo.value.realisierungsdatum) && + realisierungsdatum >= startdatum + ) + return realisierungsdatum; + else return startdatum; }); const maxDate = computed(() => { - const yesterday = new Date(new Date().setDate(new Date().getDate() - 1)) - .toISOString() - .slice(0, 10); - return messstelleInfo.value.abbaudatum ?? yesterday; + const yesterday = new Date(new Date().setDate(new Date().getDate() - 1)); + return isNil(messstelleInfo.value.abbaudatum) + ? yesterday + : new Date(messstelleInfo.value.abbaudatum); }); -const dateVon = computed({ - get() { - return new Date(chosenOptionsCopy.value.zeitraum[0]); - }, - - set(value: Date) { - saveDateValueVon(value); - }, -}); -const dateBis = computed({ +const zeitraum = computed({ get() { - return chosenOptionsCopy.value.zeitraum.length === 2 - ? new Date(chosenOptionsCopy.value.zeitraum[1]) - : nextDayOfVon.value; + return toArray(chosenOptionsCopy.value.zeitraum).map( + (date) => new Date(date) + ); }, - set(value: Date) { - saveDateValueBis(value); + set(dates: Array | undefined) { + const newZeitraum = toArray(dates).map((date) => + dateUtils.formatDateToISO(date) + ); + chosenOptionsCopy.value.zeitraum = newZeitraum; }, }); @@ -235,33 +202,4 @@ function calculateChoosableOptions(): void { chosenOptionsCopy.value.zeitraum[0] ); } - -function resetDates() { - if (needRange.value) { - saveDateValueBis(dateBis.value); - } else { - if (chosenOptionsCopy.value.zeitraum.length === 2) { - chosenOptionsCopy.value.zeitraum.pop(); - } - chosenOptionsCopy.value.tagesTyp = TagesTyp.UNSPECIFIED; - } -} - -function saveDateValueVon(toSave: Date) { - const dateToSave = dateUtils.formatDateToISO(toSave); - if (chosenOptionsCopy.value.zeitraum.length === 0) { - chosenOptionsCopy.value.zeitraum.push(dateToSave); - } else { - chosenOptionsCopy.value.zeitraum[0] = dateToSave; - } -} - -function saveDateValueBis(toSave: Date) { - const dateToSave = dateUtils.formatDateToISO(toSave); - if (chosenOptionsCopy.value.zeitraum.length === 2) { - chosenOptionsCopy.value.zeitraum[1] = dateToSave; - } else { - chosenOptionsCopy.value.zeitraum.push(dateToSave); - } -} diff --git a/frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue b/frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue index a75086be..9a6d97f3 100644 --- a/frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue +++ b/frontend/src/components/zaehlstelle/optionsmenue/OptionsmenueZaehlstelle.vue @@ -162,9 +162,9 @@ const options = computed(() => { const getContentSheetHeight = computed(() => { if (display.xl.value) { - return "650px"; + return "750px"; } - return "400px"; + return "500px"; }); /** From bd16ff633e2f766186cedbce6b6aeabc57fde48c Mon Sep 17 00:00:00 2001 From: Der-Alex-K <18263366+Der-Alex-K@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:26:43 +0100 Subject: [PATCH 6/6] Feat/dave 205 gesamtauswertungen ausgabe excel (#231) * Download funktionalitaet fuer xlsx eingebaut und refactoring des FetchService * umgestellt auf neue Datenstruktur * Reviewanmerkungen umgesetzt * Reviewanmerkungen umgesetzt * linter * Reviewanmerkungen umgesetzt * Reviewanmerkungen umgesetzt --- frontend/src/api/service/FetchService.ts | 85 ++++++++-------- .../src/api/service/GeneratePdfService.ts | 8 +- .../service/MessstelleAuswertungService.ts | 4 +- .../src/components/common/DateRangePicker.vue | 6 +- .../messstelle/charts/MessstelleDiagramme.vue | 26 +++-- .../stepper/AuswertungStepper.vue | 41 +++++--- .../stepper/OrtStepContent.vue | 99 +++++++++++-------- .../zaehlstelle/ZaehldatenDiagramme.vue | 22 ++--- frontend/src/types/common/KeyValObject.ts | 4 + .../auswertung/MessstelleAuswertungIdDTO.ts | 4 + .../MessstelleAuswertungOptionsDTO.ts | 4 +- frontend/src/util/DefaultObjectCreator.ts | 3 +- frontend/src/views/AuswertungView.vue | 20 ++-- frontend/src/views/PdfReportView.vue | 8 +- 14 files changed, 184 insertions(+), 150 deletions(-) create mode 100644 frontend/src/types/common/KeyValObject.ts create mode 100644 frontend/src/types/messstelle/auswertung/MessstelleAuswertungIdDTO.ts diff --git a/frontend/src/api/service/FetchService.ts b/frontend/src/api/service/FetchService.ts index 7f4720cd..2bd34b8d 100644 --- a/frontend/src/api/service/FetchService.ts +++ b/frontend/src/api/service/FetchService.ts @@ -11,7 +11,7 @@ export default class FetchService { static getData(endpoint: string, errorMessage: string): Promise { const url = `${this.BASE}/${endpoint}`; const request = FetchUtils.getGETConfig(); - return FetchService.sendRequest(url, request, errorMessage); + return FetchService.sendRequestForJson(url, request, errorMessage); } static postData( @@ -21,7 +21,27 @@ export default class FetchService { ): Promise { const url = `${this.BASE}/${endpoint}`; const request = FetchUtils.getPOSTConfig(dataToSave); - return FetchService.sendRequest(url, request, errorMessage); + return FetchService.sendRequestForJson(url, request, errorMessage); + } + + static postForPdf( + dataToSave: any, + endpoint: string, + errorMessage: string + ): Promise { + const url = `${this.BASE}/${endpoint}`; + const request = FetchUtils.getPdfPOSTConfig(dataToSave); + return FetchService.sendRequestForBlob(url, request, errorMessage); + } + + static postForBlob( + dataToSave: any, + endpoint: string, + errorMessage: string + ): Promise { + const url = `${this.BASE}/${endpoint}`; + const request = FetchUtils.getPOSTConfig(dataToSave); + return FetchService.sendRequestForBlob(url, request, errorMessage); } static patchData( @@ -31,7 +51,7 @@ export default class FetchService { ): Promise { const url = `${this.BASE}/${endpoint}`; const request = FetchUtils.getPATCHConfig(dataToSave); - return FetchService.sendRequest(url, request, errorMessage); + return FetchService.sendRequestForJson(url, request, errorMessage); } static putData( @@ -41,14 +61,34 @@ export default class FetchService { ): Promise { const url = `${this.BASE}/${endpoint}`; const request = FetchUtils.getPUTConfig(dataToSave); - return FetchService.sendRequest(url, request, errorMessage); + return FetchService.sendRequestForJson(url, request, errorMessage); } - private static sendRequest( + private static sendRequestForJson( url: string, request: RequestInit, errorMessage: string ): Promise { + return this.sendRequest(url, request, errorMessage).then((response) => { + return response.json(); + }); + } + + private static sendRequestForBlob( + url: string, + request: RequestInit, + errorMessage: string + ): Promise { + return this.sendRequest(url, request, errorMessage).then((response) => { + return response.blob(); + }); + } + + private static sendRequest( + url: string, + request: RequestInit, + errorMessage: string + ): Promise { return fetch(url, request) .catch((error) => { throw new ApiError( @@ -93,41 +133,6 @@ export default class FetchService { `Fehler: ${response.status} ${response.statusText}` ); } - return response.json(); - }); - } - - static postForPdf( - dataToSave: any, - endpoint: string, - errorMessage: string - ): Promise { - const url = `${this.BASE}/${endpoint}`; - const request = FetchUtils.getPdfPOSTConfig(dataToSave); - return FetchService.sendRequestForPDF(url, request, errorMessage); - } - - private static sendRequestForPDF( - url: string, - request: RequestInit, - errorMessage: string - ): Promise { - return fetch(url, request) - .catch((error) => { - throw new ApiError( - Levels.ERROR, - `Die Verbindung zum Service konnte nicht aufgebaut werden.`, - error - ); - }) - .then((response) => { - if (!response.ok) { - throw new ApiError( - Levels.ERROR, - errorMessage, - `Fehler: ${response.status} ${response.statusText}` - ); - } return response; }); } diff --git a/frontend/src/api/service/GeneratePdfService.ts b/frontend/src/api/service/GeneratePdfService.ts index 6c0ba332..2ee6cc5b 100644 --- a/frontend/src/api/service/GeneratePdfService.ts +++ b/frontend/src/api/service/GeneratePdfService.ts @@ -8,7 +8,7 @@ export default class GeneratePdfService { charttype: string, zaehlungId: string, data: FormData - ): Promise { + ): Promise { return this.postPdfCustomFetchTemplate( "zaehlung", charttype, @@ -21,7 +21,7 @@ export default class GeneratePdfService { charttype: string, messstelleId: string, data: FormData - ): Promise { + ): Promise { return this.postPdfCustomFetchTemplate( "messstelle", charttype, @@ -35,7 +35,7 @@ export default class GeneratePdfService { charttype: string, fachId: string, data: FormData - ): Promise { + ): Promise { return FetchService.postForPdf( data, `${this.ENDPOINT}/${type}?charttype=${charttype}&fach_id=${fachId}`, @@ -43,7 +43,7 @@ export default class GeneratePdfService { ); } - static postPdfCustomFetchReport(data: FormData): Promise { + static postPdfCustomFetchReport(data: FormData): Promise { return FetchService.postForPdf( data, `${this.ENDPOINT}/report`, diff --git a/frontend/src/api/service/MessstelleAuswertungService.ts b/frontend/src/api/service/MessstelleAuswertungService.ts index f8002b0c..6cf74db6 100644 --- a/frontend/src/api/service/MessstelleAuswertungService.ts +++ b/frontend/src/api/service/MessstelleAuswertungService.ts @@ -12,8 +12,8 @@ export default class MessstelleAuswertungService { "Beim Laden der Messstellen ist ein Fehler aufgetreten." ); } - static generate(options: MessstelleAuswertungOptionsDTO): Promise { - return FetchService.postData( + static generate(options: MessstelleAuswertungOptionsDTO): Promise { + return FetchService.postForBlob( options, `${this.ENDPOINT}`, "Beim Laden der Auswertung ist ein Fehler aufgetreten." diff --git a/frontend/src/components/common/DateRangePicker.vue b/frontend/src/components/common/DateRangePicker.vue index 838a9bd0..4b52a8c7 100644 --- a/frontend/src/components/common/DateRangePicker.vue +++ b/frontend/src/components/common/DateRangePicker.vue @@ -1,8 +1,8 @@