From b399ae9d3e9b3863be2705d4a833fe3e470e90c1 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Thu, 24 Jul 2025 20:26:58 +0200 Subject: [PATCH 1/3] do not use cancelToken for getEvents Signed-off-by: dartcafe --- src/Api/modules/calendar.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Api/modules/calendar.ts b/src/Api/modules/calendar.ts index 1fdd239dc8..62b841fa87 100644 --- a/src/Api/modules/calendar.ts +++ b/src/Api/modules/calendar.ts @@ -29,10 +29,6 @@ const calendar = { tz: Intl.DateTimeFormat().resolvedOptions().timeZone, time: +new Date(), }, - cancelToken: - cancelTokenHandlerObject[ - this.getEvents.name - ].handleRequestCancellation().token, }) }, } From 9407f0abafb02a7bf9407605e5c37cf61ea9b20b Mon Sep 17 00:00:00 2001 From: dartcafe Date: Thu, 24 Jul 2025 20:54:32 +0200 Subject: [PATCH 2/3] use availability #3589 Signed-off-by: dartcafe --- lib/Model/CalendarEvent.php | 9 +++++++++ src/components/Calendar/CalendarInfo.vue | 5 +++++ src/components/Calendar/CalendarPeek.vue | 2 ++ 3 files changed, 16 insertions(+) diff --git a/lib/Model/CalendarEvent.php b/lib/Model/CalendarEvent.php index 0f24a5fbf4..5888ef7559 100644 --- a/lib/Model/CalendarEvent.php +++ b/lib/Model/CalendarEvent.php @@ -77,6 +77,14 @@ public function getUID(): string { return $this->event['UID'][0]; } + public function getBusy(): bool { + $transp = $this->event['TRANSP'][0] ?? ''; + if ($transp === 'TRANSPARENT') { + return false; + } + return true; + } + public function getSummary(): string { return $this->event['SUMMARY'][0]; } @@ -236,6 +244,7 @@ public function jsonSerialize(): array { 'status' => $this->getStatus(), 'summary' => $this->getSummary(), 'type' => $this->getType(), + 'busy' => $this->getBusy(), ]; } } diff --git a/src/components/Calendar/CalendarInfo.vue b/src/components/Calendar/CalendarInfo.vue index f0cd1187d8..8069103d20 100644 --- a/src/components/Calendar/CalendarInfo.vue +++ b/src/components/Calendar/CalendarInfo.vue @@ -75,6 +75,11 @@ const conflictLevel = computed(() => { return 'conflict-no' } + // No conflict, if calendarEvent is available (not busy) + if (!calendarEvent.busy) { + return 'conflict-no' + } + // No conflict, if calendarEvent ends before option if (calendarEvent.end <= option.timestamp) { return 'conflict-no' diff --git a/src/components/Calendar/CalendarPeek.vue b/src/components/Calendar/CalendarPeek.vue index ad295ed79a..2778e89902 100644 --- a/src/components/Calendar/CalendarPeek.vue +++ b/src/components/Calendar/CalendarPeek.vue @@ -35,6 +35,7 @@ export type CalendarEvent = { status: string summary: string type: string + busy: boolean } const { option } = defineProps<{ option: Option }>() @@ -78,6 +79,7 @@ const currentEvent = computed( status: 'self', summary: pollStore.configuration.title, type: detectAllDay.value.type, + busy: false, }), ) From cea25175b6566a2fbcf23e99b67f0d7bd31bf6b2 Mon Sep 17 00:00:00 2001 From: dartcafe Date: Thu, 24 Jul 2025 21:54:57 +0200 Subject: [PATCH 3/3] use caledar icon instead of warning symbol Signed-off-by: dartcafe --- src/components/Calendar/CalendarPeek.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/Calendar/CalendarPeek.vue b/src/components/Calendar/CalendarPeek.vue index 2778e89902..3291c80539 100644 --- a/src/components/Calendar/CalendarPeek.vue +++ b/src/components/Calendar/CalendarPeek.vue @@ -18,7 +18,8 @@ import { CalendarAPI } from '../../Api/index.ts' import { Logger } from '../../helpers/index.ts' import { Option } from '../../Types/index.ts' import { AxiosError } from '@nextcloud/axios' -import AlertIcon from 'vue-material-design-icons/Alert.vue' +import CalendarIcon from 'vue-material-design-icons/Calendar.vue' +import { NcButton } from '@nextcloud/vue' export type CalendarEvent = { id: number @@ -97,12 +98,19 @@ onMounted(async () => {