Skip to content

fix(financial-terms): preserve saved values when editing - #969

Merged
thlpkee20-wq merged 1 commit into
RevoraOrg:masterfrom
Tonychris127:fix/919-preserve-financial-terms
Oct 22, 2026
Merged

thlpkee20-wq merged 1 commit into
RevoraOrg:masterfrom
Tonychris127:fix/919-preserve-financial-terms

Conversation

@Tonychris127

Copy link
Copy Markdown
Contributor

Overview

After saving financial terms, clicking Edit terms previously dispatched a reset and erased all six fields. Edit now returns to the populated form, allowing a user to change one value and save again. The explicit Reset action still clears the form.

Related Issue

Closes #919

Changes

  • Add a dedicated edit handler that only leaves the success screen; preserve the reducer's values and validation state.
  • Keep cross-field validation derived from the retained values through the existing hook's render-time validation, with no reducer or number-parsing changes.
  • Assert every submitted field survives Edit; test invalid investment ranges, correction and resubmission; verify explicit Reset still clears saved values and feedback.

Verification Results

  • Regression run against the unchanged base component: all 3 regression cases fail, exposing cleared fields and missing range validation.
  • Financial-terms component, index, hook and validation suites: 175 passed, 0 failed.
  • npm run build: passed (the check enforced by CI).
  • ESLint on both changed files: passed.
  • git diff --check: passed.
  • Scoped financial-terms coverage: component 100% statements/branches/functions/lines; validation utility 100% statements/functions/lines, 98.38% branches. The command exits 1 because the unchanged hook has 88.88% branch coverage, below its existing 95% threshold. A hook-only rerun using the unchanged hook and tests reproduces the gap; no thresholds or checks were changed.

Local validation used Node 24.21.0. An isolated dependency install hit the machine's disk-space limit; tests/build used the existing installation with an identical package-lock hash, with test discovery and generated outputs scoped to this checkout. No dependency or lockfile changes are included. The repository-wide test suite was not rerun for this focused change.

Acceptance criterion Evidence
Every submitted field is retained after Edit Assertions cover all six inputs
Regression fails before and passes after Three cases fail against the original component; all financial-terms tests pass with the fix
Cross-field validation is recomputed Editing min investment to equal max shows an error and blocks submission; correction removes the error and saves the updated values
No unrelated behavior changes Explicit Reset remains tested; production change is only the Edit handler and button wiring; CI build passes locally

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Tonychris127 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@thlpkee20-wq
thlpkee20-wq merged commit f517b2e into RevoraOrg:master Oct 22, 2026
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.

fix(financial-terms): 'Edit terms' after a successful save resets the form and discards all entered values

2 participants