Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT-2289 chore: Migrate /settings/security pages #142

Closed
wants to merge 8 commits into from
11 changes: 11 additions & 0 deletions apps/web/app/_types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
export type Params = {
[param: string]: string | string[] | undefined;
};

export type SearchParams = {
[param: string]: string | string[] | undefined;
};

export type PageProps = {
params: Params;
searchParams: SearchParams;
};

export type LayoutProps = { params: Params; children: React.ReactElement };

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions apps/web/app/future/(shared-page-wrapper)/(layout)/layout.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions apps/web/app/future/(shared-page-wrapper)/(no-layout)/layout.tsx

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions apps/web/app/future/apps/[slug]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { WithLayout } from "app/layoutHOC";

export default WithLayout({ getLayout: null })<"L">;
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import CategoryPage from "@pages/apps/categories/[category]";
import { Prisma } from "@prisma/client";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { notFound } from "next/navigation";
import z from "zod";

Expand All @@ -9,8 +10,6 @@ import { APP_NAME } from "@calcom/lib/constants";
import prisma from "@calcom/prisma";
import { AppCategories } from "@calcom/prisma/enums";

import PageWrapper from "@components/PageWrapperAppDir";

export const generateMetadata = async () => {
return await _generateMetadata(
() => `${APP_NAME} | ${APP_NAME}`,
Expand Down Expand Up @@ -67,13 +66,6 @@ const getPageProps = async ({ params }: { params: Record<string, string | string
};
};

export default async function Page({ params }: { params: Record<string, string | string[]> }) {
const { apps } = await getPageProps({ params });
return (
<PageWrapper getLayout={null} requiresLicense={false} nonce={undefined} themeBasis={null}>
<CategoryPage apps={apps} />
</PageWrapper>
);
}

// @ts-expect-error getData arg
export default WithLayout({ getData: getPageProps, Page: CategoryPage })<P>;
export const dynamic = "force-static";
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import LegacyPage from "@pages/apps/categories/index";
import { ssrInit } from "app/_trpc/ssrInit";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { cookies, headers } from "next/headers";

import { getAppRegistry, getAppRegistryWithCredentials } from "@calcom/app-store/_appRegistry";
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
import { APP_NAME } from "@calcom/lib/constants";

import PageWrapper from "@components/PageWrapperAppDir";

export const generateMetadata = async () => {
return await _generateMetadata(
() => `Categories | ${APP_NAME}`,
Expand Down Expand Up @@ -43,14 +42,4 @@ async function getPageProps() {
};
}

export default async function Page() {
const props = await getPageProps();
const h = headers();
const nonce = h.get("x-nonce") ?? undefined;

return (
<PageWrapper getLayout={null} requiresLicense={false} nonce={nonce} themeBasis={null} {...props}>
<LegacyPage {...props} />
</PageWrapper>
);
}
export default WithLayout({ getData: getPageProps, Page: LegacyPage, getLayout: null })<"P">;
3 changes: 3 additions & 0 deletions apps/web/app/future/apps/installed/[category]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { WithLayout } from "app/layoutHOC";

export default WithLayout({ getLayout: null })<"L">;
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { ssgInit } from "app/_trpc/ssgInit";
import type { Params } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { notFound } from "next/navigation";
import type { ReactElement } from "react";
import { z } from "zod";

import { getLayout } from "@calcom/features/MainLayoutAppDir";
import { APP_NAME } from "@calcom/lib/constants";

import PageWrapper from "@components/PageWrapperAppDir";

const validStatuses = ["upcoming", "recurring", "past", "cancelled", "unconfirmed"] as const;

const querySchema = z.object({
Expand Down Expand Up @@ -43,14 +42,6 @@ const getData = async ({ params }: { params: Params }) => {
};
};

export default async function BookingPageLayout({ params, children }: Props) {
const props = await getData({ params });

return (
<PageWrapper requiresLicense={false} getLayout={getLayout} nonce={undefined} themeBasis={null} {...props}>
{children}
</PageWrapper>
);
}
export default WithLayout({ getLayout, getData })<"L">;

export const dynamic = "force-static";
5 changes: 5 additions & 0 deletions apps/web/app/future/event-types/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/MainLayoutAppDir";

export default WithLayout({ getLayout })<"L">;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/admin/apps/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@components/auth/layouts/AdminLayoutAppDir";

export default WithLayout({ getLayout })<"L">;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/admin/flags/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@components/auth/layouts/AdminLayoutAppDir";

export default WithLayout({ getLayout })<"L">;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/admin/impersonation/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@components/auth/layouts/AdminLayoutAppDir";

export default WithLayout({ getLayout })<"L">;
3 changes: 3 additions & 0 deletions apps/web/app/future/settings/admin/oAuth/oAuthView/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { WithLayout } from "app/layoutHOC";

export default WithLayout({ getLayout: null })<"L">;
13 changes: 13 additions & 0 deletions apps/web/app/future/settings/admin/oAuth/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import LegacyPage from "@pages/settings/admin/oAuth/index";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@components/auth/layouts/AdminLayoutAppDir";

export const generateMetadata = async () =>
await _generateMetadata(
() => "OAuth",
() => "Add new OAuth Clients"
);

export default WithLayout({ getLayout, Page: LegacyPage })<"P">;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/admin/organizations/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/settings/layouts/SettingsLayoutAppDir";

export default WithLayout({ getLayout })<"L">;
13 changes: 13 additions & 0 deletions apps/web/app/future/settings/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import LegacyPage from "@pages/settings/admin/index";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@components/auth/layouts/AdminLayoutAppDir";

export const generateMetadata = async () =>
await _generateMetadata(
() => "Admin",
() => "admin_description"
);

export default WithLayout({ getLayout, Page: LegacyPage })<"P">;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/admin/users/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/settings/layouts/SettingsLayoutAppDir";

export default WithLayout({ getLayout })<"L">;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/settings/layouts/SettingsLayoutAppDir";

export default WithLayout({ getLayout });
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Page from "@pages/settings/admin/oAuth/index";
import Page from "@pages/settings/security/impersonation";
import { _generateMetadata } from "app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
() => "OAuth",
() => "Add new OAuth Clients"
(t) => t("impersonation"),
(t) => t("impersonation_description")
);

export default Page;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/security/password/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/settings/layouts/SettingsLayoutAppDir";

export default WithLayout({ getLayout });
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Page from "@pages/video/no-meeting-found";
import Page from "@pages/settings/security/password";
import { _generateMetadata } from "app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
() => "",
() => ""
(t) => t("password"),
(t) => t("password_description")
);

export default Page;
5 changes: 5 additions & 0 deletions apps/web/app/future/settings/security/sso/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/settings/layouts/SettingsLayoutAppDir";

export default WithLayout({ getLayout });
11 changes: 11 additions & 0 deletions apps/web/app/future/settings/security/sso/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { _generateMetadata } from "app/_utils";

import Page from "@calcom/features/ee/sso/page/user-sso-view";

export const generateMetadata = async () =>
await _generateMetadata(
(t) => t("sso_configuration"),
(t) => t("sso_configuration_description")
);

export default Page;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { WithLayout } from "app/layoutHOC";

import { getLayout } from "@calcom/features/settings/layouts/SettingsLayoutAppDir";

export default WithLayout({ getLayout });
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Page from "@pages/settings/admin/index";
import Page from "@pages/settings/security/two-factor-auth";
import { _generateMetadata } from "app/_utils";

export const generateMetadata = async () =>
await _generateMetadata(
() => "Admin",
() => "admin_description"
(t) => t("two_factor_auth"),
(t) => t("add_an_extra_layer_of_security")
);

export default Page;
Loading
Loading