diff --git a/src/main.css b/src/main.css index 4cd20c5..d5c8f00 100644 --- a/src/main.css +++ b/src/main.css @@ -98,12 +98,12 @@ select[disabled] { details { user-select: none; - & summary svg { + & summary svg[indicator] { transform: rotate(90deg); } } details[open] { - & summary svg { + & summary svg[indicator] { transform: rotate(-90deg); } } diff --git a/src/stores/admin/newsletterDates.ts b/src/stores/admin/newsletterDates.ts index 9e1e23f..8666d18 100644 --- a/src/stores/admin/newsletterDates.ts +++ b/src/stores/admin/newsletterDates.ts @@ -17,7 +17,16 @@ export const useNewsletterDatesStore = defineStore("newsletterDates", { }, getters: { detectedChangeNewsletterDates: (state) => - !isEqual(state.origin, state.dates) && state.syncingNewsletterDates != "syncing", + !isEqual( + state.origin.sort( + (a: NewsletterDatesViewModel, b: NewsletterDatesViewModel) => + new Date(a.calendar.starttime).getTime() - new Date(b.calendar.starttime).getTime() + ), + state.dates.sort( + (a: NewsletterDatesViewModel, b: NewsletterDatesViewModel) => + new Date(a.calendar.starttime).getTime() - new Date(b.calendar.starttime).getTime() + ) + ) && state.syncingNewsletterDates != "syncing", }, actions: { setNewsletterDatesSyncingState(state: "synced" | "syncing" | "detectedChanges" | "failed") { @@ -45,7 +54,7 @@ export const useNewsletterDatesStore = defineStore("newsletterDates", { await http .patch(`/admin/newsletter/${newsletterId}/synchronize/dates`, { - dates: differenceWith(this.dates, this.origin, isEqual), + dates: this.dates, }) .then((res) => { this.syncingNewsletterDates = "synced"; diff --git a/src/viewmodels/admin/newsletterDates.models.ts b/src/viewmodels/admin/newsletterDates.models.ts index b913b8a..5afe116 100644 --- a/src/viewmodels/admin/newsletterDates.models.ts +++ b/src/viewmodels/admin/newsletterDates.models.ts @@ -2,14 +2,14 @@ import type { CalendarViewModel } from "./calendar.models"; export interface NewsletterDatesViewModel { newsletterId: number; - calendarId: number; + calendarId: string; diffTitle: string | null; diffDescription: string | null; calendar: CalendarViewModel; } export interface SyncNewsletterDatesViewModel { - calendarId: number; + calendarId: string; diffTitle?: string; diffDescription?: string; } diff --git a/src/views/admin/club/newsletter/NewsletterDates.vue b/src/views/admin/club/newsletter/NewsletterDates.vue index 9879f42..0434655 100644 --- a/src/views/admin/club/newsletter/NewsletterDates.vue +++ b/src/views/admin/club/newsletter/NewsletterDates.vue @@ -12,41 +12,89 @@ > -

{{ item.calendar.title }} {{ item.calendar.starttime }}

+

+ {{ item.calendar.title }}: + {{ + item.calendar.allDay + ? new Date(item.calendar.starttime ?? "").toLocaleDateString("de-DE", { + day: "2-digit", + month: "long", + year: "numeric", + }) + : new Date(item.calendar.starttime ?? "").toLocaleDateString("de-DE", { + day: "2-digit", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + }) + }} +

+
- - +
+ +
+ +
+
- +
+ + +
@@ -54,12 +102,16 @@ import { defineComponent } from "vue"; import { mapActions, mapState, mapWritableState } from "pinia"; import Spinner from "@/components/Spinner.vue"; -import { useNewsletterStore } from "@/stores/admin/newsletter"; import { QuillEditor } from "@vueup/vue-quill"; import "@vueup/vue-quill/dist/vue-quill.snow.css"; import { toolbarOptions } from "@/helpers/quillConfig"; import { useNewsletterDatesStore } from "@/stores/admin/newsletterDates"; import { useAbilityStore } from "@/stores/ability"; +import { useCalendarStore } from "@/stores/admin/calendar"; +import type { CalendarViewModel } from "@/viewmodels/admin/calendar.models"; +import { TrashIcon } from "@heroicons/vue/24/outline"; +import cloneDeep from "lodash.clonedeep"; +import type { NewsletterDatesViewModel } from "@/viewmodels/admin/newsletterDates.models"; diff --git a/src/views/admin/club/newsletter/NewsletterRecipients.vue b/src/views/admin/club/newsletter/NewsletterRecipients.vue index b282456..825eec4 100644 --- a/src/views/admin/club/newsletter/NewsletterRecipients.vue +++ b/src/views/admin/club/newsletter/NewsletterRecipients.vue @@ -72,11 +72,11 @@ :key="member.id" class="flex flex-row h-fit w-full border border-primary rounded-md bg-primary p-2 text-white justify-between items-center" > -
-

{{ member.lastname }}, {{ member.firstname }} {{ member.nameaffix ? `- ${member.nameaffix}` : "" }}

-

Newsletter senden an Typ: {{ member.sendNewsletter?.type.type }}

-
- +
+

{{ member.lastname }}, {{ member.firstname }} {{ member.nameaffix ? `- ${member.nameaffix}` : "" }}

+

Newsletter senden an Typ: {{ member.sendNewsletter?.type.type }}

+
+