Skip to content

Paired indicator validation on Actual/Target page exit - #585

Merged
Ramon-Jimenez merged 4 commits into
developmentfrom
feature/paired-indicator-validation
Jun 17, 2026
Merged

Ramon-Jimenez merged 4 commits into
developmentfrom
feature/paired-indicator-validation

Conversation

@Ramon-Jimenez

@Ramon-Jimenez Ramon-Jimenez commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

📌 References

Task: https://app.clickup.com/t/869dk0c1d #869dk0c1d

📹 Screenshots/Screen capture

Paired indicator validation

Data-Management-App_paired_indicators_alert.mp4

Paired indicator + global validation

Data-Management-App_all_indicators_alert.mp4

Summary

  • Adds a new PairedValidator that, 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.
  • Wires the validator into Validator.build, Validator.onSave, and Validator.validate so 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).
  • Pairing is derived from the existing pairedDataElement data-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 relaxed GlobalValidator (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 existing validateNonEmptyGlobalsWhenSubsHaveValues flow.

Behaviour

  • Triggers only on page exit (no per-cell error pop-ups), matching the original requirement: "If a user tries to navigate off the screen while breaking this rule, a pop-up error will appear."
  • Both Actual and Target screens are covered (the validator loads the dataset matching dataSetType).
  • "Has values" = any cell of the indicator (across all disaggregations / category-option-combos) holds a non-empty value, since benefit and people indicators have different disaggregation shapes.
  • Reported as error level so the existing exit-confirmation dialog blocks navigation until the user fills the paired side.

Test plan

  • Open an Actual data entry screen with a project that includes a paired benefit/people indicator pair.
  • Enter a value in the benefit indicator only, attempt to navigate away → exit dialog should list the paired-indicator error and block navigation.
  • Fill the paired people indicator → navigation should proceed.
  • Repeat the symmetric scenario (people filled, benefit empty).
  • Repeat both scenarios on the Target screen.
  • Verify the existing global/sub indicator validations still trigger (no regression in Validator.validate).
  • Verify per-cell save validations (Actual/Recurring/Global-on-save/Benefit) are unchanged (no new noise on cell save).

🤖 Generated with Claude Code

Ramon-Jimenez and others added 2 commits May 6, 2026 09:58
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>
@bundlemon

bundlemon Bot commented May 6, 2026 •

Copy link
Copy Markdown

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
✅ Build Folder
./**/*
5.52MB (+3.01KB +0.05%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@eperedo eperedo assigned eperedo and unassigned eperedo Jun 8, 2026
@eperedo
eperedo marked this pull request as ready for review June 8, 2026 16:45
@Ramon-Jimenez
Ramon-Jimenez merged commit 0660cbb into development Jun 17, 2026
3 checks passed
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.

2 participants