From e4c2f47eb0dbfa520638adaf3a25f3c6ee0bc65e Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Thu, 10 Apr 2025 12:48:38 +0200 Subject: [PATCH 01/45] 1.3.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 51951fb..0007915 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ff-admin", - "version": "1.3.5", + "version": "1.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ff-admin", - "version": "1.3.5", + "version": "1.3.6", "license": "AGPL-3.0-only", "dependencies": { "@fullcalendar/core": "^6.1.15", diff --git a/package.json b/package.json index 11d9293..fdd7e82 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ff-admin", - "version": "1.3.5", + "version": "1.3.6", "description": "Feuerwehr/Verein Mitgliederverwaltung UI", "type": "module", "scripts": { From 12963317963f6aa00d9339ee5516e5f42c3f4c79 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Mon, 14 Apr 2025 09:12:00 +0200 Subject: [PATCH 02/45] extend calendar by list --- package-lock.json | 10 ++ package.json | 1 + src/components/CustomCalendar.vue | 170 +++++++++++++++++++++ src/main.css | 28 +--- src/views/admin/club/calendar/Calendar.vue | 103 ++----------- src/views/public/calendar/Calendar.vue | 38 +---- 6 files changed, 198 insertions(+), 152 deletions(-) create mode 100644 src/components/CustomCalendar.vue diff --git a/package-lock.json b/package-lock.json index f1e26a7..a08af4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@fullcalendar/core": "^6.1.15", "@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", + "@fullcalendar/list": "^6.1.17", "@fullcalendar/timegrid": "^6.1.15", "@fullcalendar/vue3": "^6.1.15", "@headlessui/vue": "^1.7.23", @@ -2379,6 +2380,15 @@ "@fullcalendar/core": "~6.1.17" } }, + "node_modules/@fullcalendar/list": { + "version": "6.1.17", + "resolved": "https://registry.npmjs.org/@fullcalendar/list/-/list-6.1.17.tgz", + "integrity": "sha512-fkyK49F9IxwlGUBVhJGsFpd/LTi/vRVERLIAe1HmBaGkjwpxnynm8TMLb9mZip97wvDk3CmZWduMe6PxscAlow==", + "license": "MIT", + "peerDependencies": { + "@fullcalendar/core": "~6.1.17" + } + }, "node_modules/@fullcalendar/timegrid": { "version": "6.1.17", "resolved": "https://registry.npmjs.org/@fullcalendar/timegrid/-/timegrid-6.1.17.tgz", diff --git a/package.json b/package.json index 4ffd7d2..aa87b2c 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@fullcalendar/core": "^6.1.15", "@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", + "@fullcalendar/list": "^6.1.17", "@fullcalendar/timegrid": "^6.1.15", "@fullcalendar/vue3": "^6.1.15", "@headlessui/vue": "^1.7.23", diff --git a/src/components/CustomCalendar.vue b/src/components/CustomCalendar.vue new file mode 100644 index 0000000..e31d2d6 --- /dev/null +++ b/src/components/CustomCalendar.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/src/main.css b/src/main.css index 9816a0e..e618f2f 100644 --- a/src/main.css +++ b/src/main.css @@ -72,7 +72,7 @@ a[button] { button[primary]:not([primary="false"]), a[button][primary]:not([primary="false"]) { - @apply border border-transparent text-white bg-primary hover:bg-primary; + @apply border-2 border-transparent text-white bg-primary hover:bg-primary; } button[primary-outline]:not([primary-outline="false"]), @@ -131,29 +131,3 @@ summary > svg { summary::-webkit-details-marker { display: none; } - -.fc-button-primary { - @apply bg-primary! border-primary! outline-hidden! ring-0! hover:bg-red-700! hover:border-red-700! h-10 text-center; -} -.fc-button-active { - @apply bg-red-500! border-red-500!; -} -.fc-toolbar { - @apply flex-wrap; -} - -/* For screens between 850px and 768px */ -@media (max-width: 850px) and (min-width: 768px) { - .fc-header-toolbar.fc-toolbar.fc-toolbar-ltr > .fc-toolbar-chunk:nth-child(2) { - @apply order-1!; - } - /* Your styles for this range */ -} - -/* For screens between 525px and 0px */ -@media (max-width: 525px) and (min-width: 0px) { - /* Your styles for this range */ - .fc-header-toolbar.fc-toolbar.fc-toolbar-ltr > .fc-toolbar-chunk:nth-child(2) { - @apply order-1!; - } -} diff --git a/src/views/admin/club/calendar/Calendar.vue b/src/views/admin/club/calendar/Calendar.vue index d45bd41..4535be8 100644 --- a/src/views/admin/club/calendar/Calendar.vue +++ b/src/views/admin/club/calendar/Calendar.vue @@ -4,14 +4,17 @@

Kalender

- +
@@ -22,14 +25,10 @@ import { defineComponent, markRaw, defineAsyncComponent } from "vue"; import { mapActions, mapState } from "pinia"; import { useModalStore } from "@/stores/modal"; import MainTemplate from "@/templates/Main.vue"; -import FullCalendar from "@fullcalendar/vue3"; -import deLocale from "@fullcalendar/core/locales/de"; -import dayGridPlugin from "@fullcalendar/daygrid"; -import timeGridPlugin from "@fullcalendar/timegrid"; -import interactionPlugin from "@fullcalendar/interaction"; import { useCalendarStore } from "@/stores/admin/club/calendar"; import { useAbilityStore } from "@/stores/ability"; import { LinkIcon, PlusIcon } from "@heroicons/vue/24/outline"; +import CustomCalendar from "@/components/CustomCalendar.vue"; diff --git a/src/views/public/calendar/Calendar.vue b/src/views/public/calendar/Calendar.vue index 956a34d..f4de6da 100644 --- a/src/views/public/calendar/Calendar.vue +++ b/src/views/public/calendar/Calendar.vue @@ -12,7 +12,7 @@ @@ -23,14 +23,10 @@ import { defineComponent, markRaw, defineAsyncComponent } from "vue"; import { mapActions, mapState } from "pinia"; import { useModalStore } from "@/stores/modal"; import MainTemplate from "@/templates/Main.vue"; -import FullCalendar from "@fullcalendar/vue3"; -import deLocale from "@fullcalendar/core/locales/de"; -import dayGridPlugin from "@fullcalendar/daygrid"; -import timeGridPlugin from "@fullcalendar/timegrid"; -import interactionPlugin from "@fullcalendar/interaction"; import { InformationCircleIcon, LinkIcon } from "@heroicons/vue/24/outline"; import type { CalendarViewModel } from "@/viewmodels/admin/club/calendar.models"; import { RouterLink } from "vue-router"; +import CustomCalendar from "@/components/CustomCalendar.vue"; diff --git a/src/components/queryBuilder/OrderStructure.vue b/src/components/queryBuilder/OrderStructure.vue index cd15f86..9b57fd4 100644 --- a/src/components/queryBuilder/OrderStructure.vue +++ b/src/components/queryBuilder/OrderStructure.vue @@ -1,5 +1,9 @@ diff --git a/src/components/admin/management/setting/SessionSetting.vue b/src/components/admin/management/setting/SessionSetting.vue index 4f487ab..e93aee8 100644 --- a/src/components/admin/management/setting/SessionSetting.vue +++ b/src/components/admin/management/setting/SessionSetting.vue @@ -4,15 +4,35 @@

Login-Session Einstellungen

- +
+ + +
+
+ + +
+
+ + +
diff --git a/src/stores/admin/management/setting.ts b/src/stores/admin/management/setting.ts index c57cf69..174141a 100644 --- a/src/stores/admin/management/setting.ts +++ b/src/stores/admin/management/setting.ts @@ -1,6 +1,6 @@ import { defineStore } from "pinia"; import { http } from "@/serverCom"; -import { type SettingString, type SettingValueMapping } from "@/types/settingTypes"; +import type { SettingString, SettingTopic, SettingValueMapping } from "@/types/settingTypes"; import type { AxiosResponse } from "axios"; export const useSettingStore = defineStore("setting", { @@ -16,6 +16,19 @@ export const useSettingStore = defineStore("setting", { (key: K): SettingValueMapping[K] => { return state.settings[key]; }, + readByTopic: + (state) => + ( + topic: T + ): { [K in SettingString as K extends `${T}.${string}` ? K : never]: SettingValueMapping[K] } => { + return Object.entries(state.settings).reduce((acc, [key, value]) => { + const typedKey = key as SettingString; + if (key.startsWith(topic)) { + acc[typedKey] = value; + } + return acc; + }, {} as any); + }, }, actions: { fetchSettings() { From 06380e48c5e05082c514c9c7efc8daa97d719371 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Tue, 29 Apr 2025 13:10:30 +0200 Subject: [PATCH 25/45] Settings form and handling --- .../admin/management/setting/AppSetting.vue | 65 +++++++--- .../management/setting/BackupSetting.vue | 49 +++++--- .../admin/management/setting/BaseSetting.vue | 79 ++++++++++++ .../management/setting/ClubImageSetting.vue | 90 +++++++++++++ .../admin/management/setting/ClubSetting.vue | 107 ++++++++++------ .../admin/management/setting/MailSetting.vue | 119 ++++++++++++------ .../management/setting/SessionSetting.vue | 74 ++++++++--- src/stores/admin/management/setting.ts | 28 ++++- src/stores/configuration.ts | 6 +- .../admin/management/setting/Setting.vue | 3 + 10 files changed, 485 insertions(+), 135 deletions(-) create mode 100644 src/components/admin/management/setting/BaseSetting.vue create mode 100644 src/components/admin/management/setting/ClubImageSetting.vue diff --git a/src/components/admin/management/setting/AppSetting.vue b/src/components/admin/management/setting/AppSetting.vue index 234a4ab..787dbe1 100644 --- a/src/components/admin/management/setting/AppSetting.vue +++ b/src/components/admin/management/setting/AppSetting.vue @@ -1,42 +1,67 @@ diff --git a/src/components/admin/management/setting/BackupSetting.vue b/src/components/admin/management/setting/BackupSetting.vue index f18298a..f71a36a 100644 --- a/src/components/admin/management/setting/BackupSetting.vue +++ b/src/components/admin/management/setting/BackupSetting.vue @@ -1,34 +1,53 @@ diff --git a/src/components/admin/management/setting/BaseSetting.vue b/src/components/admin/management/setting/BaseSetting.vue new file mode 100644 index 0000000..96c1308 --- /dev/null +++ b/src/components/admin/management/setting/BaseSetting.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/src/components/admin/management/setting/ClubImageSetting.vue b/src/components/admin/management/setting/ClubImageSetting.vue new file mode 100644 index 0000000..e2ab129 --- /dev/null +++ b/src/components/admin/management/setting/ClubImageSetting.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/components/admin/management/setting/ClubSetting.vue b/src/components/admin/management/setting/ClubSetting.vue index 51dfb40..8b6cbcc 100644 --- a/src/components/admin/management/setting/ClubSetting.vue +++ b/src/components/admin/management/setting/ClubSetting.vue @@ -1,58 +1,89 @@ diff --git a/src/components/admin/management/setting/MailSetting.vue b/src/components/admin/management/setting/MailSetting.vue index b945b2a..64ca03d 100644 --- a/src/components/admin/management/setting/MailSetting.vue +++ b/src/components/admin/management/setting/MailSetting.vue @@ -1,57 +1,100 @@ diff --git a/src/components/admin/management/setting/SessionSetting.vue b/src/components/admin/management/setting/SessionSetting.vue index e93aee8..712ea75 100644 --- a/src/components/admin/management/setting/SessionSetting.vue +++ b/src/components/admin/management/setting/SessionSetting.vue @@ -1,38 +1,76 @@ diff --git a/src/stores/admin/management/setting.ts b/src/stores/admin/management/setting.ts index 174141a..defb78b 100644 --- a/src/stores/admin/management/setting.ts +++ b/src/stores/admin/management/setting.ts @@ -50,14 +50,32 @@ export const useSettingStore = defineStore("setting", { return res; }); }, + async uploadImage(data: { key: SettingString; value?: File }[]): Promise> { + const formData = new FormData(); + for (let entry of data) { + if (entry.value) formData.append(entry.key, entry.value); + } + return await http.put("/admin/setting/img", formData, { + headers: { + "Content-Type": "multipart/form-data", + }, + }); + }, + async updateSettings( + data: { key: K; value: SettingValueMapping[K] }[] + ): Promise> { + return await http.put("/admin/setting", data); + }, async updateSetting( key: K, - val: SettingValueMapping[K] + value: SettingValueMapping[K] ): Promise> { - return await http.put("/admin/setting", { - setting: key, - value: val, - }); + return await http.put("/admin/setting", [ + { + setting: key, + value: value, + }, + ]); }, async resetSetting(key: SettingString): Promise> { return await http.delete(`/admin/setting/${key}`); diff --git a/src/stores/configuration.ts b/src/stores/configuration.ts index c33803a..1e8bfd8 100644 --- a/src/stores/configuration.ts +++ b/src/stores/configuration.ts @@ -10,6 +10,8 @@ export const useConfigurationStore = defineStore("configuration", { clubWebsite: "", appCustom_login_message: "", appShow_link_to_calendar: false as boolean, + + serverOffline: false as boolean, }; }, actions: { @@ -24,7 +26,9 @@ export const useConfigurationStore = defineStore("configuration", { this.appCustom_login_message = res.data["app.custom_login_message"]; this.appShow_link_to_calendar = res.data["app.show_link_to_calendar"]; }) - .catch(() => {}); + .catch(() => { + this.serverOffline = true; + }); }, }, }); diff --git a/src/views/admin/management/setting/Setting.vue b/src/views/admin/management/setting/Setting.vue index 2220105..25e602a 100644 --- a/src/views/admin/management/setting/Setting.vue +++ b/src/views/admin/management/setting/Setting.vue @@ -6,6 +6,8 @@