fix: display provider name instead of url (#6914)

Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
pull/6944/head
Udit Takkar 2023-02-08 18:15:09 +05:30 committed by GitHub
parent 51fd7fdb3e
commit 7a28e1d6f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 4 deletions

View File

@ -11,7 +11,11 @@ import { RRule } from "rrule";
import { z } from "zod"; import { z } from "zod";
import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager"; import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager";
import { getEventLocationValue, getSuccessPageLocationMessage } from "@calcom/app-store/locations"; import {
getEventLocationValue,
getSuccessPageLocationMessage,
guessEventLocationType,
} from "@calcom/app-store/locations";
import { getEventTypeAppData } from "@calcom/app-store/utils"; import { getEventTypeAppData } from "@calcom/app-store/utils";
import { getEventName } from "@calcom/core/event"; import { getEventName } from "@calcom/core/event";
import dayjs, { ConfigType } from "@calcom/dayjs"; import dayjs, { ConfigType } from "@calcom/dayjs";
@ -37,7 +41,7 @@ import { Prisma } from "@calcom/prisma/client";
import { bookingMetadataSchema } from "@calcom/prisma/zod-utils"; import { bookingMetadataSchema } from "@calcom/prisma/zod-utils";
import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils"; import { customInputSchema, EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
import { Button, EmailInput, HeadSeo } from "@calcom/ui"; import { Button, EmailInput, HeadSeo } from "@calcom/ui";
import { FiX, FiChevronLeft, FiCheck, FiCalendar } from "@calcom/ui/components/icon"; import { FiX, FiExternalLink, FiChevronLeft, FiCheck, FiCalendar } from "@calcom/ui/components/icon";
import { timeZone } from "@lib/clock"; import { timeZone } from "@lib/clock";
import { inferSSRProps } from "@lib/types/inferSSRProps"; import { inferSSRProps } from "@lib/types/inferSSRProps";
@ -346,6 +350,7 @@ export default function Success(props: SuccessProps) {
eventType.workflows.find((workflowEventType) => eventType.workflows.find((workflowEventType) =>
workflowEventType.workflow.steps.find((step) => step.action === WorkflowActions.SMS_ATTENDEE) workflowEventType.workflow.steps.find((step) => step.action === WorkflowActions.SMS_ATTENDEE)
) !== undefined; ) !== undefined;
const providerName = guessEventLocationType(location)?.label;
return ( return (
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page"> <div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
@ -498,8 +503,14 @@ export default function Success(props: SuccessProps) {
<div className="mt-3 font-medium">{t("where")}</div> <div className="mt-3 font-medium">{t("where")}</div>
<div className="col-span-2 mt-3"> <div className="col-span-2 mt-3">
{locationToDisplay.startsWith("http") ? ( {locationToDisplay.startsWith("http") ? (
<a title="Meeting Link" href={locationToDisplay}> <a
{locationToDisplay} href={locationToDisplay}
target="_blank"
title={locationToDisplay}
className="flex items-center gap-2 text-gray-700 underline dark:text-gray-50"
rel="noreferrer">
{providerName || "Link"}
<FiExternalLink className="inline h-4 w-4 text-gray-700 dark:text-white" />
</a> </a>
) : ( ) : (
locationToDisplay locationToDisplay