From d3f1669fb45e6bbb09c5c097dc28d28b38192219 Mon Sep 17 00:00:00 2001 From: Olya Date: Fri, 18 Mar 2022 19:58:53 +0200 Subject: [PATCH] =?UTF-8?q?[Edit=20child]=20The=20'=D0=97=D0=91=D0=95?= =?UTF-8?q?=D0=A0=D0=95=D0=93=D0=A2=D0=98'=20button=20stays=20enabled=20wh?= =?UTF-8?q?en=20mandatory=20'=D0=9F=D0=BE-=D0=B1=D0=B0=D1=82=D1=8C=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=D1=96'=20field=20is=20empty=20#962=20(#974)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enable save btn for empty middleName * enable save btn for empty middleName * fix * fix * fix * fix * fix * fix --- .../create-child/create-child.component.html | 5 +++- .../create-child/create-child.component.ts | 27 +++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/app/shell/personal-cabinet/parent/create-child/create-child.component.html b/src/app/shell/personal-cabinet/parent/create-child/create-child.component.html index dea2fa32f2..ff0eb63f8f 100644 --- a/src/app/shell/personal-cabinet/parent/create-child/create-child.component.html +++ b/src/app/shell/personal-cabinet/parent/create-child/create-child.component.html @@ -35,7 +35,10 @@

{{(editMode) ? 'РЕДАГУВАТИ' : 'ДОДАТИ' diff --git a/src/app/shell/personal-cabinet/parent/create-child/create-child.component.ts b/src/app/shell/personal-cabinet/parent/create-child/create-child.component.ts index 15a00b5559..acb471f553 100644 --- a/src/app/shell/personal-cabinet/parent/create-child/create-child.component.ts +++ b/src/app/shell/personal-cabinet/parent/create-child/create-child.component.ts @@ -69,20 +69,19 @@ export class CreateChildComponent extends CreateFormComponent implements OnInit, if (socialGroups.length === 0) { this.store.dispatch(new GetSocialGroup()); } - }); - - this.AgreementFormControl.valueChanges.pipe( - takeUntil(this.destroy$), - ).subscribe((val: boolean) => this.isAgreed = val); - - this.ChildrenFormArray.valueChanges.pipe( - takeUntil(this.destroy$), - ).subscribe((val: boolean) => { - this.isEmpty = !val[0].lastName || !val[0].firstName || !val[0].middleName; - }); - } - - addNavPath(): void { + }); + + this.AgreementFormControl.valueChanges.pipe( + takeUntil(this.destroy$), + ).subscribe((val: boolean) => this.isAgreed = val); + + this.ChildrenFormArray.valueChanges.pipe( + takeUntil(this.destroy$), + ).subscribe((val: FormGroup) => + this.isEmpty = !val[0].lastName || !val[0].firstName || !val[0].middleName || !val[0].dateOfBirth); + } + + addNavPath(): void { this.store.dispatch(new AddNavPath(this.navigationBarService.creatNavPaths( { name: NavBarName.PersonalCabinetParent, path: '/personal-cabinet/parent/info', isActive: false, disable: false }, { name: this.editMode ? NavBarName.EditInformationAboutChild : NavBarName.AddInformationAboutChild, isActive: false, disable: true },