enhance: prevent accidental newsletter job start

This commit is contained in:
Julian Krauser 2025-04-10 08:29:25 +02:00
parent fdbf9e7f0a
commit 7aa0db3684
4 changed files with 20 additions and 8 deletions

View file

@ -19,7 +19,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">abbrechen</button>
<button primary-outline @click="closeModal">schließen</button>
</div>
</div>
</div>

View file

@ -19,7 +19,7 @@
<div class="flex flex-row justify-end">
<div class="flex flex-row gap-4 py-2">
<button primary-outline @click="closeModal">abbrechen</button>
<button primary-outline @click="closeModal">schließen</button>
</div>
</div>
</div>

View file

@ -124,7 +124,7 @@ export const useNewsletterPrintoutStore = defineStore("newsletterPrintout", {
chunk.split("//").forEach((r) => {
if (r.trim() != "") {
let data = JSON.parse(r);
this.pdfSourceMessages.push(data);
this.pdfSourceMessages.unshift(data);
let type: NotificationType = "info";
let timeout = undefined;
if (data.factor == "failed") {
@ -146,7 +146,7 @@ export const useNewsletterPrintoutStore = defineStore("newsletterPrintout", {
chunk.split("//").forEach((r) => {
if (r.trim() != "") {
let data = JSON.parse(r);
this.mailSourceMessages.push(data);
this.mailSourceMessages.unshift(data);
let type: NotificationType = "info";
let timeout = undefined;
if (data.factor == "failed") {

View file

@ -27,7 +27,7 @@
primary
class="!w-fit whitespace-nowrap flex flex-row gap-2"
:disabled="printing != undefined"
@click="createNewsletterPrintout"
@click="openPdfCommit"
>
Newsletter drucken
<Spinner v-if="printing == 'loading'" class="my-auto" />
@ -39,7 +39,7 @@
primary
class="!w-fit whitespace-nowrap flex flex-row gap-2"
:disabled="sending != undefined"
@click="createNewsletterSend"
@click="openMailCommit"
>
Mails versenden
<Spinner v-if="sending == 'loading'" class="my-auto" />
@ -108,10 +108,8 @@ export default defineComponent({
...mapActions(useModalStore, ["openModal"]),
...mapActions(useNewsletterPrintoutStore, [
"fetchNewsletterPrintout",
"createNewsletterPrintout",
"fetchNewsletterPrintoutById",
"createNewsletterMailPreview",
"createNewsletterSend",
]),
openPdfShow(filename?: string) {
this.openModal(
@ -132,6 +130,20 @@ export default defineComponent({
})
.catch(() => {});
},
openPdfCommit() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/club/newsletter/NewsletterPrintingRecipientsModal.vue"))
)
);
},
openMailCommit() {
this.openModal(
markRaw(
defineAsyncComponent(() => import("@/components/admin/club/newsletter/NewsletterMailRecipientsModal.vue"))
)
);
},
openPdfLogs() {
this.openModal(
markRaw(