diff --git a/src/components/AppointmentConfigModal.vue b/src/components/AppointmentConfigModal.vue index c57eb73df..817027f7f 100644 --- a/src/components/AppointmentConfigModal.vue +++ b/src/components/AppointmentConfigModal.vue @@ -195,7 +195,10 @@ export default { ...mapState(useSettingsStore, { isTalkEnabled: 'talkEnabled', }), - ...mapState(useCalendarsStore, ['ownSortedCalendars']), + ...mapState(useCalendarsStore, [ + 'ownSortedCalendars', + 'allSortedCalendars', + ]), ...mapStores(useAppointmentConfigsStore, useCalendarsStore, useSettingsStore), formTitle() { if (this.isNew) { @@ -222,12 +225,12 @@ export default { }, selectableConflictCalendars() { // The target calendar is always a conflict calendar, remove it from additional conflict calendars - return this.ownSortedCalendars.filter(calendar => calendar.url !== this.calendar.url) + return this.allSortedCalendars.filter(calendar => calendar.url !== this.calendar.url) }, conflictCalendars() { const freebusyUris = this.editing.calendarFreeBusyUris ?? [] return freebusyUris.map(uri => { - return this.ownSortedCalendars.find(cal => this.calendarUrlToUri(cal.url) === uri) + return this.allSortedCalendars.find(cal => this.calendarUrlToUri(cal.url) === uri) }) }, defaultConfig() { diff --git a/src/store/calendars.js b/src/store/calendars.js index b8b860081..8f02b9dc4 100644 --- a/src/store/calendars.js +++ b/src/store/calendars.js @@ -64,7 +64,7 @@ export default defineStore('calendars', { }, /** - * List of sorted calendars + * List of sorted writable calendars * * @param {object} state the store data * @return {Array} @@ -77,7 +77,7 @@ export default defineStore('calendars', { }, /** - * List of sorted calendars owned by the principal + * List of sorted writable calendars owned by the principal * * @param {object} state the store data * @return {Array} @@ -90,6 +90,18 @@ export default defineStore('calendars', { .sort((a, b) => a.order - b.order) }, + /** + * List all sorted calendars, including readonly + * + * @param {object} state the store data + * @return {Array} + */ + allSortedCalendars(state) { + return state.calendars + .filter(calendar => calendar.supportsEvents) + .sort((a, b) => a.order - b.order) + }, + hasTrashBin(state) { return state.trashBin !== undefined && state.trashBin.retentionDuration !== 0 },