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

feat: Allow shared calendars as appointment conflict calendars #6411

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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 @@
...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 @@
},
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
Loading