diff --git a/frontend/src/components/CalendarLink.vue b/frontend/src/components/CalendarLink.vue index f14adbe..9cd9e31 100644 --- a/frontend/src/components/CalendarLink.vue +++ b/frontend/src/components/CalendarLink.vue @@ -76,6 +76,14 @@ const forwardToMicrosoft = () => { ); }; +const forwardToHTWKalendar = () => { + // route to path /calendar/view?token=token + router.push({ + name: "calendar-view", + query: { token: tokenStore().token }, + }); +}; + const actions = computed(() => [ { label: t("calendarLink.copyToClipboard"), @@ -92,6 +100,11 @@ const actions = computed(() => [ icon: "pi pi-microsoft", command: forwardToMicrosoft, }, + { + label: t("calendarLink.toHTWKalendar"), + icon: "pi pi-home", + command: forwardToHTWKalendar, + } ]); diff --git a/frontend/src/i18n/translations/de.json b/frontend/src/i18n/translations/de.json index f6b199c..3ef62ac 100644 --- a/frontend/src/i18n/translations/de.json +++ b/frontend/src/i18n/translations/de.json @@ -139,7 +139,8 @@ "copyToastErrorDetail": "Link konnte nicht in Zwischenablage kopiert werden", "copyToClipboard": "Link kopieren", "toGoogleCalendar": "Google Kalender", - "toMicrosoftCalendar": "Microsoft Kalender" + "toMicrosoftCalendar": "Microsoft Kalender", + "toHTWKalendar": "HTWKalender" }, "calendarPreview": { "preview": "Vorschau", diff --git a/frontend/src/i18n/translations/en.json b/frontend/src/i18n/translations/en.json index efc845a..0292fac 100644 --- a/frontend/src/i18n/translations/en.json +++ b/frontend/src/i18n/translations/en.json @@ -139,7 +139,8 @@ "copyToastErrorDetail": "could not copy link to clipboard", "copyToClipboard": "copy to clipboard", "toGoogleCalendar": "to Google Calendar", - "toMicrosoftCalendar": "to Microsoft Calendar" + "toMicrosoftCalendar": "to Microsoft Calendar", + "toHTWKalendar": "HTWKalender" }, "calendarPreview": { "preview": "preview", diff --git a/frontend/src/view/UserCalendar.vue b/frontend/src/view/UserCalendar.vue index 75d8d09..db13d3f 100644 --- a/frontend/src/view/UserCalendar.vue +++ b/frontend/src/view/UserCalendar.vue @@ -12,7 +12,16 @@ import tokenStore from "@/store/tokenStore.ts"; const { t } = useI18n({ useScope: "global" }); const toast = useToast(); -const token = ref(""); +const token = ref(tokenStore().token || "" as string ); + +// parse token from query parameter +const urlParams = new URLSearchParams(window.location.search); +const tokenFromUrl = urlParams.get("token"); +if (tokenFromUrl) { + token.value = tokenFromUrl; + tokenStore().setToken(tokenFromUrl); + loadCalendar(); +} function loadCalendar() { try {