feat:#58 added htwk app button

This commit is contained in:
Elmar Kresse
2024-10-15 11:34:36 +02:00
parent 538b6ca566
commit 3a03c6f519
3 changed files with 24 additions and 2 deletions

View File

@ -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",

View File

@ -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",

View File

@ -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,
},
]);
</script>