Skip to content

Refactor MovementWizard for maintainability#709

Merged
rzueger merged 5 commits intodevelopfrom
refactor/movement-wizard
Apr 17, 2026
Merged

Refactor MovementWizard for maintainability#709
rzueger merged 5 commits intodevelopfrom
refactor/movement-wizard

Conversation

@rzueger
Copy link
Copy Markdown
Member

@rzueger rzueger commented Apr 17, 2026

Summary

  • Replace PropTypes with TypeScript interface for compile-time type safety
  • Convert class component to functional component with hooks
  • Extract page navigation logic into useWizardNavigation hook
  • Extract dialog rendering into WizardDialog component
  • Add 31 new tests covering all extracted logic and component branches

Test plan

  • npm test passes (no new failures)
  • TypeScript type check passes (no new errors)
  • Manual smoke test: create and edit a departure and arrival movement

rzueger added 5 commits April 17, 2026 09:28
Replace class component with function using useEffect for mount
logic and useTranslation hook instead of withTranslation HOC.
Move page navigation logic (submitPage, goToPreviousPage) into
a dedicated hook with tests. Deduplicate the "next action"
decision (nextPage vs saveMovement) via getNextAction.
Move dialog rendering logic into a dedicated component with
tests covering all branches and callbacks.
Cover initialization, loading state, breadcrumbs, committed
state, active page rendering, and commit error display.
@rzueger rzueger merged commit 04911c5 into develop Apr 17, 2026
2 checks passed
@rzueger rzueger deleted the refactor/movement-wizard branch April 17, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant