Paired indicator validation on Actual/Target page exit#585
Draft
Ramon-Jimenez wants to merge 2 commits intodevelopmentfrom
Draft
Paired indicator validation on Actual/Target page exit#585Ramon-Jimenez wants to merge 2 commits intodevelopmentfrom
Ramon-Jimenez wants to merge 2 commits intodevelopmentfrom
Conversation
Block navigation when a benefit data element has values entered but its paired people data element is empty (and vice versa), surfacing an error that the user must resolve before leaving the data entry screen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
BundleMonNo change in files bundle size Groups updated (1)
Final result: ✅ View report in BundleMon website ➡️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PairedValidatorthat, on Actual/Target page exit, blocks navigation when one side of a paired benefit ↔ people indicator has values entered but the paired side is empty.Validator.build,Validator.onSave, andValidator.validateso it is initialised with the current dataset, kept in sync as cells are saved, and consulted on the navigate-away path (same surface that already shows the global/sub validation dialog).pairedDataElementdata-element attribute (already used elsewhere for spreadsheet import and indicator formulas) — no new metadata required.Context
Per investigation against
development, this rule was never present in the codebase: there is no current code, branch, or commit history implementing a paired benefit/people navigate-block validation. The recently flagged "Sub indicators can exceed global indicators" feature only relaxedGlobalValidator(errors → warnings) and could not have overwritten paired-indicator logic that did not exist. This PR therefore implements the rule from scratch, modelled on the existingvalidateNonEmptyGlobalsWhenSubsHaveValuesflow.Behaviour
dataSetType).errorlevel so the existing exit-confirmation dialog blocks navigation until the user fills the paired side.Test plan
Validator.validate).🤖 Generated with Claude Code