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

fix(editor): don't respect default calendar in the calendar picker #5996

Merged
merged 1 commit into from
May 10, 2024
Merged
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
6 changes: 3 additions & 3 deletions src/components/AppNavigation/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<li v-if="currentUserPrincipal && defaultCalendarOptions.length > 1 && nextcloudVersion >= 29"
class="settings-fieldset-interior-item settings-fieldset-interior-item--default-calendar">
<label :for="defaultCalendarPickerId">
{{ $t('calendar', 'Default calendar for invitations and new events') }}
{{ $t('calendar', 'Default calendar for incoming invitations') }}

Check warning on line 79 in src/components/AppNavigation/Settings.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/Settings.vue#L79

Added line #L79 was not covered by tests
</label>
<CalendarPicker :value="defaultCalendar"
:calendars="defaultCalendarOptions"
Expand Down Expand Up @@ -300,7 +300,7 @@
.filter(calendar => !calendar.readOnly && !calendar.isSharedWithMe)
},
/**
* The default calendar for new events and inivitations
* The default calendar for incoming inivitations

Check warning on line 303 in src/components/AppNavigation/Settings.vue

View check run for this annotation

Codecov / codecov/patch

src/components/AppNavigation/Settings.vue#L303

Added line #L303 was not covered by tests
*
* @return {object|undefined} The default calendar or undefined if none is available
*/
Expand Down Expand Up @@ -443,7 +443,7 @@
}
},
/**
* Changes the default calendar for new events
* Changes the default calendar for incoming invitations
*
* @param {object} selectedCalendar The new selected default calendar
*/
Expand Down
16 changes: 2 additions & 14 deletions src/store/calendarObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,20 +352,8 @@
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))

Check warning on line 356 in src/store/calendarObjects.js

View check run for this annotation

Codecov / codecov/patch

src/store/calendarObjects.js#L355-L356

Added lines #L355 - L356 were not covered by tests
},

/**
Expand Down
Loading