restyle current date state

This commit is contained in:
lenhanphung
2026-02-05 14:22:32 +07:00
parent 309ac0d23b
commit ec258f4d42
12 changed files with 55 additions and 38 deletions
@@ -129,6 +129,10 @@ describe("EventUpdateModal - Recurring Event 'Edit All' Handling", () => {
screen.queryByDisplayValue("Modified Instance Title") screen.queryByDisplayValue("Modified Instance Title")
).not.toBeInTheDocument(); ).not.toBeInTheDocument();
// Expand more options to show timezone (normal mode shows summary first)
fireEvent.click(
screen.getByRole("button", { name: "common.moreOptions" })
);
// Verify timezone dropdown shows master timezone // Verify timezone dropdown shows master timezone
await waitFor(() => { await waitFor(() => {
expect(screen.getByDisplayValue(/New York/i)).toBeDefined(); expect(screen.getByDisplayValue(/New York/i)).toBeDefined();
@@ -493,8 +497,12 @@ describe("EventUpdateModal - Recurring Event 'Edit All' Handling", () => {
expect(screen.getByDisplayValue("Daily Standup")).toBeInTheDocument(); expect(screen.getByDisplayValue("Daily Standup")).toBeInTheDocument();
}); });
// Expand more options to show date/time inputs (normal mode shows DateTimeSummary first)
fireEvent.click(
screen.getByRole("button", { name: "common.moreOptions" })
);
const input = await waitFor(() => screen.getByTestId("start-time-input"));
// Change time to 2:00 PM (14:00) // Change time to 2:00 PM (14:00)
const input = screen.getByTestId("start-time-input");
await userEvent.click(input); await userEvent.click(input);
await userEvent.clear(input); await userEvent.clear(input);
await userEvent.type(input, "14:00{enter}"); await userEvent.type(input, "14:00{enter}");
+5 -4
View File
@@ -17,7 +17,7 @@
"@fullcalendar/moment-timezone": "^6.1.19", "@fullcalendar/moment-timezone": "^6.1.19",
"@fullcalendar/react": "^6.1.17", "@fullcalendar/react": "^6.1.17",
"@fullcalendar/timegrid": "^6.1.17", "@fullcalendar/timegrid": "^6.1.17",
"@linagora/twake-mui": "1.1.7", "@linagora/twake-mui": "1.1.8",
"@lottiefiles/dotlottie-react": "^0.17.13", "@lottiefiles/dotlottie-react": "^0.17.13",
"@mui/icons-material": "^7.1.2", "@mui/icons-material": "^7.1.2",
"@mui/material": "^7.1.2", "@mui/material": "^7.1.2",
@@ -2712,9 +2712,10 @@
} }
}, },
"node_modules/@linagora/twake-mui": { "node_modules/@linagora/twake-mui": {
"version": "1.1.7", "version": "1.1.8",
"resolved": "https://npm.pkg.github.com/download/@linagora/twake-mui/1.1.7/dd45fa10aeb5c7e6b6e89f59ff9d88c7d2f7e507", "resolved": "https://npm.pkg.github.com/download/@linagora/twake-mui/1.1.8/e629a126e62dffd939a8d3d8de3ce024de5a2154",
"integrity": "sha512-9ZRCeWUWObbIk9h2jg3N0fZlJ+QRBouXzhMNMC4rjQBgFvnCZxZHiMt6kGXQmOov8JsHFKSRhunwfNBYy1cv8Q==", "integrity": "sha512-H2MxtZIy5w1A8VNTNAoM4Pjuph/et4YP8DfzQ+5HCsjRJn6SA/T3nZRZOqC26SxY9kl3XJCKIEKklL+x5af7Vg==",
"license": "MIT",
"dependencies": { "dependencies": {
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
+1 -1
View File
@@ -12,7 +12,7 @@
"@fullcalendar/moment-timezone": "^6.1.19", "@fullcalendar/moment-timezone": "^6.1.19",
"@fullcalendar/react": "^6.1.17", "@fullcalendar/react": "^6.1.17",
"@fullcalendar/timegrid": "^6.1.17", "@fullcalendar/timegrid": "^6.1.17",
"@linagora/twake-mui": "1.1.7", "@linagora/twake-mui": "1.1.8",
"@lottiefiles/dotlottie-react": "^0.17.13", "@lottiefiles/dotlottie-react": "^0.17.13",
"@mui/icons-material": "^7.1.2", "@mui/icons-material": "^7.1.2",
"@mui/material": "^7.1.2", "@mui/material": "^7.1.2",
+1 -1
View File
@@ -117,7 +117,7 @@
margin-top 2px margin-top 2px
width 6px width 6px
height 6px height 6px
background-color #d93025 background-color #1D192B1F
border-radius 50% border-radius 50%
margin-left auto margin-left auto
margin-right auto margin-right auto
+1 -1
View File
@@ -73,7 +73,7 @@ span.fc-daygrid-day-number.current-date
color #fff color #fff
span.fc-daygrid-day-number.current-date:after span.fc-daygrid-day-number.current-date:after
background-color #f67e35 background-color #FB9E3A
td.fc-timegrid-slot.fc-timegrid-slot-label.fc-scrollgrid-shrink, td.fc-timegrid-slot.fc-timegrid-slot-label.fc-scrollgrid-shrink,
td.fc-timegrid-slot.fc-timegrid-slot-label.fc-timegrid-slot-minor td.fc-timegrid-slot.fc-timegrid-slot-label.fc-timegrid-slot-minor
+20 -15
View File
@@ -50,21 +50,26 @@ export function SettingsTab({
<> <>
{/* Form group 1: Name field - first group, margin top 0 */} {/* Form group 1: Name field - first group, margin top 0 */}
<Box mt={0}> <Box mt={0}>
<TextField <Typography variant="h6" sx={{ margin: 0 }}>
fullWidth {t("calendarPopover.settings.calendarName")}
label="" </Typography>
inputProps={{ "aria-label": t("common.name") }} <Box sx={{ marginTop: "6px" }}>
placeholder={t("common.name")} <TextField
value={name} fullWidth
onChange={(e) => setName(e.target.value)} label=""
size="small" inputProps={{ "aria-label": t("common.name") }}
sx={{ placeholder={t("common.name")}
"&.MuiFormControl-root": { value={name}
marginTop: 0, onChange={(e) => setName(e.target.value)}
marginBottom: 0, size="small"
}, sx={{
}} "&.MuiFormControl-root": {
/> marginTop: 0,
marginBottom: 0,
},
}}
/>
</Box>
</Box> </Box>
{/* Form group 2: Description */} {/* Form group 2: Description */}
@@ -80,11 +80,12 @@ export const DateTimeSummary: React.FC<DateTimeSummaryProps> = ({
return `${toHHmm(startTimeStr)} - ${toHHmm(endTimeStr)}`; return `${toHHmm(startTimeStr)} - ${toHHmm(endTimeStr)}`;
}; };
// Format timezone: "(UTC+2) Paris" // Format timezone: "(UTC+2) Paris". Use event date for offset (DST correctness).
const formatTimezone = (tz: string): string => { const formatTimezone = (tz: string, dateStr?: string): string => {
if (!tz) return ""; if (!tz) return "";
try { try {
const offset = getTimezoneOffset(tz, new Date()); const dateForOffset = dateStr ? dayjs(dateStr).toDate() : new Date();
const offset = getTimezoneOffset(tz, dateForOffset);
const tzName = tz.replace(/_/g, " "); const tzName = tz.replace(/_/g, " ");
return `(${offset}) ${tzName}`; return `(${offset}) ${tzName}`;
} catch (error) { } catch (error) {
@@ -127,7 +128,7 @@ export const DateTimeSummary: React.FC<DateTimeSummaryProps> = ({
const dateText = formatDateText(); const dateText = formatDateText();
const timeText = formatTime(startTime, endTime); const timeText = formatTime(startTime, endTime);
const timezoneText = formatTimezone(timezone); const timezoneText = formatTimezone(timezone, startDate);
const repeatText = formatRepeat(repetition); const repeatText = formatRepeat(repetition);
// Don't render if no date // Don't render if no date
+1 -11
View File
@@ -13,13 +13,6 @@ import { Avatar, Badge, Box, Typography } from "@linagora/twake-mui";
import CancelIcon from "@mui/icons-material/Cancel"; import CancelIcon from "@mui/icons-material/Cancel";
import CheckCircleIcon from "@mui/icons-material/CheckCircle"; import CheckCircleIcon from "@mui/icons-material/CheckCircle";
const EMAIL_DISPLAY_MAX_LENGTH = 50;
function truncateDisplayText(text: string, maxLength: number): string {
if (text.length <= maxLength) return text;
return `${text.slice(0, maxLength)}...`;
}
export function renderAttendeeBadge( export function renderAttendeeBadge(
a: userAttendee, a: userAttendee,
key: string, key: string,
@@ -73,10 +66,7 @@ export function renderAttendeeBadge(
</Badge> </Badge>
<Box style={{ display: "flex", flexDirection: "column", minWidth: 0 }}> <Box style={{ display: "flex", flexDirection: "column", minWidth: 0 }}>
<Typography noWrap> <Typography noWrap>
{truncateDisplayText( {a.cn || a.cal_address}
a.cn || a.cal_address,
EMAIL_DISPLAY_MAX_LENGTH
)}
</Typography> </Typography>
{isOrganizer && ( {isOrganizer && (
<Typography variant="caption" color="text.secondary"> <Typography variant="caption" color="text.secondary">
+3
View File
@@ -76,6 +76,9 @@
"addNew": "Add new calendar", "addNew": "Add new calendar",
"access": "Access", "access": "Access",
"import": "Import" "import": "Import"
},
"settings": {
"calendarName": "Calendar name"
} }
}, },
"colorPicker": { "colorPicker": {
+3
View File
@@ -78,6 +78,9 @@
"addNew": "Ajouter un nouveau calendrier", "addNew": "Ajouter un nouveau calendrier",
"access": "Accès", "access": "Accès",
"import": "Importer" "import": "Importer"
},
"settings": {
"calendarName": "Nom du calendrier"
} }
}, },
"colorPicker": { "colorPicker": {
+3
View File
@@ -78,6 +78,9 @@
"addNew": "Добавить новый календарь", "addNew": "Добавить новый календарь",
"access": "Доступ", "access": "Доступ",
"import": "Импорт" "import": "Импорт"
},
"settings": {
"calendarName": "Название календаря"
} }
}, },
"colorPicker": { "colorPicker": {
+3
View File
@@ -76,6 +76,9 @@
"addNew": "Thêm lịch mới", "addNew": "Thêm lịch mới",
"access": "Quyền truy cập", "access": "Quyền truy cập",
"import": "Nhập" "import": "Nhập"
},
"settings": {
"calendarName": "Tên lịch"
} }
}, },
"colorPicker": { "colorPicker": {