Skip to content

WEB-700 Configuration Form Allows Negative Number Values#3131

Open
JaySoni1 wants to merge 1 commit intoopenMF:devfrom
JaySoni1:WEB-700-configuration-form-allows-negative-number-values
Open

WEB-700 Configuration Form Allows Negative Number Values#3131
JaySoni1 wants to merge 1 commit intoopenMF:devfrom
JaySoni1:WEB-700-configuration-form-allows-negative-number-values

Conversation

@JaySoni1
Copy link
Contributor

@JaySoni1 JaySoni1 commented Feb 11, 2026

Changes Made :-

-Prevented negative values in the configuration "Number Value" field by enforcing a minimum value of zero.

WEB-700

Before :-

image

After :-

image

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced validation for configuration value fields to prevent negative numeric inputs. The system now enforces non-negative values during form submission.

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

The edit configuration component now restricts the "value" field to non-negative numbers by adding validation constraints in both the HTML template and TypeScript component class.

Changes

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@alberto-art3ch alberto-art3ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I think a Global Configuration cloud have a negative value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, @alberto-art3ch, what should we do about this?

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