Skip to content

Commit

Permalink
feat: Allow shared calendars as appointment conflict calendars
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Oct 8, 2024
1 parent b6b9919 commit 562e828
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/AppointmentConfigModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<label>{{ t('calendar', 'Calendar') }}</label>
<CalendarPicker v-if="calendar !== undefined"
:value="calendar"
:calendars="ownSortedCalendars"
:calendars="sortedCalendars"
:show-calendar-on-select="false"
@select-calendar="changeCalendar" />
</div>
Expand Down Expand Up @@ -195,7 +195,7 @@ export default {
...mapState(useSettingsStore, {
isTalkEnabled: 'talkEnabled',
}),
...mapState(useCalendarsStore, ['ownSortedCalendars']),
...mapState(useCalendarsStore, ['sortedCalendars']),

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppointmentConfigModal.vue#L198

Added line #L198 was not covered by tests
...mapStores(useAppointmentConfigsStore, useCalendarsStore, useSettingsStore),
formTitle() {
if (this.isNew) {
Expand All @@ -213,26 +213,26 @@ export default {
},
calendar() {
if (!this.editing.targetCalendarUri) {
return this.ownSortedCalendars[0]
return this.sortedCalendars[0]
}
const uri = this.editing.targetCalendarUri
const calendar = this.ownSortedCalendars.find(cal => this.calendarUrlToUri(cal.url) === uri)
return calendar || this.ownSortedCalendars[0]
const calendar = this.sortedCalendars.find(cal => this.calendarUrlToUri(cal.url) === uri)
return calendar || this.sortedCalendars[0]

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppointmentConfigModal.vue#L220-L221

Added lines #L220 - L221 were not covered by tests
},
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.sortedCalendars.filter(calendar => calendar.url !== this.calendar.url)

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

View check run for this annotation

Codecov / codecov/patch

src/components/AppointmentConfigModal.vue#L225

Added line #L225 was not covered by tests
},
conflictCalendars() {
const freebusyUris = this.editing.calendarFreeBusyUris ?? []
return freebusyUris.map(uri => {
return this.ownSortedCalendars.find(cal => this.calendarUrlToUri(cal.url) === uri)
return this.sortedCalendars.find(cal => this.calendarUrlToUri(cal.url) === uri)
})
},
defaultConfig() {
return AppointmentConfig.createDefault(
this.calendarUrlToUri(this.ownSortedCalendars[0].url),
this.calendarUrlToUri(this.sortedCalendars[0].url),
this.calendarsStore.scheduleInbox,
this.settingsStore.getResolvedTimezone,
)
Expand Down

0 comments on commit 562e828

Please sign in to comment.