Adds LicenseRequired (#9883)

Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
sean-brydon
2023-07-04 22:12:51 +00:00
committed by GitHub
co-authored by Alex van Andel
parent c3b2a52815
commit ea20fa9f35
5 changed files with 21 additions and 9 deletions
@@ -1,3 +1,4 @@
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import { CreateANewOrganizationForm } from "@calcom/features/ee/organizations/components";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { WizardLayout, Meta } from "@calcom/ui";
@@ -7,10 +8,10 @@ import PageWrapper from "@components/PageWrapper";
const CreateNewOrganizationPage = () => {
const { t } = useLocale();
return (
<>
<LicenseRequired>
<Meta title={t("set_up_your_organization")} description={t("organizations_description")} />
<CreateANewOrganizationForm />
</>
</LicenseRequired>
);
};
const LayoutWrapper = (page: React.ReactElement) => {
@@ -1,6 +1,8 @@
import { useRouter } from "next/router";
import { Controller, useForm } from "react-hook-form";
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { MembershipRole } from "@calcom/prisma/enums";
import { trpc } from "@calcom/trpc/react";
@@ -87,7 +89,7 @@ const OrgAppearanceView = () => {
return <SkeletonLoader title={t("booking_appearance")} description={t("appearance_team_description")} />;
}
return (
<>
<LicenseRequired>
<Meta title={t("booking_appearance")} description={t("appearance_team_description")} />
{isAdmin ? (
<Form
@@ -177,7 +179,7 @@ const OrgAppearanceView = () => {
<span className="text-default text-sm">{t("only_owner_change")}</span>
</div>
)}
</>
</LicenseRequired>
);
};
@@ -1,6 +1,7 @@
import { useRouter } from "next/router";
import { Controller, useForm } from "react-hook-form";
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { nameOfDay } from "@calcom/lib/weekday";
@@ -61,7 +62,13 @@ const OrgGeneralView = () => {
currentOrg.user.role === MembershipRole.OWNER || currentOrg.user.role === MembershipRole.ADMIN;
return (
<GeneralView currentOrg={currentOrg} isAdminOrOwner={isAdminOrOwner} localeProp={user?.locale ?? "en"} />
<LicenseRequired>
<GeneralView
currentOrg={currentOrg}
isAdminOrOwner={isAdminOrOwner}
localeProp={user?.locale ?? "en"}
/>
</LicenseRequired>
);
};
@@ -1,6 +1,7 @@
import { useRouter } from "next/router";
import { useState } from "react";
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import MemberInvitationModal from "@calcom/features/ee/teams/components/MemberInvitationModal";
import MemberListItem from "@calcom/features/ee/teams/components/MemberListItem";
import TeamInviteList from "@calcom/features/ee/teams/components/TeamInviteList";
@@ -103,7 +104,7 @@ const MembersView = () => {
team && (team.membership.role === MembershipRole.OWNER || team.membership.role === MembershipRole.ADMIN);
return (
<>
<LicenseRequired>
<Meta
title={t("organization_members")}
description={t("organization_description")}
@@ -166,7 +167,7 @@ const MembersView = () => {
)}
</>
)}
</>
</LicenseRequired>
);
};
MembersView.getLayout = getLayout;
@@ -6,6 +6,7 @@ import { useState, useLayoutEffect } from "react";
import { Controller, useForm } from "react-hook-form";
import { z } from "zod";
import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired";
import { useOrgBrandingValues } from "@calcom/features/ee/organizations/hooks";
import { subdomainSuffix } from "@calcom/features/ee/organizations/lib/orgDomains";
import { WEBAPP_URL } from "@calcom/lib/constants";
@@ -106,7 +107,7 @@ const OrgProfileView = () => {
}
return (
<>
<LicenseRequired>
<Meta title={t("profile")} description={t("profile_org_description")} />
{!isLoading && (
<>
@@ -246,7 +247,7 @@ const OrgProfileView = () => {
{/* LEAVE ORG should go above here ^ */}
</>
)}
</>
</LicenseRequired>
);
};