diff --git a/apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx b/apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx new file mode 100644 index 0000000000..822e2d87d0 --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/attributes/[id]/edit/page.tsx @@ -0,0 +1,11 @@ +import { _generateMetadata } from "app/_utils"; + +import Page from "@calcom/ee/organizations/pages/settings/attributes/attributes-edit-view"; + +export const generateMetadata = async () => + await _generateMetadata( + () => "Attribute", + (t) => t("edit_attribute_description") + ); + +export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx b/apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx new file mode 100644 index 0000000000..9319101bce --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/attributes/create/page.tsx @@ -0,0 +1,11 @@ +import { _generateMetadata } from "app/_utils"; + +import Page from "@calcom/ee/organizations/pages/settings/attributes/attributes-create-view"; + +export const generateMetadata = async () => + await _generateMetadata( + () => "Attribute", + () => "Create an attribute for your team members" + ); + +export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx b/apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx new file mode 100644 index 0000000000..2901ca463d --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/attributes/page.tsx @@ -0,0 +1,11 @@ +import { _generateMetadata } from "app/_utils"; + +import Page from "@calcom/ee/organizations/pages/settings/attributes/attributes-list-view"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("attributes"), + (t) => t("attribute_meta_description") + ); + +export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/dsync/page.tsx b/apps/web/app/future/settings/(settings)/organizations/dsync/page.tsx new file mode 100644 index 0000000000..78a01b931a --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/dsync/page.tsx @@ -0,0 +1,25 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; +import { getServerSession } from "next-auth"; + +import { AUTH_OPTIONS } from "@calcom/features/auth/lib/next-auth-options"; +import DirectorySyncTeamView from "@calcom/features/ee/dsync/page/team-dsync-view"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("directory_sync"), + (t) => t("directory_sync_description") + ); + +const Page = async () => { + const session = await getServerSession(AUTH_OPTIONS); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + +export default Page; diff --git a/apps/web/app/future/settings/(settings)/organizations/privacy/page.tsx b/apps/web/app/future/settings/(settings)/organizations/privacy/page.tsx new file mode 100644 index 0000000000..bf9ade6a03 --- /dev/null +++ b/apps/web/app/future/settings/(settings)/organizations/privacy/page.tsx @@ -0,0 +1,25 @@ +import { _generateMetadata, getFixedT } from "app/_utils"; +import { getServerSession } from "next-auth"; + +import { AUTH_OPTIONS } from "@calcom/features/auth/lib/next-auth-options"; +import PrivacyView from "@calcom/features/ee/organizations/pages/settings/privacy"; +import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("privacy"), + (t) => t("privacy_organization_description") + ); + +const Page = async () => { + const session = await getServerSession(AUTH_OPTIONS); + const t = await getFixedT(session?.user.locale || "en"); + + return ( + + + + ); +}; + +export default Page; diff --git a/apps/web/app/future/settings/license-key/new/page.tsx b/apps/web/app/future/settings/license-key/new/page.tsx new file mode 100644 index 0000000000..d6e6e58344 --- /dev/null +++ b/apps/web/app/future/settings/license-key/new/page.tsx @@ -0,0 +1,21 @@ +import { withAppDirSsr } from "app/WithAppDirSsr"; +import { _generateMetadata } from "app/_utils"; +import { WithLayout } from "app/layoutHOC"; + +import type { inferSSRProps } from "@calcom/types/inferSSRProps"; + +import { getServerSideProps } from "@lib/settings/license-key/new/getServerSideProps"; + +import CreateANewLicenseKeyForm, { LayoutWrapper } from "~/settings/license-key/new/new-view"; + +export const generateMetadata = async () => + await _generateMetadata( + (t) => t("set_up_your_organization"), + (t) => t("organizations_description") + ); + +export default WithLayout({ + Page: CreateANewLicenseKeyForm, + getLayout: LayoutWrapper, + getData: withAppDirSsr>(getServerSideProps), +}); diff --git a/apps/web/lib/settings/license-keys/new/getServerSideProps.tsx b/apps/web/lib/settings/license-key/new/getServerSideProps.tsx similarity index 96% rename from apps/web/lib/settings/license-keys/new/getServerSideProps.tsx rename to apps/web/lib/settings/license-key/new/getServerSideProps.tsx index 600c2ece01..31e018e8e4 100644 --- a/apps/web/lib/settings/license-keys/new/getServerSideProps.tsx +++ b/apps/web/lib/settings/license-key/new/getServerSideProps.tsx @@ -6,7 +6,6 @@ import { AUTH_OPTIONS } from "@calcom/feature-auth/lib/next-auth-options"; export const getServerSideProps = async (context: GetServerSidePropsContext) => { const session = await getServerSession({ req: context.req, - res: context.res, authOptions: AUTH_OPTIONS, }); // Disable this check if we ever make this self serve. diff --git a/apps/web/modules/settings/license-key/new/new-view.tsx b/apps/web/modules/settings/license-key/new/new-view.tsx new file mode 100644 index 0000000000..a8996ee5f9 --- /dev/null +++ b/apps/web/modules/settings/license-key/new/new-view.tsx @@ -0,0 +1,14 @@ +"use client"; + +import { CreateANewLicenseKeyForm } from "@calcom/features/ee/deployment/licensekey/CreateLicenseKeyForm"; +import { WizardLayout } from "@calcom/ui"; + +export const LayoutWrapper = (page: React.ReactElement) => { + return ( + + {page} + + ); +}; + +export default CreateANewLicenseKeyForm; diff --git a/apps/web/pages/settings/license-key/new/index.tsx b/apps/web/pages/settings/license-key/new/index.tsx index c51edfde8e..c607a3709e 100644 --- a/apps/web/pages/settings/license-key/new/index.tsx +++ b/apps/web/pages/settings/license-key/new/index.tsx @@ -1,13 +1,14 @@ "use client"; -import { CreateANewLicenseKeyForm } from "@calcom/features/ee/deployment/licensekey/CreateLicenseKeyForm"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { WizardLayout, Meta } from "@calcom/ui"; +import { Meta } from "@calcom/ui"; -import { getServerSideProps } from "@lib/settings/license-keys/new/getServerSideProps"; +import { getServerSideProps } from "@lib/settings/license-key/new/getServerSideProps"; import PageWrapper from "@components/PageWrapper"; +import CreateANewLicenseKeyForm, { LayoutWrapper } from "~/settings/license-key/new/new-view"; + const CreateNewLicenseKeyPage = () => { const { t } = useLocale(); return ( @@ -17,13 +18,6 @@ const CreateNewLicenseKeyPage = () => { ); }; -const LayoutWrapper = (page: React.ReactElement) => { - return ( - - {page} - - ); -}; CreateNewLicenseKeyPage.getLayout = LayoutWrapper; CreateNewLicenseKeyPage.PageWrapper = PageWrapper; diff --git a/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx b/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx index b38c5d9b5d..e711750d38 100644 --- a/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx +++ b/apps/web/pages/settings/organizations/attributes/[id]/edit.tsx @@ -1,9 +1,24 @@ -import OrgAttributesEditPage from "@calcom/ee/organizations/pages/settings/attributes/attributes-edit-view"; +"use client"; + +import OrgAttributesEditPage, { + getLayout, +} from "@calcom/ee/organizations/pages/settings/attributes/attributes-edit-view"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { Meta } from "@calcom/ui"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OrgAttributesEditPage as CalPageWrapper; +const Page = () => { + const { t } = useLocale(); + return ( + <> + + + + ); +}; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/attributes/create.tsx b/apps/web/pages/settings/organizations/attributes/create.tsx index 1283513416..81c0b089e8 100644 --- a/apps/web/pages/settings/organizations/attributes/create.tsx +++ b/apps/web/pages/settings/organizations/attributes/create.tsx @@ -1,9 +1,20 @@ -import OrgAttributesCreatePage from "@calcom/ee/organizations/pages/settings/attributes/attributes-create-view"; +import OrgAttributesCreatePage, { + getLayout, +} from "@calcom/ee/organizations/pages/settings/attributes/attributes-create-view"; +import { Meta } from "@calcom/ui"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OrgAttributesCreatePage as CalPageWrapper; +const Page = () => { + return ( + <> + + + + ); +}; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/attributes/index.tsx b/apps/web/pages/settings/organizations/attributes/index.tsx index 31b59ee34a..318a0d8f53 100644 --- a/apps/web/pages/settings/organizations/attributes/index.tsx +++ b/apps/web/pages/settings/organizations/attributes/index.tsx @@ -1,9 +1,21 @@ -import OrgSettingsAttributesPage from "@calcom/ee/organizations/pages/settings/attributes/attributes-list-view"; +import OrgSettingsAttributesPage, { + getLayout, +} from "@calcom/ee/organizations/pages/settings/attributes/attributes-list-view"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { Meta } from "@calcom/ui"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = OrgSettingsAttributesPage as CalPageWrapper; +const Page = () => { + const { t } = useLocale(); + return ( + <> + + + + ); +}; +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/dsync.tsx b/apps/web/pages/settings/organizations/dsync.tsx index ed9546b190..bb5a427d01 100644 --- a/apps/web/pages/settings/organizations/dsync.tsx +++ b/apps/web/pages/settings/organizations/dsync.tsx @@ -1,9 +1,22 @@ -import DirectorySyncTeamView from "@calcom/features/ee/dsync/page/team-dsync-view"; +"use client"; + +import DirectorySyncTeamView from "@calcom/features/ee/dsync/page/team-dsync-view"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { Meta } from "@calcom/ui"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = DirectorySyncTeamView as CalPageWrapper; +const Page = () => { + const { t } = useLocale(); + return ( + <> + + + + ); +}; +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/apps/web/pages/settings/organizations/privacy.tsx b/apps/web/pages/settings/organizations/privacy.tsx index a6dcde04d6..7f4a8c06f4 100644 --- a/apps/web/pages/settings/organizations/privacy.tsx +++ b/apps/web/pages/settings/organizations/privacy.tsx @@ -1,9 +1,27 @@ -import PrivacyView from "@calcom/features/ee/organizations/pages/settings/privacy"; +"use client"; + +import PrivacyView from "@calcom/features/ee/organizations/pages/settings/privacy"; +import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; +import { useLocale } from "@calcom/lib/hooks/useLocale"; +import { Meta } from "@calcom/ui"; -import type { CalPageWrapper } from "@components/PageWrapper"; import PageWrapper from "@components/PageWrapper"; -const Page = PrivacyView as CalPageWrapper; +const Page = () => { + const { t } = useLocale(); + return ( + <> + + + + ); +}; + +Page.getLayout = getLayout; Page.PageWrapper = PageWrapper; export default Page; diff --git a/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx b/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx index fb0edd2e31..f0dd0ea77c 100644 --- a/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx +++ b/packages/features/ee/deployment/licensekey/CreateLicenseKeyForm.tsx @@ -1,3 +1,5 @@ +"use client"; + import type { SessionContextValue } from "next-auth/react"; import { useSession } from "next-auth/react"; import { useState } from "react"; diff --git a/packages/features/ee/dsync/page/team-dsync-view.tsx b/packages/features/ee/dsync/page/team-dsync-view.tsx index 912bc9f6c0..41b14cb54b 100644 --- a/packages/features/ee/dsync/page/team-dsync-view.tsx +++ b/packages/features/ee/dsync/page/team-dsync-view.tsx @@ -1,12 +1,13 @@ +"use client"; + import { useRouter } from "next/navigation"; import { useEffect } from "react"; import { HOSTED_CAL_FEATURES } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Meta, SkeletonLoader, showToast } from "@calcom/ui"; +import { SkeletonLoader, showToast } from "@calcom/ui"; -import { getLayout } from "../../../settings/layouts/SettingsLayout"; import ConfigureDirectorySync from "../components/ConfigureDirectorySync"; // For Hosted Cal - Team view @@ -36,7 +37,6 @@ const DirectorySync = () => { return (
- {HOSTED_CAL_FEATURES && } {/* TODO add additional settings for dsync */} {/* { ); }; -DirectorySync.getLayout = getLayout; - export default DirectorySync; diff --git a/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx b/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx index 32194a3fda..3c5da89117 100644 --- a/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx +++ b/packages/features/ee/organizations/pages/settings/attributes/attributes-create-view.tsx @@ -9,7 +9,7 @@ import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequir import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Meta, Button, useMeta, showToast } from "@calcom/ui"; +import { Button, useMeta, showToast } from "@calcom/ui"; import { AttributeForm } from "./AttributesForm"; @@ -38,7 +38,6 @@ function CreateAttributesPage() { return ( <> - } onSubmit={(values) => { @@ -75,7 +74,7 @@ function CreateAttributeHeader(props: { isPending: boolean }) { {t("back_to_attributes")}
-

{meta.title}

+

{meta.title || "Attribute"}

{watchedTitle && ( <> / {watchedTitle} @@ -90,10 +89,8 @@ function CreateAttributeHeader(props: { isPending: boolean }) { ); } -function getLayout(page: React.ReactElement) { +export function getLayout(page: React.ReactElement) { return {page}; } -CreateAttributesPage.getLayout = getLayout; - export default CreateAttributesPage; diff --git a/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx b/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx index b604444bba..2550b8a6f6 100644 --- a/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx +++ b/packages/features/ee/organizations/pages/settings/attributes/attributes-edit-view.tsx @@ -9,7 +9,7 @@ import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequir import SettingsLayout from "@calcom/features/settings/layouts/SettingsLayout"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; -import { Meta, Button, useMeta, showToast } from "@calcom/ui"; +import { Button, useMeta, showToast } from "@calcom/ui"; import { AttributeForm } from "./AttributesForm"; @@ -49,7 +49,6 @@ function CreateAttributesPage() { return ( <> - {!attribute.isLoading && attribute.data ? ( {t("back_to_attributes")}
-

{meta.title}

+

{meta.title || "Attribute"}

{watchedTitle && ( <> / {watchedTitle} @@ -110,10 +109,8 @@ function EditAttributeHeader(props: { isPending: boolean }) { ); } -function getLayout(page: React.ReactElement) { +export function getLayout(page: React.ReactElement) { return {page}; } -CreateAttributesPage.getLayout = getLayout; - export default CreateAttributesPage; diff --git a/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx b/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx index 60c401c006..9a33952a86 100644 --- a/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx +++ b/packages/features/ee/organizations/pages/settings/attributes/attributes-list-view.tsx @@ -8,7 +8,6 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import type { RouterOutputs } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react"; import { - Meta, Switch, Dropdown, Button, @@ -132,7 +131,6 @@ function OrganizationAttributesPage() { if (isLoading) { return ( <> -
@@ -142,7 +140,6 @@ function OrganizationAttributesPage() { return ( <> -
@@ -191,14 +188,17 @@ function OrganizationAttributesPage() { function ListAttributeHeader() { const { meta } = useMeta(); + const { t } = useLocale(); return ( <>
-

{meta.title}

-

{meta.description}

+

+ {meta.title || t("attributes")} +

+

{meta.description || t("attribute_meta_description")}

@@ -206,10 +206,8 @@ function ListAttributeHeader() { ); } -function getLayout(page: React.ReactElement) { +export function getLayout(page: React.ReactElement) { return {page}; } -OrganizationAttributesPage.getLayout = getLayout; - export default OrganizationAttributesPage; diff --git a/packages/features/ee/organizations/pages/settings/privacy.tsx b/packages/features/ee/organizations/pages/settings/privacy.tsx index f68da3ab91..8823bf8c77 100644 --- a/packages/features/ee/organizations/pages/settings/privacy.tsx +++ b/packages/features/ee/organizations/pages/settings/privacy.tsx @@ -2,14 +2,10 @@ import LicenseRequired from "@calcom/features/ee/common/components/LicenseRequired"; import MakeTeamPrivateSwitch from "@calcom/features/ee/teams/components/MakeTeamPrivateSwitch"; -import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout"; -import { useLocale } from "@calcom/lib/hooks/useLocale"; import { MembershipRole } from "@calcom/prisma/enums"; import { trpc } from "@calcom/trpc/react"; -import { Meta } from "@calcom/ui"; const PrivacyView = () => { - const { t } = useLocale(); const { data: currentOrg } = trpc.viewer.organizations.listCurrent.useQuery(); const isOrgAdminOrOwner = currentOrg && @@ -22,11 +18,6 @@ const PrivacyView = () => { return ( -
{ ); }; -PrivacyView.getLayout = getLayout; export default PrivacyView; diff --git a/packages/features/settings/layouts/SettingsLayout.tsx b/packages/features/settings/layouts/SettingsLayout.tsx index 36bb7f3e44..2c73ff3f41 100644 --- a/packages/features/settings/layouts/SettingsLayout.tsx +++ b/packages/features/settings/layouts/SettingsLayout.tsx @@ -648,14 +648,12 @@ const MobileSettingsContainer = (props: { onSideContainerOpen?: () => void }) => ); }; -export default function SettingsLayout({ - children, - hideHeader, - ...rest -}: { +export type SettingsLayoutProps = { children: React.ReactNode; hideHeader?: boolean; -} & ComponentProps) { +} & ComponentProps; + +export default function SettingsLayout({ children, hideHeader, ...rest }: SettingsLayoutProps) { const pathname = usePathname(); const state = useState(false); const { t } = useLocale();