From fcbc463990817261732ff9e684b7f6cc7f77b317 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 30 Jul 2026 22:56:26 +0000 Subject: [PATCH] fix: format + wire WIZARD_TREND_SAVED_MESSAGE for knip --- .../(campaign)/campanha/(app)/acoes/[slug]/page.tsx | 6 ++++-- .../(app)/municipios/municipalityStaffFormActions.ts | 3 ++- .../campaign/municipality/WizardTrendChoiceStep.tsx | 4 +++- src/lib/politicalTrendWizardMeta.ts | 12 ++---------- src/lib/politicalTrendWizardUi.ts | 5 +---- tests/unit/politicalTrendWizardUi.unit.spec.ts | 2 +- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/app/(campaign)/campanha/(app)/acoes/[slug]/page.tsx b/src/app/(campaign)/campanha/(app)/acoes/[slug]/page.tsx index 307dc7fd..9277e916 100644 --- a/src/app/(campaign)/campanha/(app)/acoes/[slug]/page.tsx +++ b/src/app/(campaign)/campanha/(app)/acoes/[slug]/page.tsx @@ -15,6 +15,7 @@ import { parseWizardEntryActionParam, parseWizardMunicipioParam, resolveWizardSignalTypeParam, + resolveWizardTrendStatusParam, WIZARD_ENTRY_ACTION_QUERY_KEY, WIZARD_MUNICIPIO_QUERY_KEY, WIZARD_NOTE_PREFILL_QUERY_KEY, @@ -27,7 +28,6 @@ import { wizardActionHref, wizardSignalHref, wizardTrendHref, - resolveWizardTrendStatusParam, } from '@/lib/campaignActionRoutes' import { CAMPAIGN_HOME } from '@/lib/campaignPaths' import { @@ -171,7 +171,9 @@ export default async function CampaignActionWizardPage({ trendStatus === currentStatus || !selectablePoliticalTrendStatuses(currentStatus).includes(trendStatus) ) { - redirect(wizardTrendHref(slug, municipalitySlug, undefined, entryAction, prefillExtraParams)) + redirect( + wizardTrendHref(slug, municipalitySlug, undefined, entryAction, prefillExtraParams), + ) } return ( diff --git a/src/app/(campaign)/campanha/(app)/municipios/municipalityStaffFormActions.ts b/src/app/(campaign)/campanha/(app)/municipios/municipalityStaffFormActions.ts index 383f1bfa..e5a90b91 100644 --- a/src/app/(campaign)/campanha/(app)/municipios/municipalityStaffFormActions.ts +++ b/src/app/(campaign)/campanha/(app)/municipios/municipalityStaffFormActions.ts @@ -14,6 +14,7 @@ import { requiredRelationshipFormValue, voteEstimateScenarioFromForm, } from '@/lib/formData' +import { WIZARD_TREND_SAVED_MESSAGE } from '@/lib/politicalTrendWizardUi' import { MUNICIPALITY_ADVISOR_MEMBERSHIP_UNRESTRICTED_MESSAGE, parsePoliticalTrendStatusFormValue, @@ -61,7 +62,7 @@ export const setMunicipalityPoliticalTrendFormAction = async ( note: nullableFormText(formData, 'trendNote'), }) revalidateMunicipalityListPaths({ slug: optionalMunicipalitySlugFromForm(formData) }) - return { message: 'Tendência política registrada.' } + return { message: WIZARD_TREND_SAVED_MESSAGE } }, safeMessages: municipalityStaffEditSafeMessages, genericMessage: diff --git a/src/components/campaign/municipality/WizardTrendChoiceStep.tsx b/src/components/campaign/municipality/WizardTrendChoiceStep.tsx index 62c28911..17853d78 100644 --- a/src/components/campaign/municipality/WizardTrendChoiceStep.tsx +++ b/src/components/campaign/municipality/WizardTrendChoiceStep.tsx @@ -87,7 +87,9 @@ export const WizardTrendChoiceStep = ({
{entry.label} - {entry.changeDescription} + + {entry.changeDescription} +