[#497 & #517] updated event editability in the calendar grid (#519)

* [#497 & #517] updated event editability in the calendar grid to prevent accidental editing and editing event we are not organizer of
This commit is contained in:
Camille Moussu
2026-02-06 11:23:29 +01:00
committed by GitHub
parent b8e837fea6
commit 1720965f0f
2 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -693,7 +693,9 @@ export default function CalendarApp({
events={eventToFullCalendarFormat(
filteredEvents,
filteredTempEvents,
userId
userId,
userData?.email,
isPending
)}
eventOrder={(a: any, b: any) =>
a.extendedProps.priority - b.extendedProps.priority
@@ -68,7 +68,9 @@ export function formatEventChipTitle(e: CalendarEvent, t: Function) {
export const eventToFullCalendarFormat = (
filteredEvents: CalendarEvent[],
filteredTempEvents: CalendarEvent[],
userId: string | undefined
userId: string | undefined,
userAddress: string | undefined,
pending: boolean
) => {
const { t } = useI18n();
return filteredEvents
@@ -76,14 +78,17 @@ export const eventToFullCalendarFormat = (
.map((e) => {
const eventTimezone = e.timezone || "Etc/UTC";
const isAllDay = e.allday ?? false;
const isPersonnalEvent = extractEventBaseUuid(e.calId) === userId;
const isOrganiser = e.organizer
? e.organizer.cal_address?.toLowerCase() === userAddress?.toLowerCase()
: true; // if there are no organizer in the event we assume it was organized by the owner
const isPersonnalEvent =
extractEventBaseUuid(e.calId) === userId && isOrganiser;
const convertedEvent: any = {
...e,
title: formatEventChipTitle(e, t),
colors: e.color,
editable: isPersonnalEvent,
priority: isPersonnalEvent ? 1 : 0,
priority: isPersonnalEvent && !pending ? 1 : 0,
};
if (!isAllDay && e.start && eventTimezone) {