mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-07 12:19:17 +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(() => [
|
const actions = computed(() => [
|
||||||
{
|
{
|
||||||
label: t("calendarLink.copyToClipboard"),
|
label: t("calendarLink.copyToClipboard"),
|
||||||
@@ -92,6 +100,11 @@ const actions = computed(() => [
|
|||||||
icon: "pi pi-microsoft",
|
icon: "pi pi-microsoft",
|
||||||
command: forwardToMicrosoft,
|
command: forwardToMicrosoft,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: t("calendarLink.toHTWKalendar"),
|
||||||
|
icon: "pi pi-home",
|
||||||
|
command: forwardToHTWKalendar,
|
||||||
|
}
|
||||||
]);
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -139,7 +139,8 @@
|
|||||||
"copyToastErrorDetail": "Link konnte nicht in Zwischenablage kopiert werden",
|
"copyToastErrorDetail": "Link konnte nicht in Zwischenablage kopiert werden",
|
||||||
"copyToClipboard": "Link kopieren",
|
"copyToClipboard": "Link kopieren",
|
||||||
"toGoogleCalendar": "Google Kalender",
|
"toGoogleCalendar": "Google Kalender",
|
||||||
"toMicrosoftCalendar": "Microsoft Kalender"
|
"toMicrosoftCalendar": "Microsoft Kalender",
|
||||||
|
"toHTWKalendar": "HTWKalender"
|
||||||
},
|
},
|
||||||
"calendarPreview": {
|
"calendarPreview": {
|
||||||
"preview": "Vorschau",
|
"preview": "Vorschau",
|
||||||
|
@@ -139,7 +139,8 @@
|
|||||||
"copyToastErrorDetail": "could not copy link to clipboard",
|
"copyToastErrorDetail": "could not copy link to clipboard",
|
||||||
"copyToClipboard": "copy to clipboard",
|
"copyToClipboard": "copy to clipboard",
|
||||||
"toGoogleCalendar": "to Google Calendar",
|
"toGoogleCalendar": "to Google Calendar",
|
||||||
"toMicrosoftCalendar": "to Microsoft Calendar"
|
"toMicrosoftCalendar": "to Microsoft Calendar",
|
||||||
|
"toHTWKalendar": "HTWKalender"
|
||||||
},
|
},
|
||||||
"calendarPreview": {
|
"calendarPreview": {
|
||||||
"preview": "preview",
|
"preview": "preview",
|
||||||
|
@@ -12,7 +12,16 @@ import tokenStore from "@/store/tokenStore.ts";
|
|||||||
const { t } = useI18n({ useScope: "global" });
|
const { t } = useI18n({ useScope: "global" });
|
||||||
const toast = useToast();
|
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() {
|
function loadCalendar() {
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user