559 delegation create event in another user calendar (#561)

* [#559] added delegated calendars in user selector
* [#559] selector for calendar display delegated and personal separatly

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2026-02-20 23:14:48 +01:00
committed by GitHub
parent 2e70928645
commit f40165d2e2
9 changed files with 107 additions and 52 deletions
+10 -7
View File
@@ -76,14 +76,17 @@ function EventUpdateModal({
const user = useAppSelector((state) => state.user);
const calendarsList = useAppSelector((state) => state.calendars.list);
// if the event's calendar is delegated then it shall be the only calendar accessible from the event update modal
const userPersonalCalendars: Calendar[] = useMemo(() => {
const allCalendars = Object.values(calendarsList) as Calendar[];
const allCalendars = Object.values(calList) as Calendar[];
if (calList[calId]?.delegated) {
return [calList[calId]];
}
return allCalendars.filter(
(c: Calendar) => c.id?.split("/")[0] === user.userData?.openpaasId
(calendar: Calendar) =>
calendar.id?.split("/")[0] === user.userData?.openpaasId
);
}, [calendarsList, user.userData?.openpaasId]);
}, [calList, calId, user.userData?.openpaasId]);
const timezoneList = useMemo(() => {
const zones = Object.keys(TIMEZONES.zones).sort();
@@ -275,7 +278,7 @@ function EventUpdateModal({
// Handle repetition properly - check both current event and base event
const baseEventId = extractEventBaseUuid(eventToDisplay.uid);
const baseEvent = calendarsList[calId]?.events[baseEventId];
const baseEvent = calList[calId]?.events[baseEventId];
const repetitionSource =
eventToDisplay.repetition || baseEvent?.repetition;
@@ -343,7 +346,7 @@ function EventUpdateModal({
event,
calId,
userPersonalCalendars,
calendarsList,
calList,
masterEvent,
isLoadingMasterEvent,
]);