Feat/add calendar delegation features#8085
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
da7ae86 to
654e770
Compare
kra-mo
left a comment
There was a problem hiding this comment.
From the design side:
"Select a user" and "Search for a user…" are redundant, it's fine to just have the second if it's baked into the component anyway, so without the title. The input field should also be full-width, and Add should be a primary button.
I wonder why delegation should be its own item in the sidebar instead of just a section in Settings? I'd rather have it just there. And at that point, have + Add delegate be full-width as well.
0dd4839 to
f50f37d
Compare
kra-mo
left a comment
There was a problem hiding this comment.
Looks good from the design side :)
|
Tested. Found error when delegator has a shared calendar |
|
I think it's related to nextcloud/server#59232 @hamza221
|
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
e8b2495 to
d8f14d7
Compare
There was a problem hiding this comment.
Thanks a lot for fixing the broken stuff @hamza221! Please don't merge this for now though because you accidentally removed the information on whether people are read/write delegates in settings, I'll re-introduce that.
EDIT: NOT TRUE
|
Revoking access also stopped working EDIT: NOT TRUE |
|
@hamza221 My bad, ignore my comments |
|
Btw sorry for the co-authored commits, I told it to commit as Assisted but apparently it ignored my, will be fixed on squash. |
| const baseUrl = currentUser.url.replace(/\/?$/, '') | ||
| const proxyWriteGroupUrl = baseUrl + '/calendar-proxy-write' | ||
| const proxyReadGroupUrl = baseUrl + '/calendar-proxy-read' |
There was a problem hiding this comment.
The CDav library should be responsible for creating the specific urls the Calendar app should not need to know how to format a dav url
|
One last comment, this feature needs a version gate for 34 unless we are back porting all the server changes |
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
0c53326 to
74badc4
Compare
|
Looks good, I just fixed the linting errors. This will need to wait until the cdav pr is merged, then the library version will need to be bumped in this pr |
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
74badc4 to
146302e
Compare
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
Feature gate added |
|
Thanks a lot for the help Sebastian! |
No new features were adeed to server, all fixes, all to be backported to 32, no gating actually needed. Update: should be gated to >=34 |
Signed-off-by: Grigory Vodyanov <scratchx@gmx.com>
|
time squash and rebase |
There was a problem hiding this comment.
Pull request overview
Adds front-end support for calendar delegation (proxy access) so delegated calendars can be discovered, displayed, and managed in the Calendar UI, gated by Nextcloud version support.
Changes:
- Introduces a new Pinia delegation store to fetch delegators/delegates and load delegated calendars into the calendars store.
- Updates Calendar list/pickers/headers to visually distinguish delegated calendars and group them by delegator.
- Adds a Delegation section to Calendar settings for managing delegates.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/javascript/unit/models/calendar.test.js | Updates calendar model expectations for the new delegation-related fields. |
| src/views/Calendar.vue | Loads delegation state (delegators + delegated calendars) when supported. |
| src/store/principals.js | Makes fetchPrincipalByUrl return cached/mapped principals for reuse by delegation UI. |
| src/store/delegation.ts | New store to manage delegates/delegators and ingest delegated calendars. |
| src/services/caldavService.js | Exposes client + adds helper to fetch calendars from an arbitrary calendar-home URL. |
| src/models/calendar.js | Extends calendar model with isDelegated and delegatorUrl. |
| src/components/Shared/CalendarPickerOption.vue | Shows delegated-by label/avatar in calendar picker options. |
| src/components/Shared/CalendarPicker.vue | Passes delegation props through to picker option component. |
| src/components/Editor/CalendarPickerHeader.vue | Shows delegated-by label/avatar in the editor calendar switcher. |
| src/components/AppointmentConfigModal/DurationInput.vue | Removes now-unneeded eslint suppression near emits usage. |
| src/components/AppNavigation/Settings/SettingsDelegationSection.vue | New settings UI to add/revoke delegates with read/write permissions. |
| src/components/AppNavigation/Settings.vue | Adds Delegation settings section behind version gating. |
| src/components/AppNavigation/CalendarList/CalendarListItem.vue | Displays delegated-by details and treats delegated calendars as non-shareable. |
| src/components/AppNavigation/CalendarList.vue | Adds delegated calendars grouping/captions in the navigation list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @param {string} url The URL of the principal | ||
| * @return {Promise<void>} | ||
| */ | ||
| async fetchPrincipalByUrl({ url }) { | ||
| // Don't refetch principals we already have | ||
| if (this.getPrincipalByUrl(url)) { | ||
| return | ||
| const existing = this.getPrincipalByUrl(url) |
| const delegates = await getClient().getDelegatesForPrincipal(currentUser.url) | ||
| writeUrls = delegates.write | ||
| readUrls = delegates.read |
| const delegate = revokeTarget.value | ||
| revokeTarget.value = null | ||
| try { | ||
| await delegationStore.removeDelegate({ principalUrl: delegate.url! }) | ||
| showSuccess(t('calendar', 'Access revoked successfully.')) | ||
| } catch (error) { |
| showEditModal() { | ||
| console.log('getting here') | ||
| this.calendarsStore.editCalendarModal = { calendarId: this.calendar.id } | ||
| }, |
| isDelegated: false, | ||
| isSharedWithMe: false, |
| isDelegated: false, | ||
| isSharedWithMe: false, |
| isDelegated: false, | ||
| isSharedWithMe: false, |
| isDelegated: false, | ||
| isSharedWithMe: false, |
| isDelegated: false, | ||
| isSharedWithMe: true, |
| isDelegated: false, | ||
| isSharedWithMe: false, |












For #2706
COMPREHENSIVE GUIDE FOR TESTING THIS