From 7dde3edd8db0b6cbcd523e8ff4eeaedafba90c1d Mon Sep 17 00:00:00 2001 From: Tiago Farto Date: Mon, 20 Apr 2026 12:30:03 +0000 Subject: [PATCH] chore: fix tests --- .../lib/handle-integrations.ts | 10 - .../link/components/survey-inactive.tsx | 26 +-- .../survey-status-indicator/index.tsx | 179 +++++++++--------- 3 files changed, 107 insertions(+), 108 deletions(-) diff --git a/apps/web/modules/response-pipeline/lib/handle-integrations.ts b/apps/web/modules/response-pipeline/lib/handle-integrations.ts index 8c7c341614..35d17cbd63 100644 --- a/apps/web/modules/response-pipeline/lib/handle-integrations.ts +++ b/apps/web/modules/response-pipeline/lib/handle-integrations.ts @@ -50,16 +50,6 @@ interface TIntegrationFieldSelection { includeVariables: boolean; } -type TIntegrationPipelineData = { - surveyId: string; - response: { - createdAt: Date; - data: Record; - meta: TResponseMeta; - variables: Record; - }; -}; - const toIntegrationFieldSelection = (config: { elementIds: string[]; includeCreatedAt?: boolean | null; diff --git a/apps/web/modules/survey/link/components/survey-inactive.tsx b/apps/web/modules/survey/link/components/survey-inactive.tsx index 4ce8c3f843..f952a3d22b 100644 --- a/apps/web/modules/survey/link/components/survey-inactive.tsx +++ b/apps/web/modules/survey/link/components/survey-inactive.tsx @@ -19,6 +19,8 @@ export const SurveyInactive = async ({ workspace?: Pick; }) => { const t = await getTranslate(); + const hasCustomClosedMessage = + (status === "completed" || status === "link expired") && Boolean(surveyClosedMessage); const icons = { paused: isScheduled ? ( @@ -38,6 +40,16 @@ export const SurveyInactive = async ({ "response submitted": t("s.response_submitted"), "link expired": t("c.link_expired_description"), }; + let title = `${t("common.survey")} ${status}.`; + + if (hasCustomClosedMessage) { + title = surveyClosedMessage?.heading ?? title; + } else if (isScheduled) { + title = t("common.survey_scheduled"); + } + + const description = + status === "completed" && surveyClosedMessage ? surveyClosedMessage.subheading : descriptions[status]; const showCTA = status !== "link invalid" && @@ -50,18 +62,8 @@ export const SurveyInactive = async ({
{icons[status]} -

- {(status === "completed" || status === "link expired") && surveyClosedMessage - ? surveyClosedMessage.heading - : isScheduled - ? t("common.survey_scheduled") - : `${t("common.survey")} ${status}.`} -

-

- {status === "completed" && surveyClosedMessage - ? surveyClosedMessage.subheading - : descriptions[status]} -

+

{title}

+

{description}

{showCTA && (