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.
- Loading branch information
1 parent
b5b1533
commit 536c47c
Showing
9 changed files
with
101 additions
and
1 deletion.
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
41 changes: 41 additions & 0 deletions
41
apps/web/app/future/(individual-page-wrapper)/workflows/[workflow]/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,41 @@ | ||
import { headers } from "next/headers"; | ||
import { notFound } from "next/navigation"; | ||
import { z } from "zod"; | ||
|
||
import Workflow from "@calcom/features/ee/workflows/pages/workflow"; | ||
|
||
import PageWrapper from "@components/PageWrapperAppDir"; | ||
|
||
type Params = { workflow: string }; | ||
|
||
type WorkflowPageProps = { | ||
params: Params; | ||
}; | ||
|
||
const querySchema = z.object({ | ||
workflow: z.string(), | ||
}); | ||
|
||
async function getProps({ params }: { params: Params }) { | ||
const safeParams = querySchema.safeParse(params); | ||
|
||
console.log("Built workflow page:", safeParams); | ||
if (!safeParams.success) { | ||
return notFound(); | ||
} | ||
return { workflow: safeParams.data.workflow }; | ||
} | ||
|
||
export default async function WorkflowPage({ params }: WorkflowPageProps) { | ||
const props = await getProps({ params }); | ||
const h = headers(); | ||
const nonce = h.get("x-nonce") ?? undefined; | ||
|
||
return ( | ||
<PageWrapper getLayout={null} requiresLicense={false} nonce={nonce} themeBasis={null} {...props}> | ||
<Workflow /> | ||
</PageWrapper> | ||
); | ||
} | ||
|
||
export const dynamicParams = true; |
15 changes: 15 additions & 0 deletions
15
apps/web/app/future/(shared-page-wrapper)/(layout)/workflows/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,15 @@ | ||
import { _generateMetadata } from "app/_utils"; | ||
|
||
import Workflows from "@calcom/features/ee/workflows/pages/index"; | ||
|
||
import type { CalPageWrapper } from "@components/PageWrapper"; | ||
|
||
export const generateMetadata = async () => | ||
await _generateMetadata( | ||
(t) => t("workflows"), | ||
(t) => t("workflows_to_automate_notifications") | ||
); | ||
|
||
const WorkflowsPage = Workflows as CalPageWrapper; | ||
|
||
export default WorkflowsPage; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { expect } from "@playwright/test"; | ||
|
||
import { test } from "./lib/fixtures"; | ||
|
||
test.describe.configure({ mode: "parallel" }); | ||
|
||
test.describe("workflows/ A/B tests", () => { | ||
test("should point to the future/workflows", async ({ page, users, context }) => { | ||
await context.addCookies([ | ||
{ | ||
name: "x-calcom-future-routes-override", | ||
value: "1", | ||
url: "http://localhost:3000", | ||
}, | ||
]); | ||
const user = await users.create(); | ||
|
||
await user.apiLogin(); | ||
|
||
await page.goto("/workflows"); | ||
|
||
await page.waitForLoadState(); | ||
|
||
const dataNextJsRouter = await page.evaluate(() => | ||
window.document.documentElement.getAttribute("data-nextjs-router") | ||
); | ||
|
||
expect(dataNextJsRouter).toEqual("app"); | ||
|
||
const locator = page.getByRole("heading", { name: "Workflows" }); | ||
|
||
await expect(locator).toBeVisible(); | ||
}); | ||
}); |
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