fix: display all responses (#13999)

* fix: display all responses

* fix: type err

* chore: rename variable
This commit is contained in:
Udit Takkar authored and GitHub committed 2024-03-12 15:30:02 +00:00
1 parent 4585199b5e
commit 8402dfa3a2
5 files changed
+24 -4

No files matched your search

@@ -24,7 +24,11 @@ import {
useIsEmbed,
} from "@calcom/embed-core/embed-iframe";
import { Price } from "@calcom/features/bookings/components/event-meta/Price";
import { SMS_REMINDER_NUMBER_FIELD, SystemField } from "@calcom/features/bookings/lib/SystemField";
import {
SMS_REMINDER_NUMBER_FIELD,
SystemField,
TITLE_FIELD,
} from "@calcom/features/bookings/lib/SystemField";
import { APP_NAME } from "@calcom/lib/constants";
import {
formatToLocalizedDate,
@@ -91,6 +95,7 @@ export default function Success(props: PageProps) {
const pathname = usePathname();
const searchParams = useCompatSearchParams();
const { eventType, bookingInfo, requiresLoginToUpdate } = props;
const {
allRemainingBookings,
isSuccessBookingPage,
@@ -518,7 +523,13 @@ export default function Success(props: PageProps) {
if (!field) return null;
const isSystemField = SystemField.safeParse(field.name);
// SMS_REMINDER_NUMBER_FIELD is a system field but doesn't have a dedicated place in the UI. So, it would be shown through the following responses list
if (isSystemField.success && field.name !== SMS_REMINDER_NUMBER_FIELD) return null;
// TITLE is also an identifier for booking question "What is this meeting about?"
if (
isSystemField.success &&
field.name !== SMS_REMINDER_NUMBER_FIELD &&
field.name !== TITLE_FIELD
)
return null;
const label = field.label || t(field.defaultLabel || "");