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

chore: settings/platform - remove pages router and use app router #16790

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ APP_ROUTER_EVENT_TYPES_ENABLED=0
APP_ROUTER_SETTINGS_DEVELOPER_ENABLED=0
APP_ROUTER_SETTINGS_SECURITY_ENABLED=0
APP_ROUTER_SETTINGS_ADMIN_ENABLED=0
APP_ROUTER_SETTINGS_PLATFORM_ENABLED=0
APP_ROUTER_SETTINGS_ORG_ENABLED=0
APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED=0
APP_ROUTER_APPS_SLUG_ENABLED=0
Expand Down
1 change: 0 additions & 1 deletion apps/web/abTest/middlewareFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const ROUTES: [URLPattern, boolean][] = [
["/settings/developer/:path*", process.env.APP_ROUTER_SETTINGS_DEVELOPER_ENABLED === "1"] as const,
["/settings/security/:path*", process.env.APP_ROUTER_SETTINGS_SECURITY_ENABLED === "1"] as const,
["/settings/admin/:path*", process.env.APP_ROUTER_SETTINGS_ADMIN_ENABLED === "1"] as const,
["/settings/platform/:path*", process.env.APP_ROUTER_SETTINGS_PLATFORM_ENABLED === "1"] as const,
["/settings/organizations/:path*", process.env.APP_ROUTER_SETTINGS_ORG_ENABLED === "1"] as const,
["/apps/installed/:category", process.env.APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED === "1"] as const,
["/apps/:slug", process.env.APP_ROUTER_APPS_SLUG_ENABLED === "1"] as const,
Expand Down
21 changes: 21 additions & 0 deletions apps/web/app/settings/platform/new/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import { getServerSideProps } from "@lib/settings/organizations/new/getServerSideProps";
import { type inferSSRProps } from "@lib/types/inferSSRProps";

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")
);

export default WithLayout({
getLayout: LayoutWrapper,
Page: LegacyPage,
getData: withAppDirSsr<inferSSRProps<typeof getServerSideProps>>(getServerSideProps),
requiresLicense: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import EditView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-view";

export const generateMetadata = async () =>
await _generateMetadata(
() => "OAuth client updation form",
() => ""
);

export default WithLayout({
getLayout: null,
Page: EditView,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import EditWebhooksView from "~/settings/platform/oauth-clients/[clientId]/edit/edit-webhooks-view";

export const generateMetadata = async () =>
await _generateMetadata(
() => "OAuth client updation form",
() => ""
);

export default WithLayout({
getLayout: null,
Page: EditWebhooksView,
});
19 changes: 19 additions & 0 deletions apps/web/app/settings/platform/oauth-clients/create/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { PageProps } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import CreateNewView from "~/settings/platform/oauth-clients/create-new-view";

export const generateMetadata = async ({ params, searchParams }: PageProps) => {
const p = { ...params, ...searchParams };
const clientId = p?.clientId ?? "";
return await _generateMetadata(
() => `OAuth client ${!!clientId ? "updation" : "creation"} form`,
() => ""
);
};

export default WithLayout({
getLayout: null,
Page: CreateNewView,
});
16 changes: 16 additions & 0 deletions apps/web/app/settings/platform/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";

import PlatformView from "~/settings/platform/platform-view";

export const generateMetadata = async () => {
return await _generateMetadata(
() => "Platform",
() => "Manage everything related to platform."
);
};

export default WithLayout({
getLayout: null,
Page: PlatformView,
});
12 changes: 0 additions & 12 deletions apps/web/pages/settings/platform/billing/index.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions apps/web/pages/settings/platform/index.tsx

This file was deleted.

64 changes: 0 additions & 64 deletions apps/web/pages/settings/platform/new/index.tsx

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions apps/web/pages/settings/platform/oauth-clients/create.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions apps/web/pages/settings/platform/plans/index.tsx

This file was deleted.

1 change: 0 additions & 1 deletion apps/web/scripts/vercel-app-router-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ checkRoute "$APP_ROUTER_AVAILABILITY_ENABLED" app/future/availability
checkRoute "$APP_ROUTER_SETTINGS_DEVELOPER_ENABLED" app/future/settings/developer
checkRoute "$APP_ROUTER_SETTINGS_SECURITY_ENABLED" app/future/settings/security
checkRoute "$APP_ROUTER_SETTINGS_ADMIN_ENABLED" app/future/settings/admin
checkRoute "$APP_ROUTER_SETTINGS_PLATFORM_ENABLED" app/future/settings/platform
checkRoute "$APP_ROUTER_SETTINGS_ORG_ENABLED" app/future/settings/organizations
checkRoute "$APP_ROUTER_APPS_INSTALLED_CATEGORY_ENABLED" app/future/apps/installed
checkRoute "$APP_ROUTER_APPS_SLUG_ENABLED" app/future/apps/\[slug\]
Expand Down
1 change: 0 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@
"APP_ROUTER_SETTINGS_DEVELOPER_ENABLED",
"APP_ROUTER_SETTINGS_SECURITY_ENABLED",
"APP_ROUTER_SETTINGS_ADMIN_ENABLED",
"APP_ROUTER_SETTINGS_PLATFORM_ENABLED",
"APP_ROUTER_SETTINGS_ORG_ENABLED",
"APP_ROUTER_SETTINGS_TEAMS_ENABLED",
"APP_ROUTER_WORKFLOWS_ENABLED",
Expand Down
Loading