From 80c1babb7f0d87baf39764fbfbf080ec9cf3e033 Mon Sep 17 00:00:00 2001 From: lenhanphung Date: Tue, 7 Oct 2025 15:24:39 +0700 Subject: [PATCH] refactor: remove 'mark as important' field and clean up console.log statements - Remove 'important' field from EventFormFields component and all event modals - Remove all console.log statements from event create/update flow - Fix import issues and type compatibility in EventModal --- .../Calendar/handlers/eventHandlers.ts | 1 - src/components/Event/EventFormFields.tsx | 20 ++----------------- src/features/Events/EventApi.ts | 3 --- src/features/Events/EventDisplay.tsx | 2 +- src/features/Events/EventUpdateModal.tsx | 4 ---- 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/components/Calendar/handlers/eventHandlers.ts b/src/components/Calendar/handlers/eventHandlers.ts index 0491984..776cb2a 100644 --- a/src/components/Calendar/handlers/eventHandlers.ts +++ b/src/components/Calendar/handlers/eventHandlers.ts @@ -113,7 +113,6 @@ export const createEventHandlers = (props: EventHandlersProps) => { if (info.event.url) { window.open(info.event.url); } else { - console.log(info.event); setOpenEventDisplay(true); setEventDisplayedId(info.event.extendedProps.uid); setEventDisplayedCalId(info.event.extendedProps.calId); diff --git a/src/components/Event/EventFormFields.tsx b/src/components/Event/EventFormFields.tsx index 30e5cef..062fb7e 100644 --- a/src/components/Event/EventFormFields.tsx +++ b/src/components/Event/EventFormFields.tsx @@ -25,10 +25,8 @@ import { } from "@mui/icons-material"; import AttendeeSelector from "../Attendees/AttendeeSearch"; import RepeatEvent from "./EventRepeat"; -import { - userAttendee, - RepetitionObject, -} from "../../features/Events/EventsTypes"; +import { RepetitionObject } from "../../features/Events/EventsTypes"; +import { userAttendee } from "../../features/User/userDataTypes"; import { Calendars } from "../../features/Calendars/CalendarTypes"; import { generateMeetingLink, @@ -115,8 +113,6 @@ interface EventFormFieldsProps { setTimezone: (timezone: string) => void; calendarid: number; setCalendarid: (calendarid: number) => void; - important: boolean; - setImportant: (important: boolean) => void; hasVideoConference: boolean; setHasVideoConference: (hasVideoConference: boolean) => void; meetingLink: string | null; @@ -171,8 +167,6 @@ export default function EventFormFields({ setTimezone, calendarid, setCalendarid, - important, - setImportant, hasVideoConference, setHasVideoConference, meetingLink, @@ -204,7 +198,6 @@ export default function EventFormFields({ if (meetingLink) { try { await navigator.clipboard.writeText(meetingLink); - console.log("Meeting link copied to clipboard"); } catch (err) { console.error("Failed to copy link:", err); } @@ -330,15 +323,6 @@ export default function EventFormFields({ - setImportant(!important)} - /> - } - label="Mark as important" - /> diff --git a/src/features/Events/EventUpdateModal.tsx b/src/features/Events/EventUpdateModal.tsx index 5f8df0b..50464a9 100644 --- a/src/features/Events/EventUpdateModal.tsx +++ b/src/features/Events/EventUpdateModal.tsx @@ -144,7 +144,6 @@ function EventUpdateModal({ const [attendees, setAttendees] = useState([]); const [hasVideoConference, setHasVideoConference] = useState(false); const [meetingLink, setMeetingLink] = useState(null); - const [important, setImportant] = useState(false); const resetAllStateToDefault = useCallback(() => { setShowMore(false); @@ -162,7 +161,6 @@ function EventUpdateModal({ setAlarm(""); setEventClass("PUBLIC"); setBusy("OPAQUE"); - setImportant(false); setTimezone( resolveTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone) ); @@ -422,8 +420,6 @@ function EventUpdateModal({ setTimezone={setTimezone} calendarid={calendarid} setCalendarid={setCalendarid} - important={important} - setImportant={setImportant} hasVideoConference={hasVideoConference} setHasVideoConference={setHasVideoConference} meetingLink={meetingLink}