diff --git a/src/components/cards/AddCardBulkModal.svelte b/src/components/cards/AddCardBulkModal.svelte index bc4bdf0f..e43f79d9 100644 --- a/src/components/cards/AddCardBulkModal.svelte +++ b/src/components/cards/AddCardBulkModal.svelte @@ -2,9 +2,7 @@ import { _ } from "svelte-i18n"; import { clickOutside } from "../base/outsideclick"; import { focusTrap } from "svelte-focus-trap"; - import { - RunnerCardService - } from "@odit/lfk-client-js"; + import { RunnerCardService } from "@odit/lfk-client-js"; import Toastify from "toastify-js"; export let bulk_modal_open; export let current_cards; @@ -12,7 +10,7 @@ el.focus(); } $: card_count = 0; - $: is_card_count_valid= card_count>0; + $: is_card_count_valid = card_count > 0; $: processed_last_submit = true; $: createbtnenabled = is_card_count_valid; (() => { @@ -29,30 +27,22 @@ } }; })(); - //TODO: Creation logic function submit() { if (processed_last_submit === true) { processed_last_submit = false; const toast = Toastify({ - text: $_("adding-card"), + text: $_("creating-blanco-cards"), duration: -1, }).showToast(); - let postdata = { - runner, - enabled, - }; - RunnerCardService.runnerCardControllerPost(postdata) + RunnerCardService.runnerCardControllerPostBlancoBulk(card_count) .then((result) => { - runner = 0; bulk_modal_open = false; // Toastify({ - text: $_("card-added"), + text: $_("created-blanco-cards"), duration: 500, backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", }).showToast(); - current_cards.push(result); - current_cards = current_cards; }) .catch((err) => { // @@ -118,27 +108,27 @@ -
- - {$_('cards')} -
- {#if !is_card_count_valid} - - {$_('you-must-create-at-least-one-card-or-cancel')} - - {/if} +
+ + {$_('cards')} +
+ {#if !is_card_count_valid} + + {$_('you-must-create-at-least-one-card-or-cancel')} + + {/if} diff --git a/src/locales/de.json b/src/locales/de.json index ff1ebe21..d97367fd 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -396,5 +396,7 @@ "just-enter-how-many-you-want-and-the-system-will-create-them": "Geb einfach ein, wie viele Blankokarten das System erstellen soll.", "amount": "Anzahl", "you-must-create-at-least-one-card-or-cancel": "Du musst mindestens eine Blankokarte erstellen (oder abbrechen).", - "create-bulk-cards": "Blankokarten erstellen" + "create-bulk-cards": "Blankokarten erstellen", + "creating-blanco-cards": "Erstelle Blankokarten", + "created-blanco-cards": "Blankokarten wurden erstellt" } diff --git a/src/locales/en.json b/src/locales/en.json index 82c6e3b7..36fb807f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -396,5 +396,7 @@ "just-enter-how-many-you-want-and-the-system-will-create-them": "Just enter how many you want and the system will create them", "amount": "Amount", "you-must-create-at-least-one-card-or-cancel": "You must create at least one card (or cancel).", - "create-bulk-cards": "Add blanco cards" + "create-bulk-cards": "Add blanco cards", + "creating-blanco-cards": "Creating blanco cards", + "created-blanco-cards": "Created blanco cards" }