Makes disabled checks more secure

This commit is contained in:
apapachristou 2019-10-31 13:08:00 +02:00
parent 9d284e8060
commit 9ef7f7cb40
3 changed files with 3 additions and 3 deletions

View File

@ -84,7 +84,7 @@
<app-dataset-external-references-editor-component [formGroup]="formGroup" [viewOnly]="viewOnly"></app-dataset-external-references-editor-component>
</form>
</mat-tab>
<mat-tab [disabled]="isNew && (formGroup.get('profile').disabled || formGroup.get('profile').invalid)">
<mat-tab [disabled]="isNew && (formGroup.get('profile').disabled || !(formGroup.get('profile').valid))">
<ng-template mat-tab-label>
<div class="d-flex">
<mat-icon class="mr-2">library_books</mat-icon>

View File

@ -396,7 +396,7 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
public isSemiFormValid(formGroup: FormGroup): boolean {
var isValid: boolean = true;
Object.keys(formGroup.controls).forEach(controlName => {
if (controlName != 'datasetProfileDefinition' && formGroup.get(controlName).invalid) {
if (controlName != 'datasetProfileDefinition' && !(formGroup.get(controlName).valid)) {
isValid = false;
}
});

View File

@ -32,7 +32,7 @@
</div>
<div class="navigation-buttons-container">
<button matStepperPrevious mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button class="float-right" [disabled]="this.formGroup.get('dmp').get('datasetProfile').invalid" matStepperNext mat-raised-button color="primary">
<button class="float-right" [disabled]="!(this.formGroup.get('dmp').get('datasetProfile').valid)" matStepperNext mat-raised-button color="primary">
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.NEXT' | translate}}
</button>
</div>