From 3a03c6f5198d3e253145cf924364d4ea27d8d495 Mon Sep 17 00:00:00 2001 From: Elmar Kresse Date: Tue, 15 Oct 2024 11:34:36 +0200 Subject: [PATCH] feat:#58 added htwk app button --- frontend/src/i18n/translations/de.json | 5 ++++- frontend/src/i18n/translations/en.json | 5 ++++- frontend/src/view/CalendarLink.vue | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/frontend/src/i18n/translations/de.json b/frontend/src/i18n/translations/de.json index 7c3c395..68c5bfe 100644 --- a/frontend/src/i18n/translations/de.json +++ b/frontend/src/i18n/translations/de.json @@ -142,7 +142,10 @@ "copyToastErrorDetail": "Link konnte nicht in Zwischenablage kopiert werden", "copyToClipboard": "Link kopieren", "toGoogleCalendar": "Google Kalender", - "toMicrosoftCalendar": "Microsoft Kalender" + "toMicrosoftCalendar": "Microsoft Kalender", + "copyTokenToastSummary": "Information", + "copyTokenToastNotification": "Token in die Zwischenablage kopiert, um den Kalender in der HTWK App zu abonnieren", + "toHTWKApp": "HTWK App" }, "calendarPreview": { "preview": "Vorschau", diff --git a/frontend/src/i18n/translations/en.json b/frontend/src/i18n/translations/en.json index cd19f3c..bc3c9e6 100644 --- a/frontend/src/i18n/translations/en.json +++ b/frontend/src/i18n/translations/en.json @@ -142,7 +142,10 @@ "copyToastErrorDetail": "could not copy link to clipboard", "copyToClipboard": "copy to clipboard", "toGoogleCalendar": "to Google Calendar", - "toMicrosoftCalendar": "to Microsoft Calendar" + "toMicrosoftCalendar": "to Microsoft Calendar", + "copyTokenToastSummary": "information", + "copyTokenToastNotification": "token copied to clipboard, go to the HTWK app to insert it", + "toHTWKApp": "HTWK App" }, "calendarPreview": { "preview": "preview", diff --git a/frontend/src/view/CalendarLink.vue b/frontend/src/view/CalendarLink.vue index 23a7301..41f6dc5 100644 --- a/frontend/src/view/CalendarLink.vue +++ b/frontend/src/view/CalendarLink.vue @@ -78,6 +78,17 @@ const forwardToMicrosoft = () => { ); }; +const copyTokenToClipboard = () => { + navigator.clipboard.writeText(tokenStore().token).then(() => { + toast.add({ + severity: "info", + summary: t("calendarLink.copyTokenToastSummary"), + detail: t("calendarLink.copyTokenToastNotification"), + life: 3000, + }); + }); +}; + const actions = computed(() => [ { label: t("calendarLink.copyToClipboard"), @@ -94,6 +105,11 @@ const actions = computed(() => [ icon: "pi pi-microsoft", command: forwardToMicrosoft, }, + { + label: t("calendarLink.toHTWKApp"), + icon: "pi pi-mobile", + command: copyTokenToClipboard, + }, ]);