forked from calcom/cal.com
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [app-router-migration 18] Migrate "/settings/organizations/*" …
…pages (calcom#13042) * manual: app-directory-boilerplate-calcom * manual: import components directly * manual: move files to correct route groups and add metadata * manual: Change structure & Refactor to make code up to date * manual: refactors * Fix * manual: fix type of arg of getData * manual: fix type error * fix type bugs * fix * fixing the build * wip --------- Co-authored-by: Greg Pabian <[email protected]>
- Loading branch information
Showing
48 changed files
with
428 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
apps/web/app/future/settings/organizations/[id]/about/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import LegacyPage, { WrappedAboutOrganizationPage } from "@pages/settings/organizations/[id]/about"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("about_your_organization"), | ||
(t) => t("about_your_organization_description") | ||
); | ||
|
||
export default WithLayout({ Page: LegacyPage, getLayout: WrappedAboutOrganizationPage }); |
11 changes: 11 additions & 0 deletions
11
apps/web/app/future/settings/organizations/[id]/add-teams/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import LegacyPage, { WrapperAddNewTeamsPage } from "@pages/settings/organizations/[id]/add-teams"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("create_your_teams"), | ||
(t) => t("create_your_teams_description") | ||
); | ||
|
||
export default WithLayout({ Page: LegacyPage, getLayout: WrapperAddNewTeamsPage }); |
35 changes: 35 additions & 0 deletions
35
apps/web/app/future/settings/organizations/[id]/onboard-admins/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import LegacyPage, { | ||
buildWrappedOnboardTeamMembersPage, | ||
} from "@pages/settings/organizations/[id]/onboard-admins"; | ||
import { type Params } from "app/_types"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { headers } from "next/headers"; | ||
|
||
import PageWrapper from "@components/PageWrapperAppDir"; | ||
|
||
type PageProps = Readonly<{ | ||
params: Params; | ||
}>; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("invite_organization_admins"), | ||
(t) => t("invite_organization_admins_description") | ||
); | ||
|
||
const Page = ({ params }: PageProps) => { | ||
const h = headers(); | ||
const nonce = h.get("x-nonce") ?? undefined; | ||
|
||
return ( | ||
<PageWrapper | ||
getLayout={(page: React.ReactElement) => buildWrappedOnboardTeamMembersPage(params.id, page)} | ||
requiresLicense={false} | ||
nonce={nonce} | ||
themeBasis={null}> | ||
<LegacyPage /> | ||
</PageWrapper> | ||
); | ||
}; | ||
|
||
export default Page; |
11 changes: 11 additions & 0 deletions
11
apps/web/app/future/settings/organizations/[id]/set-password/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import LegacyPage, { WrappedSetPasswordPage } from "@pages/settings/organizations/[id]/set-password"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("set_a_password"), | ||
(t) => t("set_a_password_description") | ||
); | ||
|
||
export default WithLayout({ Page: LegacyPage, getLayout: WrappedSetPasswordPage }); |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/appearance/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/appearance/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/appearance"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("appearance"), | ||
(t) => t("appearance_org_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/billing/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }); |
10 changes: 10 additions & 0 deletions
10
apps/web/app/future/settings/organizations/billing/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Page from "@pages/settings/billing/index"; | ||
import { _generateMetadata } from "app/_utils"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("billing"), | ||
(t) => t("manage_billing_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/general/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/general/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/general"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("general"), | ||
(t) => t("general_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/members/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/members/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/members"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("organization_members"), | ||
(t) => t("organization_description") | ||
); | ||
|
||
export default Page; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import LegacyPage, { WrappedCreateNewOrganizationPage } from "@pages/settings/organizations/new/index"; | ||
import { _generateMetadata } from "app/_utils"; | ||
import { WithLayout } from "app/layoutHOC"; | ||
import { type GetServerSidePropsContext } from "next"; | ||
import { notFound } from "next/navigation"; | ||
|
||
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("set_up_your_organization"), | ||
(t) => t("organizations_description") | ||
); | ||
|
||
const getPageProps = async (context: GetServerSidePropsContext) => { | ||
const prisma = await import("@calcom/prisma").then((mod) => mod.default); | ||
const flags = await getFeatureFlagMap(prisma); | ||
// Check if organizations are enabled | ||
if (flags["organizations"] !== true) { | ||
return notFound(); | ||
} | ||
|
||
const querySlug = context.query.slug as string; | ||
|
||
return { | ||
querySlug: querySlug ?? null, | ||
}; | ||
}; | ||
|
||
export default WithLayout({ | ||
getLayout: WrappedCreateNewOrganizationPage, | ||
Page: LegacyPage, | ||
getData: getPageProps, | ||
}); |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/profile/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/profile/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/profile"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("profile"), | ||
(t) => t("profile_org_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/teams/other/[id]/appearance/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/teams/other/[id]/appearance/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/teams/pages/team-appearance-view"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("booking_appearance"), | ||
(t) => t("appearance_team_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/teams/other/[id]/members/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/teams/other/[id]/members/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/other-team-members-view"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("team_members"), | ||
(t) => t("members_team_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/teams/other/[id]/profile/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/teams/other/[id]/profile/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/other-team-profile-view"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("profile"), | ||
(t) => t("profile_team_description") | ||
); | ||
|
||
export default Page; |
5 changes: 5 additions & 0 deletions
5
apps/web/app/future/settings/organizations/teams/other/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
apps/web/app/future/settings/organizations/teams/other/page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/organizations/pages/settings/other-team-listing-view"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("org_admin_other_teams"), | ||
(t) => t("org_admin_other_teams_description") | ||
); | ||
|
||
export default Page; |
Oops, something went wrong.