WEB-760 Validation and error message improvements for Add Column dialog
This commit is contained in:
@@ -49,9 +49,16 @@
|
||||
matInput
|
||||
required
|
||||
type="number"
|
||||
min="1"
|
||||
formControlName="length"
|
||||
placeholder="{{ 'labels.inputs.Column Length' | translate }}"
|
||||
/>
|
||||
@if (columnForm.controls.length.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Column Length' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
@@ -65,6 +72,12 @@
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
@if (columnForm.controls.code.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Column Code' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,10 @@ export class ColumnDialogComponent implements OnInit {
|
||||
value: this.data ? +this.data.columnLength : '',
|
||||
disabled: this.getColumnType(this.data.columnDisplayType) !== 'String' || this.data.type === 'existing'
|
||||
},
|
||||
Validators.required
|
||||
[
|
||||
Validators.required,
|
||||
Validators.min(1)
|
||||
]
|
||||
],
|
||||
mandatory: [{ value: this.data.isColumnNullable, disabled: this.data.type === 'existing' }],
|
||||
unique: [
|
||||
|
||||
Reference in New Issue
Block a user