diff --git a/apps/web/components/eventtype/EventSetupTab.tsx b/apps/web/components/eventtype/EventSetupTab.tsx index 9607f69e0b..82bfccede2 100644 --- a/apps/web/components/eventtype/EventSetupTab.tsx +++ b/apps/web/components/eventtype/EventSetupTab.tsx @@ -12,6 +12,7 @@ import { z } from "zod"; import type { EventLocationType } from "@calcom/app-store/locations"; import { getEventLocationType, MeetLocationType, LocationType } from "@calcom/app-store/locations"; import useLockedFieldsManager from "@calcom/features/ee/managed-event-types/hooks/useLockedFieldsManager"; +import { useOrgBranding } from "@calcom/features/ee/organizations/context/provider"; import cx from "@calcom/lib/classNames"; import { CAL_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -116,6 +117,7 @@ export const EventSetupTab = ( const [editingLocationType, setEditingLocationType] = useState(""); const [selectedLocation, setSelectedLocation] = useState(undefined); const [multipleDuration, setMultipleDuration] = useState(eventType.metadata?.multipleDuration); + const orgBranding = useOrgBranding(); const locationOptions = props.locationOptions.map((locationOption) => { const options = locationOption.options.filter((option) => { @@ -385,6 +387,9 @@ export const EventSetupTab = ( const lengthLockedProps = shouldLockDisableProps("length"); const descriptionLockedProps = shouldLockDisableProps("description"); + const urlPrefix = orgBranding + ? orgBranding?.fullDomain.replace(/^(https?:|)\/\//, "") + : `${CAL_URL?.replace(/^(https?:|)\/\//, "")}`; return (
@@ -413,10 +418,10 @@ export const EventSetupTab = ( defaultValue={eventType.slug} addOnLeading={ <> - {CAL_URL?.replace(/^(https?:|)\/\//, "")}/ + {urlPrefix}/ {!isManagedEventType ? team - ? "team/" + team.slug + ? (orgBranding ? "" : "team/") + team.slug : eventType.users[0].username : t("username_placeholder")} / diff --git a/apps/web/components/ui/UsernameAvailability/index.tsx b/apps/web/components/ui/UsernameAvailability/index.tsx index caee14bdef..4a66c40db4 100644 --- a/apps/web/components/ui/UsernameAvailability/index.tsx +++ b/apps/web/components/ui/UsernameAvailability/index.tsx @@ -65,7 +65,7 @@ export const UsernameAvailabilityField = ({ setInputUsernameValue={onChange} onSuccessMutation={onSuccessMutation} onErrorMutation={onErrorMutation} - addOnLeading={usernamePrefix} + addOnLeading={`${usernamePrefix}/`} /> ); }} diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index b3ef0ab472..8d1620ced6 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -737,7 +737,9 @@ const EventTypeListHeading = ({ )} {profile?.slug && ( - + {`${bookerUrl.replace("https://", "").replace("http://", "")}/${profile.slug}`} )} diff --git a/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx b/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx index d160b385de..7abc72fceb 100644 --- a/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx +++ b/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx @@ -57,7 +57,7 @@ export default function OtherTeamListItem(props: Props) { {team.slug ? orgBranding - ? `${orgBranding.fullDomain}${team.slug}` + ? `${orgBranding.fullDomain}/${team.slug}` : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team/${team.slug}` : "Unpublished team"} @@ -81,8 +81,8 @@ export default function OtherTeamListItem(props: Props) { `${ orgBranding ? `${orgBranding.fullDomain}` - : process.env.NEXT_PUBLIC_WEBSITE_URL + "/team/" - }${team.slug}` + : process.env.NEXT_PUBLIC_WEBSITE_URL + "/team" + }/${team.slug}` ); showToast(t("link_copied"), "success"); }} @@ -119,8 +119,8 @@ export default function OtherTeamListItem(props: Props) { href={`${ orgBranding ? `${orgBranding.fullDomain}` - : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team/other/` - }${team.slug}`} + : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team/other` + }/${team.slug}`} StartIcon={ExternalLink}> {t("preview_team") as string} diff --git a/packages/features/ee/teams/components/CreateANewTeamForm.tsx b/packages/features/ee/teams/components/CreateANewTeamForm.tsx index 1a766c1aea..ebe4e642b8 100644 --- a/packages/features/ee/teams/components/CreateANewTeamForm.tsx +++ b/packages/features/ee/teams/components/CreateANewTeamForm.tsx @@ -111,8 +111,9 @@ export const CreateANewTeamForm = () => { placeholder="acme" label={t("team_url")} addOnLeading={`${ - orgBranding?.fullDomain.replace("https://", "").replace("http://", "") ?? - `${extractDomainFromWebsiteUrl}/team/` + orgBranding + ? orgBranding.fullDomain.replace("https://", "").replace("http://", "") + "/" + : `${extractDomainFromWebsiteUrl}/team/` }`} defaultValue={value} onChange={(e) => { diff --git a/packages/features/ee/teams/components/TeamListItem.tsx b/packages/features/ee/teams/components/TeamListItem.tsx index 290795d69e..ddd5c550d6 100644 --- a/packages/features/ee/teams/components/TeamListItem.tsx +++ b/packages/features/ee/teams/components/TeamListItem.tsx @@ -103,7 +103,7 @@ export default function TeamListItem(props: Props) { {team.slug ? orgBranding - ? `${orgBranding.fullDomain}${team.slug}` + ? `${orgBranding.fullDomain}/${team.slug}` : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team/${team.slug}` : "Unpublished team"} @@ -238,8 +238,8 @@ export default function TeamListItem(props: Props) { `${ orgBranding ? `${orgBranding.fullDomain}` - : process.env.NEXT_PUBLIC_WEBSITE_URL + "/team/" - }${team.slug}` + : process.env.NEXT_PUBLIC_WEBSITE_URL + "/team" + }/${team.slug}` ); showToast(t("link_copied"), "success"); }} @@ -278,8 +278,8 @@ export default function TeamListItem(props: Props) { href={`${ orgBranding ? `${orgBranding.fullDomain}` - : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team/` - }${team.slug}`} + : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team` + }/${team.slug}`} StartIcon={ExternalLink}> {t("preview_team") as string} diff --git a/packages/features/ee/teams/pages/team-profile-view.tsx b/packages/features/ee/teams/pages/team-profile-view.tsx index f5fed28698..e86861a96f 100644 --- a/packages/features/ee/teams/pages/team-profile-view.tsx +++ b/packages/features/ee/teams/pages/team-profile-view.tsx @@ -227,7 +227,7 @@ const ProfileView = () => { value={value} addOnLeading={ team.parent && orgBranding - ? getOrgFullDomain(orgBranding?.slug, { protocol: false }) + ? getOrgFullDomain(orgBranding?.slug, { protocol: false }) + "/" : `${WEBAPP_URL}/team/` } onChange={(e) => { diff --git a/packages/trpc/server/routers/viewer/organizations/create.handler.ts b/packages/trpc/server/routers/viewer/organizations/create.handler.ts index 33ce4d555e..c2b9f9a5a2 100644 --- a/packages/trpc/server/routers/viewer/organizations/create.handler.ts +++ b/packages/trpc/server/routers/viewer/organizations/create.handler.ts @@ -29,7 +29,7 @@ type CreateOptions = { const vercelCreateDomain = async (domain: string) => { const response = await fetch( - `https://api.vercel.com/v8/projects/${process.env.PROJECT_ID_VERCEL}/domains?teamId=${process.env.TEAM_ID_VERCEL}`, + `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains?teamId=${process.env.TEAM_ID_VERCEL}`, { body: JSON.stringify({ name: `${domain}.${subdomainSuffix()}` }), headers: {