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/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, }) }, } 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..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 @@ -35,6 +36,7 @@ export type CalendarEvent = { status: string summary: string type: string + busy: boolean } const { option } = defineProps<{ option: Option }>() @@ -78,6 +80,7 @@ const currentEvent = computed( status: 'self', summary: pollStore.configuration.title, type: detectAllDay.value.type, + busy: false, }), ) @@ -95,12 +98,19 @@ onMounted(async () => {