Skip to content

Commit

Permalink
['Редагування закладу' page] 'Далі' button stays enabled when mandato…
Browse files Browse the repository at this point in the history
…ry field is empty #905 (#953)

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix
  • Loading branch information
Olya-web7 authored Feb 21, 2022
1 parent 8af0c53 commit 25a20b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ <h3 class="wrapper-title">{{(editMode) ? 'РЕДАГУВАННЯ ЗАКЛАДУ'
<div fxLayout="row" fxLayoutAlign="center center" class="footer">
<a [routerLink]="'/personal-cabinet/workshops'"><button mat-raised-button
class="btn btn-cancel">Скасувати</button></a>
<button class="btn" mat-raised-button matStepperNext (click)="checkValidation(InfoFormGroup)">Далі</button>
<button class="btn"
mat-raised-button matStepperNext
(click)="checkValidation(InfoFormGroup)"
[disabled]="checkEmpty(InfoFormGroup)"
>Далі</button>
</div>
</mat-step>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { CreateFormComponent } from '../../create-form/create-form.component';
export class CreateProviderComponent extends CreateFormComponent implements OnInit, AfterViewInit, OnDestroy {
provider: Provider;
isAgreed: boolean;
isNotRobot: boolean;
isNotRobot: boolean;

InfoFormGroup: FormGroup;
ActualAddressFormGroup: FormGroup;
Expand All @@ -55,6 +55,7 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn
this.AgreementFormControl.valueChanges.pipe(
takeUntil(this.destroy$),
).subscribe((val: boolean) => this.isAgreed = val);

}

ngAfterViewInit(): void {
Expand Down Expand Up @@ -137,7 +138,6 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn
this.subscribeOnDirtyForm(form);
}


/**
* This method receives a form and marks each control of this form as touched
* @param FormGroup form
Expand All @@ -148,6 +148,9 @@ export class CreateProviderComponent extends CreateFormComponent implements OnIn
});
}

checkEmpty(form: FormGroup): boolean {
return (form?.value.fullTitle === '');
}
/**
* This method marks each control of form in the array of forms in ContactsFormGroup as touched
*/
Expand Down

0 comments on commit 25a20b2

Please sign in to comment.