[#7] fixed attendance update when editing event
This commit is contained in:
@@ -991,6 +991,7 @@ describe("Event Full Display", () => {
|
|||||||
],
|
],
|
||||||
organizer: {
|
organizer: {
|
||||||
cal_address: "organizer@test.com",
|
cal_address: "organizer@test.com",
|
||||||
|
cn: "Edgar Organiser",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ describe("EventPopover", () => {
|
|||||||
expect(screen.getByLabelText("Alarm")).toBeInTheDocument();
|
expect(screen.getByLabelText("Alarm")).toBeInTheDocument();
|
||||||
expect(screen.getByLabelText("Visibility")).toBeInTheDocument();
|
expect(screen.getByLabelText("Visibility")).toBeInTheDocument();
|
||||||
expect(screen.getByLabelText("is Busy")).toBeInTheDocument();
|
expect(screen.getByLabelText("is Busy")).toBeInTheDocument();
|
||||||
expect(screen.getByLabelText("Time Zone")).toBeInTheDocument();
|
|
||||||
// Calendar options
|
// Calendar options
|
||||||
const select = screen.getByLabelText("Calendar");
|
const select = screen.getByLabelText("Calendar");
|
||||||
fireEvent.mouseDown(select);
|
fireEvent.mouseDown(select);
|
||||||
|
|||||||
@@ -111,9 +111,10 @@ export default function EventDisplayModal({
|
|||||||
(person) => person.cal_address === user.userData.email
|
(person) => person.cal_address === user.userData.email
|
||||||
);
|
);
|
||||||
|
|
||||||
const organizer = event?.attendee?.find(
|
const organizer =
|
||||||
(a) => a.cal_address === event?.organizer?.cal_address
|
event.attendee?.find(
|
||||||
);
|
(a) => a.cal_address === event?.organizer?.cal_address
|
||||||
|
) ?? ({} as userAttendee);
|
||||||
|
|
||||||
const isOwn = organizer?.cal_address === user.userData.email;
|
const isOwn = organizer?.cal_address === user.userData.email;
|
||||||
const isOwnCal = userPersonnalCalendars.find((cal) => cal.id === calId);
|
const isOwnCal = userPersonnalCalendars.find((cal) => cal.id === calId);
|
||||||
@@ -155,17 +156,7 @@ export default function EventDisplayModal({
|
|||||||
class: eventClass,
|
class: eventClass,
|
||||||
organizer: event.organizer,
|
organizer: event.organizer,
|
||||||
timezone,
|
timezone,
|
||||||
attendee: [
|
attendee: [organizer, ...attendees],
|
||||||
{
|
|
||||||
cn: event.organizer?.cn,
|
|
||||||
cal_address: event.organizer?.cal_address ?? "",
|
|
||||||
partstat: "ACCEPTED",
|
|
||||||
rsvp: "FALSE",
|
|
||||||
role: "CHAIR",
|
|
||||||
cutype: "INDIVIDUAL",
|
|
||||||
},
|
|
||||||
...attendees,
|
|
||||||
],
|
|
||||||
transp: "OPAQUE",
|
transp: "OPAQUE",
|
||||||
color: userPersonnalCalendars[calendarid]?.color,
|
color: userPersonnalCalendars[calendarid]?.color,
|
||||||
};
|
};
|
||||||
@@ -411,7 +402,8 @@ export default function EventDisplayModal({
|
|||||||
{event.attendee?.length > 0 && (
|
{event.attendee?.length > 0 && (
|
||||||
<Box sx={{ mb: 1 }}>
|
<Box sx={{ mb: 1 }}>
|
||||||
<Typography variant="subtitle2">Attendees:</Typography>
|
<Typography variant="subtitle2">Attendees:</Typography>
|
||||||
{organizer && renderAttendeeBadge(organizer, "org", true)}
|
{organizer.cal_address &&
|
||||||
|
renderAttendeeBadge(organizer, "org", true)}
|
||||||
{(showAllAttendees
|
{(showAllAttendees
|
||||||
? attendees
|
? attendees
|
||||||
: attendees.slice(0, attendeeDisplayLimit)
|
: attendees.slice(0, attendeeDisplayLimit)
|
||||||
|
|||||||
Reference in New Issue
Block a user