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
This commit is contained in:
lenhanphung
2025-10-07 15:24:39 +07:00
committed by Benoit TELLIER
parent 202feb3d23
commit 80c1babb7f
5 changed files with 3 additions and 27 deletions
@@ -113,7 +113,6 @@ export const createEventHandlers = (props: EventHandlersProps) => {
if (info.event.url) { if (info.event.url) {
window.open(info.event.url); window.open(info.event.url);
} else { } else {
console.log(info.event);
setOpenEventDisplay(true); setOpenEventDisplay(true);
setEventDisplayedId(info.event.extendedProps.uid); setEventDisplayedId(info.event.extendedProps.uid);
setEventDisplayedCalId(info.event.extendedProps.calId); setEventDisplayedCalId(info.event.extendedProps.calId);
+2 -18
View File
@@ -25,10 +25,8 @@ import {
} from "@mui/icons-material"; } from "@mui/icons-material";
import AttendeeSelector from "../Attendees/AttendeeSearch"; import AttendeeSelector from "../Attendees/AttendeeSearch";
import RepeatEvent from "./EventRepeat"; import RepeatEvent from "./EventRepeat";
import { import { RepetitionObject } from "../../features/Events/EventsTypes";
userAttendee, import { userAttendee } from "../../features/User/userDataTypes";
RepetitionObject,
} from "../../features/Events/EventsTypes";
import { Calendars } from "../../features/Calendars/CalendarTypes"; import { Calendars } from "../../features/Calendars/CalendarTypes";
import { import {
generateMeetingLink, generateMeetingLink,
@@ -115,8 +113,6 @@ interface EventFormFieldsProps {
setTimezone: (timezone: string) => void; setTimezone: (timezone: string) => void;
calendarid: number; calendarid: number;
setCalendarid: (calendarid: number) => void; setCalendarid: (calendarid: number) => void;
important: boolean;
setImportant: (important: boolean) => void;
hasVideoConference: boolean; hasVideoConference: boolean;
setHasVideoConference: (hasVideoConference: boolean) => void; setHasVideoConference: (hasVideoConference: boolean) => void;
meetingLink: string | null; meetingLink: string | null;
@@ -171,8 +167,6 @@ export default function EventFormFields({
setTimezone, setTimezone,
calendarid, calendarid,
setCalendarid, setCalendarid,
important,
setImportant,
hasVideoConference, hasVideoConference,
setHasVideoConference, setHasVideoConference,
meetingLink, meetingLink,
@@ -204,7 +198,6 @@ export default function EventFormFields({
if (meetingLink) { if (meetingLink) {
try { try {
await navigator.clipboard.writeText(meetingLink); await navigator.clipboard.writeText(meetingLink);
console.log("Meeting link copied to clipboard");
} catch (err) { } catch (err) {
console.error("Failed to copy link:", err); console.error("Failed to copy link:", err);
} }
@@ -330,15 +323,6 @@ export default function EventFormFields({
<FieldWithLabel label=" " isExpanded={showMore}> <FieldWithLabel label=" " isExpanded={showMore}>
<Box display="flex" gap={2} alignItems="center"> <Box display="flex" gap={2} alignItems="center">
<FormControlLabel
control={
<Checkbox
checked={important}
onChange={() => setImportant(!important)}
/>
}
label="Mark as important"
/>
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
-3
View File
@@ -42,9 +42,6 @@ export async function putEvent(event: CalendarEvent, calOwnerEmail?: string) {
"content-type": "text/calendar; charset=utf-8", "content-type": "text/calendar; charset=utf-8",
}, },
}); });
if (response.status === 201) {
console.log("PUT (201) :", response.url);
}
return response; return response;
} }
+1 -1
View File
@@ -302,7 +302,7 @@ export default function EventDisplayModal({
</Button> </Button>
<Button <Button
color="primary" color="primary"
onClick={() => console.log("proposenewtime")} onClick={() => {}}
> >
Propose new time Propose new time
</Button> </Button>
-4
View File
@@ -144,7 +144,6 @@ function EventUpdateModal({
const [attendees, setAttendees] = useState<userAttendee[]>([]); const [attendees, setAttendees] = useState<userAttendee[]>([]);
const [hasVideoConference, setHasVideoConference] = useState(false); const [hasVideoConference, setHasVideoConference] = useState(false);
const [meetingLink, setMeetingLink] = useState<string | null>(null); const [meetingLink, setMeetingLink] = useState<string | null>(null);
const [important, setImportant] = useState(false);
const resetAllStateToDefault = useCallback(() => { const resetAllStateToDefault = useCallback(() => {
setShowMore(false); setShowMore(false);
@@ -162,7 +161,6 @@ function EventUpdateModal({
setAlarm(""); setAlarm("");
setEventClass("PUBLIC"); setEventClass("PUBLIC");
setBusy("OPAQUE"); setBusy("OPAQUE");
setImportant(false);
setTimezone( setTimezone(
resolveTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone) resolveTimezone(Intl.DateTimeFormat().resolvedOptions().timeZone)
); );
@@ -422,8 +420,6 @@ function EventUpdateModal({
setTimezone={setTimezone} setTimezone={setTimezone}
calendarid={calendarid} calendarid={calendarid}
setCalendarid={setCalendarid} setCalendarid={setCalendarid}
important={important}
setImportant={setImportant}
hasVideoConference={hasVideoConference} hasVideoConference={hasVideoConference}
setHasVideoConference={setHasVideoConference} setHasVideoConference={setHasVideoConference}
meetingLink={meetingLink} meetingLink={meetingLink}