Repository navigation
fix(jsonforms-renderers): NumberControl honours minimum, exclusiveMinimum and multipleOf - #119
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
sthanikan2000
left a comment
There was a problem hiding this comment.
LGTM. Tests pass, and the key/paste test fails when onKeyDown/onPaste are removed, so it pins the behaviour. The release note is accurate.
Merge note: #112 and #119 both add NumberControl.test.tsx, so the second one to merge gets one add/add conflict. Keep main's file and add this PR's it to its describe, using renderForm({ reviewOutcome: 'approve' }). I tried #112 + #117 + #119 together and all 578 tests pass. Suggested order: #112, #117, then #119.
a68d219 to
bec063a
Compare
…leOf Drive NumberControl min/step from the schema, block signed and exponent keys when the bound is non-negative, and clarify constraint error messages. Co-authored-by: Cursor <cursoragent@cursor.com>
bec063a to
ad04c6f
Compare
|
Rebased onto |
sthanikan2000
left a comment
There was a problem hiding this comment.
Re-checked after the rebase onto main. Your conflict resolution matches what I suggested: the test file keeps main's asterisk test and adds the key/paste one. The new afterEach debounce flush looks right. I ran the file five times with no flakiness, and the key/paste test still fails when onKeyDown/onPaste are removed. The full suite passes (586) and type-check is clean. Approving.
Summary
Split out of #112 so release notes can list this separately from the conditional-required asterisk work.
NumberControlreadsminimum/exclusiveMinimum/multipleOfformin/step. When the bound is >= 0, it blocks-/+/e/Eon keydown and paste.getErrorMessagerewrites exclusiveMinimum / minimum / multipleOf AJV messages into clearer wording.Type of change
Changes made
NumberControl:min/stepfrom schema; block signed/exponent keys and pastes when bound >= 0getErrorMessage: clearer exclusiveMinimum / minimum / multipleOf messagesnumberfixture: add anassessedAmountfield withexclusiveMinimum: 0andmultipleOf: 0.01Testing
pnpm testin jsonforms-renderers-/+/eand shows readable constraint errorsRelease notes
Number fields with a
minimum/exclusiveMinimum>= 0 no longer accept-,+,eorE, and usemin/stepfrom the schema. Error messages now read "X must be greater than 0" instead of "must be > 0".