Avoid creating dynamic HTML (#4669)
parent
6e2e252c49
commit
f628ac4366
|
@ -51,7 +51,7 @@ const DestinationCalendarSelector = ({
|
||||||
if (selected) {
|
if (selected) {
|
||||||
setSelectedOption({
|
setSelectedOption({
|
||||||
value: `${selected.integration}:${selected.externalId}`,
|
value: `${selected.integration}:${selected.externalId}`,
|
||||||
label: `<span class="font-semibold">${selected.name}</span> (${selected.externalId})` || "",
|
label: `${selected.name} (${selected.externalId})` || "",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [query.data?.connectedCalendars, value]);
|
}, [query.data?.connectedCalendars, value]);
|
||||||
|
@ -66,7 +66,7 @@ const DestinationCalendarSelector = ({
|
||||||
options: (selectedCalendar.calendars ?? [])
|
options: (selectedCalendar.calendars ?? [])
|
||||||
.filter((cal) => cal.readOnly === false)
|
.filter((cal) => cal.readOnly === false)
|
||||||
.map((cal) => ({
|
.map((cal) => ({
|
||||||
label: `<span class="font-semibold">${cal.name}</span> (${cal.externalId})` || "",
|
label: `${cal.name} (${cal.externalId})` || "",
|
||||||
value: `${cal.integration}:${cal.externalId}`,
|
value: `${cal.integration}:${cal.externalId}`,
|
||||||
})),
|
})),
|
||||||
})) ?? [];
|
})) ?? [];
|
||||||
|
@ -83,9 +83,6 @@ const DestinationCalendarSelector = ({
|
||||||
title={`${t("select_destination_calendar")}: ${selectedOption?.label || ""}`}>
|
title={`${t("select_destination_calendar")}: ${selectedOption?.label || ""}`}>
|
||||||
<Select
|
<Select
|
||||||
name="primarySelectedCalendar"
|
name="primarySelectedCalendar"
|
||||||
formatOptionLabel={function (data) {
|
|
||||||
return <span dangerouslySetInnerHTML={{ __html: data.label }} />;
|
|
||||||
}}
|
|
||||||
placeholder={
|
placeholder={
|
||||||
!hidePlaceholder ? (
|
!hidePlaceholder ? (
|
||||||
`${t("select_destination_calendar")}`
|
`${t("select_destination_calendar")}`
|
||||||
|
|
Loading…
Reference in New Issue