Skip to content

Scheduling infrastructure for absolutely everyone.

fix: app that dont require setup page (#11628)

alannnc032435fbd465
diff --git a/apps/web/playwright/payment-apps.e2e.ts b/apps/web/playwright/payment-apps.e2e.ts
index 536aed90e0c..c01bc10ba26 100644
--- a/apps/web/playwright/payment-apps.e2e.ts
+++ b/apps/web/playwright/payment-apps.e2e.ts
@@ -200,4 +200,38 @@ test.describe("Payment app", () => {
// Expect "Getting started with Paypal APP" to be displayed
expect(await page.locator("text=Getting started with Paypal APP").first()).toBeTruthy();
});
+
+ /**
+ * For now almost all the payment apps show display "This app has not been setup yet"
+ * this can change in the future
+ */
+ test("Should not display App is not setup already for non payment app", async ({ page, users }) => {
+ // We will use google analytics app for this test
+ const user = await users.create();
+ await user.apiLogin();
+ // Any event should work here
+ const paymentEvent = user.eventTypes.find((item) => item.slug === "paid");
+ if (!paymentEvent) {
+ throw new Error("No payment event found");
+ }
+
+ await prisma.credential.create({
+ data: {
+ type: "ga4_analytics",
+ userId: user.id,
+ appId: "ga4",
+ invalid: false,
+ key: {},
+ },
+ });
+
+ await page.goto(`event-types/${paymentEvent.id}?tabName=apps`);
+
+ await page.locator("#event-type-form").getByRole("switch").click();
+ // make sure Tracking ID is displayed
+ expect(await page.locator("text=Tracking ID").first()).toBeTruthy();
+ await page.getByLabel("Tracking ID").click();
+ await page.getByLabel("Tracking ID").fill("demo");
+ await page.getByTestId("update-eventtype").click();
+ });
});
diff --git a/packages/app-store/_components/AppCard.tsx b/packages/app-store/_components/AppCard.tsx
index 4e456369ff4..593aedb4748 100644
--- a/packages/app-store/_components/AppCard.tsx
+++ b/packages/app-store/_components/AppCard.tsx
@@ -116,7 +116,7 @@ export default function AppCard({
{app?.isInstalled && switchChecked && <hr className="border-subtle" />}
{app?.isInstalled && switchChecked ? (
- app.isSetupAlready ? (
+ app.isSetupAlready === undefined || app.isSetupAlready ? (
<div className="relative p-4 pt-5 text-sm [&_input]:mb-0 [&_input]:leading-4">
<Link href={`/apps/${app.slug}/setup`} className="absolute right-4 top-4">
<Settings className="text-default h-4 w-4" aria-hidden="true" />
diff --git a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
index 7cce1075f12..70ea87aed55 100644
--- a/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
+++ b/packages/trpc/server/routers/loggedInViewer/integrations.handler.ts
@@ -166,7 +166,8 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) =
};
// We need to know if app is payment type
- let isSetupAlready = false;
+ // undefined it means that app don't require app/setup/page
+ let isSetupAlready = undefined;
if (credential && app.categories.includes("payment")) {
const paymentApp = (await appStore[app.dirName as keyof typeof appStore]()) as PaymentApp | null;
if (paymentApp && "lib" in paymentApp && paymentApp?.lib && "PaymentService" in paymentApp?.lib) {