chore: migrate /apps/installation pages (#18870)

* migrate apps/installation pages

* fix test
This commit is contained in:
Benny Joo authored and GitHub committed 2025-01-26 23:04:30 +01:00
1 parent 2b79ef0836
commit 2f9beed450
5 files changed
+8 -25

No files matched your search

@@ -1,7 +1,6 @@
import { withAppDirSsr } from "app/WithAppDirSsr";
import type { PageProps } from "app/_types";
import { _generateMetadata } from "app/_utils";
import { WithLayout } from "app/layoutHOC";
import { cookies, headers } from "next/headers";
import { getServerSideProps } from "@lib/apps/installation/[[...step]]/getServerSideProps";
@@ -22,4 +21,8 @@ export const generateMetadata = async ({ params, searchParams }: PageProps) => {
const getData = withAppDirSsr<OnboardingPageProps>(getServerSideProps);
export default WithLayout({ getLayout: null, getData, Page });
const ServerPage = async ({ params, searchParams }: PageProps) => {
const props = await getData(buildLegacyCtx(headers(), cookies(), params, searchParams));
return <Page {...props} />;
};
export default ServerPage;
+1 -3
View File
@@ -171,11 +171,9 @@ export const config = {
"/event-types/:path*",
"/apps/installed/:category/",
"/future/apps/installed/:category/",
"/apps/installation/:path*",
"/apps/:slug/",
"/future/apps/:slug/",
"/apps/:slug/setup/",
"/future/apps/:slug/setup/",
"/apps/categories/",
"/apps/categories/:category/",
"/workflows/:path*",
@@ -1,6 +1,5 @@
"use client";
import Head from "next/head";
import { usePathname, useRouter } from "next/navigation";
import { useEffect, useMemo, useRef, useState } from "react";
import { useForm } from "react-hook-form";
@@ -226,12 +225,6 @@ const OnboardingPage = ({
key={pathname}
className="dark:bg-brand dark:text-brand-contrast text-emphasis min-h-screen px-4"
data-testid="onboarding">
<Head>
<title>
{t("install")} {appMetadata?.name ?? ""}
</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<div className="mx-auto py-6 sm:px-4 md:py-24">
<div className="relative">
<div className="sm:mx-auto sm:w-full sm:max-w-[600px]" ref={formPortalRef}>
@@ -1,12 +0,0 @@
import PageWrapper from "@components/PageWrapper";
import type { OnboardingPageProps } from "~/apps/installation/[[...step]]/step-view";
import StepView from "~/apps/installation/[[...step]]/step-view";
const Page = (props: OnboardingPageProps) => <StepView {...props} />;
Page.PageWrapper = PageWrapper;
export { getServerSideProps } from "@lib/apps/installation/[[...step]]/getServerSideProps";
export default Page;
@@ -17,7 +17,8 @@ test.describe("check analytics Apps", () => {
await user.apiLogin();
await page.goto("apps/categories/analytics");
await appsPage.installAnalyticsAppSkipConfigure(app);
// eslint-disable-next-line playwright/no-wait-for-timeout
await page.waitForTimeout(1000); // waits for 1 second
await page.goto("/event-types");
await appsPage.goToEventType("30 min");
await appsPage.goToAppsTab();