diff --git a/openapi.yaml b/openapi.yaml index d12cedece..1546a5ee7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2099,18 +2099,23 @@ components: format: int32 examples: - 42 - title: - description: The title of the Entry + stp_title_de: + description: The german title of the Entry type: string examples: - Quantenteleportation - start: + stp_title_en: + description: The english title of the Entry + type: string + examples: + - Quantenteleportation + start_at: description: The start of the entry type: string format: date-time examples: - '2018-01-01T00:00:00' - end: + end_at: description: The end of the entry type: string format: date-time @@ -2132,9 +2137,10 @@ components: - Vorlesung mit Zentralübung required: - id - - title - - start - - end + - stp_title_de + - stp_title_en + - start_at + - end_at - entry_type - detailed_entry_type DataSources: diff --git a/server/main-api/src/calendar/connectum.rs b/server/main-api/src/calendar/connectum.rs index 4a8b11d6f..f828d676d 100644 --- a/server/main-api/src/calendar/connectum.rs +++ b/server/main-api/src/calendar/connectum.rs @@ -69,7 +69,8 @@ impl APIRequestor { fn should_refresh_token(&self) -> bool { if let Some((start, token)) = &self.oauth_token { if let Some(expires_in) = token.expires_in() { - return expires_in - start.elapsed() < Duration::from_secs(60); + return (expires_in < start.elapsed()) + || (expires_in - start.elapsed() < Duration::from_secs(60)); } } true diff --git a/webclient/api_types/index.ts b/webclient/api_types/index.ts index 74a7ac4fa..4e891ab4a 100644 --- a/webclient/api_types/index.ts +++ b/webclient/api_types/index.ts @@ -531,18 +531,20 @@ export type components = { * @description The id of the calendar entry used in TUMonline internally */ readonly id: number; - /** @description The title of the Entry */ - readonly title: string; + /** @description The german title of the Entry */ + readonly stp_title_de: string; + /** @description The english title of the Entry */ + readonly stp_title_en: string; /** * Format: date-time * @description The start of the entry */ - readonly start: string; + readonly start_at: string; /** * Format: date-time * @description The end of the entry */ - readonly end: string; + readonly end_at: string; /** * @description What this calendar entry means. Each of these should be displayed in a different color * @enum {string} diff --git a/webclient/components/CalendarFull.vue b/webclient/components/CalendarFull.vue new file mode 100644 index 000000000..d5e7a87e0 --- /dev/null +++ b/webclient/components/CalendarFull.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue new file mode 100644 index 000000000..6356b0144 --- /dev/null +++ b/webclient/components/CalendarModal.vue @@ -0,0 +1,140 @@ + + + + + +de: + title: Kalendar + close: Schließen + error: + header: Beim Versuch, den Kalender anzuzeigen, ist ein Fehler aufgetreten + reason: Der Grund für diesen Fehler ist + call_to_action: Wenn dieses Problem weiterhin besteht, kontaktieren Sie uns bitte über das {feedbackForm}. + feedback-form: Feedback-Formular + feedback-open: Feedback-Formular öffnen + footer: + disclaimer: Stündlich aktualisiert und identische Termine zusammengefasst. + please_check: Im Zweifelsfall prüfe bitte den offiziellen TUMonline-Kalender. + last_sync: Stand {0} + call_for_feedback: Diese Funktion ist neu. Wenn du Feedback dazu hast, nutze doch bitte das {feedbackForm}. +en: + title: Calendar + close: Close + error: + header: Got an error trying to display calendar + reason: Reason for this error is + call_to_action: If this issue persists, please contact us via the {feedbackForm}. + feedback-form: feedback form + feedback-open: open the feedback form + footer: + disclaimer: Updated hourly and identical events are merged. + please_check: If in doubt, please check the official calendar on TUMonline + last_sync: Updated {0} + call_for_feedback: This feature is new. If you have some feedback about it, feel free to use the {feedbackForm}. + diff --git a/webclient/components/CalendarRoomSelector.vue b/webclient/components/CalendarRoomSelector.vue new file mode 100644 index 000000000..829817fb0 --- /dev/null +++ b/webclient/components/CalendarRoomSelector.vue @@ -0,0 +1,137 @@ + + + + + +de: + add_location: Zusätzliche Location zum Kalendar hinzufügen + view_in_tumonline: in TUMonline ansehen + prompt: + initial: |- + Welcher Kalender soll hinzugefügt werden? + Bitte wähle nur den letzten Teil der Url eines Raumes mit einem Kalender. + + Beispiel: + https://nav.tum.de/room/5502.01.250 hat die ID 5502.01.250 + error_not_ok: |- + Der Ort '{0}' existiert nicht. + Wenn er existieren würde, gäbe es https://nav.tum.de/view/{0}. + + Möchtest du es mit einer anderen ID erneut versuchen? + error_not_calendar: |- + Der Ort hat keinen Kalender. + Möchtest du es mit einer anderen ID erneut versuchen? + error_already_exists: |- + Der Ort ist bereits im Kalender eingetragen. + Möchtest du es mit einer anderen ID erneut versuchen? + Loading data...: Lädt daten... +en: + add_location: add additional location to the calendar + view_in_tumonline: View in TUMonline + prompt: + initial: |- + Which calendar should be added? + Please select just the last part of the url of a room with a calendar. + + Example: + https://nav.tum.de/room/5502.01.250 has the id 5502.01.250 + error_not_ok: |- + Location '{0}' does not exist. + If it were to exist https://nav.tum.de/view/{0} would exist. + Want to retry with a different id? + error_not_calendar: |- + Location does not have a calendar. + Want to retry with a different id? + error_already_exists: |- + Location is already in the calendar. + Want to retry with a different id? + Loading data...: Loading data... + diff --git a/webclient/components/DetailsFeedbackButton.vue b/webclient/components/DetailsFeedbackButton.vue index f4b803e93..13f8971df 100644 --- a/webclient/components/DetailsFeedbackButton.vue +++ b/webclient/components/DetailsFeedbackButton.vue @@ -1,5 +1,5 @@ diff --git a/webclient/components/Modal.vue b/webclient/components/Modal.vue index 1a9a55649..d5b3b00ed 100644 --- a/webclient/components/Modal.vue +++ b/webclient/components/Modal.vue @@ -4,19 +4,11 @@ import { XMarkIcon } from "@heroicons/vue/24/outline"; export interface Props { title: string; disableClose?: boolean; - classes?: { - background?: string; - close?: string; - modal?: string; - }; + class?: string; } const props = withDefaults(defineProps(), { - classes: () => ({ - background: "", - close: "", - modal: "", - }), + class: "", }); const emit = defineEmits(["close"]); const isOpen = defineModel({ required: true }); @@ -60,13 +52,9 @@ function close() {
-
+

{{ props.title }}