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