moved validationOnNavigation to globalPageSettings#4064
Conversation
…ed validationOnNavigation to GlobalPageSettings
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
|
lassopicasso
left a comment
There was a problem hiding this comment.
@walldenfilippa great job! 💪
836e656
into
feat/16446-navigation-validation
* #17511 + #17512 (#3977) Co-authored-by: walldenfilippa <filippa.walden@digdir.no> * Override validation on navigationbuttons * minor clean up * added override validation on the navigationBar component * added ovverride customButton + configured the validateOnNext/Forward and validateOnPrevious/Backward with preventNavigation prop for validationOnNavigation * Feat/prevent-navigation (#3990) * add basic logic for preventing navigation * change wording * added PageValidation on layoutSets and layoutSettings (#3998) * added PageValidation on layoutSets and layoutSettings --------- Co-authored-by: walldenfilippa <filippa.walden@digdir.no> * Feat/refactor pagevalidation navigation (#4005) * refactor: navigation validation backward and improve page validation hooks * refactor preventing navigation to use simplified config --------- Co-authored-by: walldenfilippa <filippa.walden@digdir.no> Co-authored-by: Magnus Revheim Martinsen <mrmartinsen.96@gmail.com> * added prop expandedByDefault to groups for sidenavigation (#4006) * added prop expandedByDefault to groups for sidenavigation * added prop expandedByDefault to subform sidenavigation --------- Co-authored-by: walldenfilippa <filippa.walden@digdir.no> * Updated the validation hierarchy for the navigation rules. * fix prevent navigation * feat: enhance navigation validation by integrating validation checks (#4027) * feat: enhance navigation validation by integrating validation checks in navigation components * removed one hook and added useGetNavigationIsPrevented on pageGroup aswell * temporary notes * remove temporary note * update tests --------- Co-authored-by: walldenfilippa <filippa.walden@digdir.no> * merge main into feat/16446-navigation-validation * changed ovverride level direction on validation on navigation and moved validationOnNavigation to GlobalPageSettings (#4064) Co-authored-by: walldenfilippa <filippa.walden@digdir.no> * fix comments in feat/16446-navigation-validation (#4094) * fix comments in feat/16446-navigation-validation * fixed tests in NavigationButtons tests * refactor: implement navigation with validation logic in Page and PageGroup components --------- Co-authored-by: walldenfilippa <filippa.walden@digdir.no> --------- Co-authored-by: Filippa Wallden <143729834+walldenfilippa@users.noreply.github.com> Co-authored-by: walldenfilippa <filippa.walden@digdir.no>



Description
Moved validationOnNavigation into GlobalPageSettings in Common.ts. This means it is now part of the standard page settings hierarchy and will be automatically supported in NEXT, where uiSettings from layout-sets.json moves to App/ui/Settings.json).
By being part of GlobalPageSettings, the setting is automatically handled by usePageSettings(): layout-set-specific Settings.json overrides the global layout-sets.json uiSettings.
Fixed the override priority for validationOnNavigation in useGetNavigationIsPrevented — page-specific configuration now correctly takes precedence over the global setting, instead of the other way around.
Override hierarchy (highest to lowest priority)
Individual page layout file (data.validationOnNavigation)
Layout-set Settings.json (pages.validationOnNavigation)
Global layout-sets.json uiSettings (validationOnNavigation)
Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes grouping