From 1c5786b66ff1bfb0c8d179c0fbebf8dfddc295d0 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:00:03 +0530 Subject: [PATCH] fix: org bio (#17971) * fix: org bio * chore: use in bookings --- apps/web/modules/apps/[slug]/slug-view.tsx | 3 ++- packages/features/bookings/Booker/components/EventMeta.tsx | 7 ++++++- .../features/ee/organizations/pages/settings/profile.tsx | 5 ++++- .../eventtypes/components/EventTypeDescription.tsx | 3 ++- packages/ui/components/form/checkbox/Checkbox.tsx | 3 ++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/web/modules/apps/[slug]/slug-view.tsx b/apps/web/modules/apps/[slug]/slug-view.tsx index 4161086d18..da843e0e38 100644 --- a/apps/web/modules/apps/[slug]/slug-view.tsx +++ b/apps/web/modules/apps/[slug]/slug-view.tsx @@ -6,6 +6,7 @@ import Link from "next/link"; import { IS_PRODUCTION } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML"; import { showToast } from "@calcom/ui"; import type { getStaticProps } from "@lib/apps/[slug]/getStaticProps"; @@ -71,7 +72,7 @@ function SingleAppPage(props: PageProps) { // privacy="https://zoom.us/privacy" body={ <> -
+
} /> diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx index a5c09f7caa..342789bfbc 100644 --- a/packages/features/bookings/Booker/components/EventMeta.tsx +++ b/packages/features/bookings/Booker/components/EventMeta.tsx @@ -11,6 +11,7 @@ import { EventMetaBlock } from "@calcom/features/bookings/components/event-meta/ import { useTimePreferences } from "@calcom/features/bookings/lib"; import type { BookerEvent } from "@calcom/features/bookings/types"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML"; import { EventTypeAutoTranslatedField } from "@calcom/prisma/enums"; import i18nConfigration from "../../../../../i18n.json"; @@ -137,7 +138,11 @@ export const EventMeta = ({ {event?.title} {(event.description || translatedDescription) && ( -
+
)}
diff --git a/packages/features/ee/organizations/pages/settings/profile.tsx b/packages/features/ee/organizations/pages/settings/profile.tsx index 737ab00501..728938a9e2 100644 --- a/packages/features/ee/organizations/pages/settings/profile.tsx +++ b/packages/features/ee/organizations/pages/settings/profile.tsx @@ -14,6 +14,7 @@ import SectionBottomActions from "@calcom/features/settings/SectionBottomActions import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { md } from "@calcom/lib/markdownIt"; +import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML"; import turndown from "@calcom/lib/turndownService"; import { MembershipRole } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; @@ -144,7 +145,9 @@ const OrgProfileView = () => {
)} diff --git a/packages/features/eventtypes/components/EventTypeDescription.tsx b/packages/features/eventtypes/components/EventTypeDescription.tsx index b2ab67ca6f..80010723dc 100644 --- a/packages/features/eventtypes/components/EventTypeDescription.tsx +++ b/packages/features/eventtypes/components/EventTypeDescription.tsx @@ -7,6 +7,7 @@ import { PriceIcon } from "@calcom/features/bookings/components/event-meta/Price import { classNames, parseRecurringEvent } from "@calcom/lib"; import getPaymentAppData from "@calcom/lib/getPaymentAppData"; import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML"; import type { baseEventTypeSelect } from "@calcom/prisma"; import { SchedulingType } from "@calcom/prisma/enums"; import type { EventTypeModel } from "@calcom/prisma/zod"; @@ -50,7 +51,7 @@ export const EventTypeDescription = ({ shortenDescription ? "line-clamp-4 [&>*:not(:first-child)]:hidden" : "" )} dangerouslySetInnerHTML={{ - __html: eventType.descriptionAsSafeHTML || "", + __html: markdownToSafeHTML(eventType.descriptionAsSafeHTML || ""), }} /> )} diff --git a/packages/ui/components/form/checkbox/Checkbox.tsx b/packages/ui/components/form/checkbox/Checkbox.tsx index 5d36db650b..048812d66e 100644 --- a/packages/ui/components/form/checkbox/Checkbox.tsx +++ b/packages/ui/components/form/checkbox/Checkbox.tsx @@ -4,6 +4,7 @@ import type { InputHTMLAttributes } from "react"; import React, { forwardRef } from "react"; import classNames from "@calcom/lib/classNames"; +import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML"; import { Icon } from "../../icon"; @@ -95,7 +96,7 @@ const CheckboxField = forwardRef( ) : (