[DELEGATION] Edit attendance and events, delete event for someone (#553)

* [#523] added way to manage attendance for delegated calendars

* [DELEGATION] #523 & #524 changed eventURL calculation for delegated events to have the rigth one

* [#524] added drag and drop authorisation to delegated event

* [#524] added tests

* [#524] support for the permission access

* [#524] no edit when delegated event is not public
This commit is contained in:
Camille Moussu
2026-02-19 09:50:29 +01:00
committed by GitHub
parent f520a9b6fe
commit cfb2b59584
52 changed files with 1116 additions and 219 deletions
@@ -30,7 +30,7 @@ describe("Calendar API", () => {
const calendars = await getCalendars(mockUserId);
expect(api.get).toHaveBeenCalledWith(
`dav/calendars/${mockUserId}.json?personal=true&sharedDelegationStatus=accepted&sharedPublicSubscription=true&`,
`dav/calendars/${mockUserId}.json?personal=true&sharedDelegationStatus=accepted&sharedPublicSubscription=true&withRights=true`,
{
headers: { Accept: "application/calendar+json" },
}
@@ -109,8 +109,7 @@ describe("CalendarPopover (editing mode)", () => {
name: "Work Calendar",
description: "Team meetings",
color: { light: "#33B679" },
owner: "alice",
ownerEmails: ["alice@example.com"],
owner: { firstname: "alice", emails: ["alice@example.com"] },
visibility: "public",
events: {},
};
@@ -214,8 +213,7 @@ describe("CalendarPopover - Tabs Scenarios", () => {
name: "Work Calendar",
description: "Team meetings",
color: { light: "#33B679" },
owner: "alice",
ownerEmails: ["alice@example.com"],
owner: { firstname: "alice", emails: ["alice@example.com"] },
visibility: "public",
events: {},
};
@@ -195,9 +195,9 @@ describe("CalendarSlice", () => {
expect(getUserDetailsMock).toHaveBeenCalledWith("u3");
const state = store.getState().calendars;
expect(state.list["u1/cal1"].owner).toContain("Alice");
expect(state.list["u2/cal2"].owner).toContain("Bob");
expect(state.list["u3/cal3"].owner).toContain("Charlie");
expect(state.list["u1/cal1"].owner.firstname).toContain("Alice");
expect(state.list["u2/cal2"].owner.firstname).toContain("Bob");
expect(state.list["u3/cal3"].owner.firstname).toContain("Charlie");
});
it("getCalendarsListAsync deduplicates getUserDetails calls for same ownerId", async () => {
@@ -331,8 +331,8 @@ describe("CalendarSlice", () => {
expect(getUserDetailsMock).toHaveBeenCalledTimes(2);
const state = store.getState().calendars;
expect(state.list["u1/cal1"].owner).toContain("Alice");
expect(state.list["u2/cal2"].owner).toContain("Unknown User");
expect(state.list["u1/cal1"].owner.firstname).toContain("Alice");
expect(state.list["u2/cal2"].owner.lastname).toContain("Unknown User");
expect(result.payload.errors).toBeTruthy();
});
@@ -375,8 +375,7 @@ describe("CalendarSlice", () => {
color: { "apple:color": "#f00" },
name: "Test",
desc: "Desc",
owner: "Owner",
ownerEmails: ["o@example.com"],
owner: { firstname: "Owner", emails: ["o@example.com"] },
};
const state = reducer(
initialState,
@@ -393,8 +392,7 @@ describe("CalendarSlice", () => {
link: "/calendars/u1/c1.json",
name: "Shared",
desc: "Shared Desc",
owner: "O",
ownerEmails: ["o@example.com"],
owner: { firstname: "O", emails: ["o@example.com"] },
};
const mockCal = {
cal: {
@@ -423,8 +421,7 @@ describe("CalendarSlice", () => {
color: { "apple:color": "#aaa" },
events: {},
visibility: "public",
owner: "O",
ownerEmails: ["o@o.com"],
owner: { firstname: "O", emails: ["o@o.com"] },
link: "/calendars/t1.json",
description: "desc",
} as Calendar,
@@ -27,8 +27,7 @@ describe("Calendar - Timezone Integration", () => {
name: "Test Calendar",
description: "",
color: "#33B679",
owner: "user1",
ownerEmails: ["test@test.com"],
owner: { firstname: "user1", emails: ["test@test.com"] },
visibility: "public",
events: {},
},
@@ -174,8 +173,7 @@ describe("EventDisplayPreview - Timezone Display", () => {
id: "user1/cal1",
name: "Test Calendar",
color: "#33B679",
owner: "user1",
ownerEmails: ["test@test.com"],
owner: { firstname: "user1", emails: ["test@test.com"] },
visibility: "public",
events: {
event1: baseEvent,
@@ -17,8 +17,7 @@ describe("refreshCalendarWithSyncToken", () => {
id: "user1/cal1",
name: "Test Calendar",
link: "/calendars/user1/cal1.json",
owner: "Test User",
ownerEmails: ["test@example.com"],
owner: { firstname: "Test User", emails: ["test@example.com"] },
description: "Test calendar description",
delegated: false,
color: { light: "#006BD8", dark: "#FFF" },