Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -54,6 +54,15 @@ export const checkIfCurrentWeekOrDay = (): boolean => {
|
||||
return !!nowIndicator;
|
||||
};
|
||||
|
||||
export function formatEventChipTitle(e: CalendarEvent, t: Function) {
|
||||
if (!e.title) {
|
||||
return t("event.untitled");
|
||||
}
|
||||
return e.title === "Busy" && e.class === "PRIVATE"
|
||||
? t("event.form.busy")
|
||||
: e.title;
|
||||
}
|
||||
|
||||
export const eventToFullCalendarFormat = (
|
||||
filteredEvents: CalendarEvent[],
|
||||
filteredTempEvents: CalendarEvent[],
|
||||
@@ -66,14 +75,14 @@ export const eventToFullCalendarFormat = (
|
||||
if (e.calId.split("/")[0] === userId) {
|
||||
return {
|
||||
...e,
|
||||
title: e.title ? e.title : t("event.untitled"),
|
||||
title: formatEventChipTitle(e, t),
|
||||
colors: e.color,
|
||||
editable: true,
|
||||
};
|
||||
}
|
||||
return {
|
||||
...e,
|
||||
title: e.title ? e.title : t("event.untitled"),
|
||||
title: formatEventChipTitle(e, t),
|
||||
colors: e.color,
|
||||
editable: false,
|
||||
};
|
||||
|
||||
@@ -29,7 +29,10 @@ import { useEffect, useState } from "react";
|
||||
import { useAppDispatch, useAppSelector } from "../../app/hooks";
|
||||
import { CalendarName } from "../../components/Calendar/CalendarName";
|
||||
import { getTimezoneOffset } from "../../components/Calendar/TimezoneSelector";
|
||||
import { updateTempCalendar } from "../../components/Calendar/utils/calendarUtils";
|
||||
import {
|
||||
formatEventChipTitle,
|
||||
updateTempCalendar,
|
||||
} from "../../components/Calendar/utils/calendarUtils";
|
||||
import ResponsiveDialog from "../../components/Dialog/ResponsiveDialog";
|
||||
import { EditModeDialog } from "../../components/Event/EditModeDialog";
|
||||
import EventDuplication from "../../components/Event/EventDuplicate";
|
||||
@@ -286,7 +289,7 @@ export default function EventPreviewModal({
|
||||
}}
|
||||
gutterBottom
|
||||
>
|
||||
{event.title ? event.title : t("event.untitled")}
|
||||
{formatEventChipTitle(event, t)}
|
||||
</Typography>
|
||||
{event.transp === "TRANSPARENT" && (
|
||||
<Tooltip title={t("eventPreview.free.tooltip")} placement="top">
|
||||
|
||||
Reference in New Issue
Block a user