chore: disable dashboard for creating new platform accounts (#27052)
* chore: disable dashboard for creating new platform accounts * chore: remove page altogether
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
import { _generateMetadata } from "app/_utils";
|
||||
import { cookies, headers } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
||||
import LicenseRequired from "~/ee/common/components/LicenseRequired";
|
||||
import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
|
||||
import { buildLegacyRequest } from "@lib/buildLegacyCtx";
|
||||
|
||||
import LegacyPage, { LayoutWrapper } from "~/settings/platform/new/create-new-view";
|
||||
|
||||
export const generateMetadata = async () =>
|
||||
await _generateMetadata(
|
||||
(t) => t("set_up_your_platform_organization"),
|
||||
(t) => t("platform_organization_description"),
|
||||
undefined,
|
||||
undefined,
|
||||
"/settings/platform/new"
|
||||
);
|
||||
|
||||
const ServerPage = async () => {
|
||||
const session = await getServerSession({ req: buildLegacyRequest(await headers(), await cookies()) });
|
||||
const callbackUrl = `${WEBAPP_URL}/settings/platform/new`;
|
||||
|
||||
if (!session?.user) {
|
||||
redirect(`/login?callbackUrl=${callbackUrl}`);
|
||||
}
|
||||
|
||||
return (
|
||||
<LayoutWrapper>
|
||||
<LicenseRequired>
|
||||
<LegacyPage />
|
||||
</LicenseRequired>
|
||||
</LayoutWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
export default ServerPage;
|
||||
@@ -1,30 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { CreateANewPlatformForm } from "~/ee/platform/components/CreateANewPlatformForm";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Alert } from "@calcom/ui/components/alert";
|
||||
import { WizardLayout } from "@calcom/ui/components/layout";
|
||||
import { useGetUserAttributes } from "@calcom/web/components/settings/platform/hooks/useGetUserAttributes";
|
||||
|
||||
export const LayoutWrapper = ({ children }: { children: React.ReactNode }) => {
|
||||
const { t } = useLocale();
|
||||
const { isPlatformUser, userOrgId } = useGetUserAttributes();
|
||||
|
||||
if (!isPlatformUser && userOrgId) {
|
||||
return (
|
||||
<div className="flex h-full min-h-screen items-center justify-center">
|
||||
<div className="max-w-lg">
|
||||
<Alert severity="warning" title={t("organization_customer_cant_create_platform")} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WizardLayout currentStep={1} maxSteps={1}>
|
||||
{children}
|
||||
</WizardLayout>
|
||||
);
|
||||
};
|
||||
|
||||
export default CreateANewPlatformForm;
|
||||
Reference in New Issue
Block a user