From f99b3fb22361d5e1698fba4e6e7851ebc512e647 Mon Sep 17 00:00:00 2001 From: lenhanphung Date: Fri, 3 Oct 2025 17:31:24 +0700 Subject: [PATCH] css: fix prettier and hidden slot minor --- src/components/Calendar/CustomCalendar.styl | 3 +++ src/features/Calendars/CalendarSlice.ts | 9 ++++--- src/features/Events/EventModal.tsx | 27 +++++++++++++++------ 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/components/Calendar/CustomCalendar.styl b/src/components/Calendar/CustomCalendar.styl index 09adb52..45db72a 100644 --- a/src/components/Calendar/CustomCalendar.styl +++ b/src/components/Calendar/CustomCalendar.styl @@ -224,3 +224,6 @@ tbody > tr.fc-scrollgrid-section:first-of-type .fc-scroller .navigation-controls margin-right 40px + +.fc .fc-timegrid-slot-minor + border-top-style: none diff --git a/src/features/Calendars/CalendarSlice.ts b/src/features/Calendars/CalendarSlice.ts index 145787a..234845e 100644 --- a/src/features/Calendars/CalendarSlice.ts +++ b/src/features/Calendars/CalendarSlice.ts @@ -12,7 +12,10 @@ import { import { getOpenPaasUser, getUserDetails } from "../User/userAPI"; import { parseCalendarEvent } from "../Events/eventUtils"; import { deleteEvent, getEvent, moveEvent, putEvent } from "../Events/EventApi"; -import { formatDateToYYYYMMDDTHHMMSS, computeWeekRange } from "../../utils/dateUtils"; +import { + formatDateToYYYYMMDDTHHMMSS, + computeWeekRange, +} from "../../utils/dateUtils"; import { User } from "../../components/Attendees/PeopleSearch"; export const getCalendarsListAsync = createAsyncThunk< @@ -206,11 +209,11 @@ export const moveEventAsync = createAsyncThunk< { cal: Calendars; newEvent: CalendarEvent; newURL: string } // Arg type >("calendars/moveEvent", async ({ cal, newEvent, newURL }) => { await moveEvent(newEvent, newURL); - + // Calculate week range based on Monday as first day (consistent with FullCalendar firstDay={1}) const eventDate = new Date(newEvent.start); const { start: weekStart, end: weekEnd } = computeWeekRange(eventDate); - + const calEvents = (await getCalendar(cal.id, { start: formatDateToYYYYMMDDTHHMMSS(weekStart), end: formatDateToYYYYMMDDTHHMMSS(weekEnd), diff --git a/src/features/Events/EventModal.tsx b/src/features/Events/EventModal.tsx index 6c075a1..09e1f00 100644 --- a/src/features/Events/EventModal.tsx +++ b/src/features/Events/EventModal.tsx @@ -23,7 +23,13 @@ import { ContentCopy as CopyIcon, Close as DeleteIcon, } from "@mui/icons-material"; -import React, { useEffect, useState, useMemo, useCallback, useRef } from "react"; +import React, { + useEffect, + useState, + useMemo, + useCallback, + useRef, +} from "react"; import { useAppDispatch, useAppSelector } from "../../app/hooks"; import AttendeeSelector from "../../components/Attendees/AttendeeSearch"; import { ResponsiveDialog } from "../../components/Dialog"; @@ -129,7 +135,6 @@ function EventPopover({ selectPersonnalCalendars ); - // Helper function to resolve timezone aliases const resolveTimezone = (tzName: string): string => { if (TIMEZONES.zones[tzName]) { @@ -213,7 +218,7 @@ function EventPopover({ // Use ref to track if we've already initialized to avoid infinite loop const isInitializedRef = useRef(false); const userPersonnalCalendarsRef = useRef(userPersonnalCalendars); - + // Update ref when userPersonnalCalendars changes useEffect(() => { userPersonnalCalendarsRef.current = userPersonnalCalendars; @@ -259,7 +264,9 @@ function EventPopover({ setEnd(event.end ? event.end : ""); setCalendarid( event.calId - ? userPersonnalCalendarsRef.current.findIndex((e) => e.id === event.calId) + ? userPersonnalCalendarsRef.current.findIndex( + (e) => e.id === event.calId + ) : 0 ); setAllDay(event.allday ?? false); @@ -267,16 +274,22 @@ function EventPopover({ setShowRepeat(event.repetition?.freq ? true : false); setAttendees( event.attendee - ? event.attendee.filter((a) => a.cal_address !== organizer?.cal_address) + ? event.attendee.filter( + (a) => a.cal_address !== organizer?.cal_address + ) : [] ); setAlarm(event.alarm?.trigger ?? ""); setEventClass(event.class ?? "PUBLIC"); setBusy(event.transp ?? "OPAQUE"); - setTimezone(event.timezone ? resolveTimezone(event.timezone) : timezoneList.browserTz); + setTimezone( + event.timezone + ? resolveTimezone(event.timezone) + : timezoneList.browserTz + ); setHasVideoConference(event.x_openpass_videoconference ? true : false); setMeetingLink(event.x_openpass_videoconference || null); - + // Update description to include video conference footer if exists if (event.x_openpass_videoconference && event.description) { const hasVideoFooter = event.description.includes("Visio:");