WEB-445 Position Field Should Accept Only Numeric Input in Create Payment Type Form
This commit is contained in:
+4
-1
@@ -23,11 +23,14 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Position' | translate }}</mat-label>
|
||||
<input required matInput formControlName="position" />
|
||||
<input required matInput type="number" min="1" formControlName="position" />
|
||||
<mat-error *ngIf="paymentTypeForm.controls.position.hasError('required')">
|
||||
{{ 'labels.inputs.Position' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
<mat-error *ngIf="paymentTypeForm.controls.position.hasError('min')">
|
||||
{{ 'labels.inputs.Position' | translate }} must be a positive number.
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
+3
-1
@@ -59,7 +59,9 @@ export class CreatePaymentTypeComponent implements OnInit {
|
||||
isCashPayment: [false],
|
||||
position: [
|
||||
'',
|
||||
Validators.required
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(1)]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
+4
-1
@@ -23,7 +23,10 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>{{ 'labels.inputs.Position' | translate }}</mat-label>
|
||||
<input required matInput formControlName="position" />
|
||||
<input required matInput type="number" min="1" formControlName="position" />
|
||||
<mat-error *ngIf="paymentTypeForm.controls.position.hasError('min')">
|
||||
{{ 'labels.inputs.Position' | translate }} must be a positive number.
|
||||
</mat-error>
|
||||
<mat-error *ngIf="paymentTypeForm.controls.position.hasError('required')">
|
||||
{{ 'labels.inputs.Position' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
|
||||
@@ -66,7 +66,9 @@ export class EditPaymentTypeComponent implements OnInit {
|
||||
isCashPayment: [this.paymentTypeData.isCashPayment],
|
||||
position: [
|
||||
this.paymentTypeData.position,
|
||||
Validators.required
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(1)]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user