WEB-682 Add validation to prevent negative values in Code Value Position field
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
matInput
|
||||
formControlName="position"
|
||||
type="number"
|
||||
min="0"
|
||||
placeholder="{{ 'labels.inputs.Position' | translate }}"
|
||||
/>
|
||||
@if (codeValues.at(i).controls.position.hasError('required')) {
|
||||
|
||||
@@ -136,8 +136,11 @@ export class ViewCodeComponent implements OnInit {
|
||||
],
|
||||
description: [{ value: codeValue ? codeValue.description : '', disabled: true }],
|
||||
position: [
|
||||
{ value: codeValue ? codeValue.position : 0, disabled: true },
|
||||
Validators.required
|
||||
{ value: codeValue ? codeValue.position : '', disabled: true },
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(0)
|
||||
]
|
||||
],
|
||||
isActive: [{ value: codeValue ? codeValue.active : false, disabled: true }]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user