WEB-700 Configuration Form Allows Negative Number Values#3131
WEB-700 Configuration Form Allows Negative Number Values#3131JaySoni1 wants to merge 1 commit intoopenMF:devfrom
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Edit Configuration Component src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.html, src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.ts |
Added minimum value validation (0) to prevent negative inputs. HTML template includes min="0" attribute on numeric input; TypeScript adds Validators.min(0) to form control. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested reviewers
- alberto-art3ch
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and specifically describes the main change: preventing negative number values in the configuration form by enforcing a minimum value constraint. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
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 @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.html`:
- Around line 24-27: The number input lacks a visible validation message: update
the template for edit-configuration.component.html around the <mat-form-field>
containing the input with formControlName="value" to include a <mat-error> that
displays when the FormControl has a min error (Validators.min(0)) and is
touched/dirty; the <mat-error> should show a clear message like "Value must be
at least 0" (or translated key) and be conditioned on value.hasError('min') &&
(value.touched || value.dirty) so users see why Submit is disabled.
...onfigurations/global-configurations-tab/edit-configuration/edit-configuration.component.html
Show resolved
Hide resolved
alberto-art3ch
left a comment
There was a problem hiding this comment.
Please review my comment
| <mat-form-field> | ||
| <mat-label>{{ 'labels.inputs.Number Value' | translate }}</mat-label> | ||
| <input matInput type="number" formControlName="value" /> | ||
| <input matInput type="number" formControlName="value" min="0" /> |
There was a problem hiding this comment.
To be honest I think a Global Configuration cloud have a negative value
There was a problem hiding this comment.
So, @alberto-art3ch, what should we do about this?
Changes Made :-
-Prevented negative values in the configuration "Number Value" field by enforcing a minimum value of zero.
WEB-700
Before :-
After :-
Summary by CodeRabbit