Format B135 wizard back navigation files

This commit is contained in:
Cursor Agent 2026-08-02 23:05:09 +00:00
parent 28525aab4b
commit 989e3abab8
No known key found for this signature in database
4 changed files with 12 additions and 11 deletions

View file

@ -61,9 +61,7 @@ export const WizardTrendNoteStep = ({
useCampaignFormSuccessToast(state, () => { useCampaignFormSuccessToast(state, () => {
recordLastActedMunicipality(municipalitySlug) recordLastActedMunicipality(municipalitySlug)
const sessionEntry = resolveWizardChainEntry(entryAction, 'change-trend') const sessionEntry = resolveWizardChainEntry(entryAction, 'change-trend')
router.push( router.push(wizardChainContinueHref(sessionEntry, 'change-trend', municipalitySlug, returnPath))
wizardChainContinueHref(sessionEntry, 'change-trend', municipalitySlug, returnPath),
)
}) })
return ( return (

View file

@ -85,9 +85,7 @@ export const WizardExpectedVotesStep = ({
const continueAfterVotes = () => { const continueAfterVotes = () => {
const sessionEntry = resolveWizardChainEntry(entryAction, 'update-votes') const sessionEntry = resolveWizardChainEntry(entryAction, 'update-votes')
router.push( router.push(wizardChainContinueHref(sessionEntry, 'update-votes', municipalitySlug, returnPath))
wizardChainContinueHref(sessionEntry, 'update-votes', municipalitySlug, returnPath),
)
} }
const handleConfirm = () => { const handleConfirm = () => {

View file

@ -6,11 +6,11 @@
import { import {
CAMPAIGN_WIZARD_ACTION_SLUGS, CAMPAIGN_WIZARD_ACTION_SLUGS,
campaignWizardActionIdForSlug, campaignWizardActionIdForSlug,
type CampaignWizardActionId,
isWizardReturnPath, isWizardReturnPath,
wizardActionHref, wizardActionHref,
wizardSignalHref, wizardSignalHref,
wizardTrendHref, wizardTrendHref,
type CampaignWizardActionId,
} from '@/lib/campaignActionRoutes' } from '@/lib/campaignActionRoutes'
import { CAMPAIGN_HOME } from '@/lib/campaignPaths' import { CAMPAIGN_HOME } from '@/lib/campaignPaths'
@ -198,7 +198,14 @@ export const wizardPreviousHref = (input: WizardPreviousHrefInput): string => {
} }
if (stepKind === 'trend-note') { if (stepKind === 'trend-note') {
return wizardTrendHref(actionSlug, municipalitySlug, undefined, entryAction, undefined, returnPath) return wizardTrendHref(
actionSlug,
municipalitySlug,
undefined,
entryAction,
undefined,
returnPath,
)
} }
if (stepKind === 'signal-body') { if (stepKind === 'signal-body') {

View file

@ -132,9 +132,7 @@ describe('wizardActionChain', () => {
municipalitySlug: 'cairu', municipalitySlug: 'cairu',
entryAction: 'update-votes', entryAction: 'update-votes',
}), }),
).toBe( ).toBe(`${CAMPAIGN_ACTIONS_HOME}/mudar-tendencia?municipio=cairu&entry=update-votes`)
`${CAMPAIGN_ACTIONS_HOME}/mudar-tendencia?municipio=cairu&entry=update-votes`,
)
expect( expect(
wizardPreviousHref({ wizardPreviousHref({
actionSlug: 'atualizar-lideranca', actionSlug: 'atualizar-lideranca',