Bugfix delegation (#585)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -56,6 +56,7 @@ describe("Event Full Display — delegated calendar move", () => {
|
||||
name: "Delegated Calendar",
|
||||
color: "#00FF00",
|
||||
delegated: true,
|
||||
access: { write: true },
|
||||
owner: {
|
||||
emails: ["delegate@test.com"],
|
||||
name: "Delegate User",
|
||||
|
||||
@@ -76,13 +76,12 @@ function EventUpdateModal({
|
||||
|
||||
const user = useAppSelector((state) => state.user);
|
||||
|
||||
// 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(calList) as Calendar[];
|
||||
return allCalendars.filter(
|
||||
(calendar: Calendar) =>
|
||||
calendar.id?.split("/")[0] === user.userData?.openpaasId ||
|
||||
calendar.delegated
|
||||
(calendar.delegated && calendar.access?.write)
|
||||
);
|
||||
}, [calList, user.userData?.openpaasId]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user