From 1bde99a8564cdb54ae0b7f6864879b8cb722967d Mon Sep 17 00:00:00 2001 From: Hemanth Kona Date: Thu, 6 Jun 2024 13:20:18 -0400 Subject: [PATCH] EMBCESSMOD-5540: Fix input form of indenty needs form component --- .../needs-assessment/needs-assessment.component.html | 2 +- .../identify-needs/identify-needs.component.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/registrants/src/UI/embc-registrant/src/app/feature-components/needs-assessment/needs-assessment.component.html b/registrants/src/UI/embc-registrant/src/app/feature-components/needs-assessment/needs-assessment.component.html index c1f0a2c49..0f0c04683 100644 --- a/registrants/src/UI/embc-registrant/src/app/feature-components/needs-assessment/needs-assessment.component.html +++ b/registrants/src/UI/embc-registrant/src/app/feature-components/needs-assessment/needs-assessment.component.html @@ -55,7 +55,7 @@
@if (step.stepName === 'Needs') { @if (needsFormLoaded) { - + } } @else { diff --git a/registrants/src/UI/embc-registrant/src/app/sharedModules/forms/needs-assessment-forms/identify-needs/identify-needs.component.ts b/registrants/src/UI/embc-registrant/src/app/sharedModules/forms/needs-assessment-forms/identify-needs/identify-needs.component.ts index bde1c31ba..7bcee2183 100644 --- a/registrants/src/UI/embc-registrant/src/app/sharedModules/forms/needs-assessment-forms/identify-needs/identify-needs.component.ts +++ b/registrants/src/UI/embc-registrant/src/app/sharedModules/forms/needs-assessment-forms/identify-needs/identify-needs.component.ts @@ -24,7 +24,15 @@ import { DialogContent } from 'src/app/core/model/dialog-content.model'; imports: [ReactiveFormsModule, MatCardModule, MatFormFieldModule, MatCheckboxModule, MatRadioModule] }) export default class IdentifyNeedsComponent implements OnInit { - @Input() identifyNeedsForm: UntypedFormGroup = this.formCreationService.createNeedsForm(); + _form: UntypedFormGroup; + + @Input() + set form(form: UntypedFormGroup) { + this._form = form; + this.identifyNeedsForm = form; + } + + identifyNeedsForm: UntypedFormGroup = this.formCreationService.createNeedsForm(); identifyNeedsForm$: Subscription; constructor( @@ -33,7 +41,7 @@ export default class IdentifyNeedsComponent implements OnInit { ) {} ngOnInit(): void { - if (!this.identifyNeedsForm) { + if (!this._form) { this.identifyNeedsForm$ = this.formCreationService.getIndentifyNeedsForm().subscribe((identifyNeedsForm) => { this.identifyNeedsForm = identifyNeedsForm; });