mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 09:38:51 +02:00
feat:#4 added link-out button for local import
This commit is contained in:
@ -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,
|
||||
}
|
||||
]);
|
||||
</script>
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user