From 4f2caf615b8ecdcb0f2f63abd71093581a0a68bb Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Fri, 10 May 2024 11:44:46 +0200 Subject: [PATCH] fix(editor): don't respect default calendar in the calendar picker The default calendar URL from the backend is more restrictive as it is primarily meant for incoming invitations. This commit effectively reverts the editor's calendar picker default choice to how it behaved before v4.7.0. Signed-off-by: Richard Steinmetz --- src/components/AppNavigation/Settings.vue | 6 +++--- src/store/calendarObjects.js | 16 ++-------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/components/AppNavigation/Settings.vue b/src/components/AppNavigation/Settings.vue index 8bbb46c2a5..b13302cf22 100644 --- a/src/components/AppNavigation/Settings.vue +++ b/src/components/AppNavigation/Settings.vue @@ -76,7 +76,7 @@
  • !calendar.readOnly && !calendar.isSharedWithMe) }, /** - * The default calendar for new events and inivitations + * The default calendar for incoming inivitations * * @return {object|undefined} The default calendar or undefined if none is available */ @@ -443,7 +443,7 @@ export default { } }, /** - * Changes the default calendar for new events + * Changes the default calendar for incoming invitations * * @param {object} selectedCalendar The new selected default calendar */ diff --git a/src/store/calendarObjects.js b/src/store/calendarObjects.js index 206c722454..de40eb2aa1 100644 --- a/src/store/calendarObjects.js +++ b/src/store/calendarObjects.js @@ -352,20 +352,8 @@ const actions = { vObject.undirtify() } - // TODO: remove version check once Nextcloud 28 is not supported anymore - let defaultCalendar - const nextcloudVersion = parseInt(OC.config.version.split('.')[0]) - if (nextcloudVersion >= 29) { - // Don't select the default calendar by default on Nextcloud < 29 as it can't be - // configured by the user and might lead to confusion - const defaultCalendarUrl = context.getters.getCurrentUserPrincipal.scheduleDefaultCalendarUrl - defaultCalendar = context.getters.getCalendarByUrl(defaultCalendarUrl) - } - - return Promise.resolve(mapCalendarJsToCalendarObject( - calendar, - defaultCalendar?.id ?? context.getters.sortedCalendars[0].id, - )) + const firstCalendar = context.getters.sortedCalendars[0].id + return Promise.resolve(mapCalendarJsToCalendarObject(calendar, firstCalendar)) }, /**