Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow any calendar the user has access to, to be selected for the 'conflict calendar' #5934

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/components/AppointmentConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@
...mapState(useSettingsStore, {
isTalkEnabled: 'talkEnabled',
}),
...mapState(useCalendarsStore, ['ownSortedCalendars']),
...mapState(useCalendarsStore, [
'ownSortedCalendars',
'allSortedCalendars',

Check warning on line 200 in src/components/AppointmentConfigModal.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppointmentConfigModal.vue#L198-L200

Added lines #L198 - L200 were not covered by tests
]),
...mapStores(useAppointmentConfigsStore, useCalendarsStore, useSettingsStore),
formTitle() {
if (this.isNew) {
Expand All @@ -222,12 +225,12 @@
},
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() {
Expand Down
16 changes: 14 additions & 2 deletions src/store/calendars.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},

/**
* List of sorted calendars
* List of sorted writable calendars
*
* @param {object} state the store data
* @return {Array}
Expand All @@ -77,7 +77,7 @@
},

/**
* 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}
Expand All @@ -90,6 +90,18 @@
.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)

Check warning on line 102 in src/store/calendars.js

View check run for this annotation

Codecov / codecov/patch

src/store/calendars.js#L99-L102

Added lines #L99 - L102 were not covered by tests
},

hasTrashBin(state) {
return state.trashBin !== undefined && state.trashBin.retentionDuration !== 0
},
Expand Down
Loading