From 59d5b8229d8e3e71832ec8c9aebc6512f8315656 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Wed, 17 Jan 2024 12:10:36 -0600 Subject: [PATCH 1/3] lmendoza/batch-fixes-17-jan-2024 --- src/app/register2/components/BaseForm.ts | 2 ++ .../form-current-employment.component.html | 3 +-- .../components/step-c/step-c.component.ts | 2 +- .../components/step-c2/step-c2.component.html | 2 +- .../components/step-c2/step-c2.component.ts | 17 ++++++++++++++++- .../pages/register/register2.component.html | 14 +++++++++++--- .../properties/register/register.en.properties | 3 ++- 7 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/app/register2/components/BaseForm.ts b/src/app/register2/components/BaseForm.ts index 67888b5de5..bcef75dab2 100644 --- a/src/app/register2/components/BaseForm.ts +++ b/src/app/register2/components/BaseForm.ts @@ -14,6 +14,8 @@ export abstract class BaseForm implements ControlValueAccessor, AsyncValidator { constructor() {} writeValue(val: any): void { if (val != null && val !== undefined && val !== '') { + console.log('ok lets go', this.form.value) + this.form.setValue(val, { emitEvent: true }) // Trigger registerOnChange custom function by calling form.updateValueAndValidity // require since most form controls extending this class diff --git a/src/app/register2/components/form-current-employment/form-current-employment.component.html b/src/app/register2/components/form-current-employment/form-current-employment.component.html index bb8c59505e..87b38031f4 100644 --- a/src/app/register2/components/form-current-employment/form-current-employment.component.html +++ b/src/app/register2/components/form-current-employment/form-current-employment.component.html @@ -113,8 +113,7 @@

*ngIf="selectedOrganizationFromDatabase && displayOrganizationHint" > {{ selectedOrganizationFromDatabase.value }}, - {{ selectedOrganizationFromDatabase.city }} - , {{ selectedOrganizationFromDatabase.country }} diff --git a/src/app/register2/components/step-c/step-c.component.ts b/src/app/register2/components/step-c/step-c.component.ts index a32fb53ab2..4060b11ccd 100644 --- a/src/app/register2/components/step-c/step-c.component.ts +++ b/src/app/register2/components/step-c/step-c.component.ts @@ -4,7 +4,7 @@ import { ReactivationLocal } from '../../../types/reactivation.local' import { BaseStepDirective } from '../BaseStep' @Component({ - selector: 'app-step-ct', + selector: 'app-step-c', templateUrl: './step-c.component.html', styleUrls: [ './step-c.component.scss', diff --git a/src/app/register2/components/step-c2/step-c2.component.html b/src/app/register2/components/step-c2/step-c2.component.html index 9d6e987733..275b224da2 100644 --- a/src/app/register2/components/step-c2/step-c2.component.html +++ b/src/app/register2/components/step-c2/step-c2.component.html @@ -72,7 +72,7 @@

id="step-c-back-button" (click)="optionalNextStep()" > - + Skip this step without adding an affiliation diff --git a/src/app/register2/components/step-c2/step-c2.component.ts b/src/app/register2/components/step-c2/step-c2.component.ts index 60190ec2ec..cef6911ad5 100644 --- a/src/app/register2/components/step-c2/step-c2.component.ts +++ b/src/app/register2/components/step-c2/step-c2.component.ts @@ -2,6 +2,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core' import { ReactivationLocal } from '../../../types/reactivation.local' import { BaseStepDirective } from '../BaseStep' +import { FormBuilder, FormGroup } from '@angular/forms' @Component({ selector: 'app-step-c2', @@ -18,11 +19,25 @@ export class StepC2Component extends BaseStepDirective { nextButtonWasClicked: boolean @Output() formGroupStepC2OptionalChange = new EventEmitter() - constructor() { + constructor(private _formBuilder: FormBuilder) { super() } optionalNextStep() { + console.log(this.formGroup.value) + this.formGroup.setValue({ + affiliations: { + organization: '', + departmentName: '', + roleTitle: '', + startDateGroup: { + startDateMonth: '', + startDateYear: '', + }, + }, + }) + console.log(this.formGroup.value) + this.formGroupStepC2OptionalChange.emit(true) this.nextButtonWasClicked = true } diff --git a/src/app/register2/pages/register/register2.component.html b/src/app/register2/pages/register/register2.component.html index 92997ab286..4b753714ef 100644 --- a/src/app/register2/pages/register/register2.component.html +++ b/src/app/register2/pages/register/register2.component.html @@ -35,9 +35,6 @@ [stepControl]="FormGroupStepC2" [optional]="formGroupStepC2Optional" > - Visibility and terms + + Visibility and terms + + Visibility and terms Date: Wed, 17 Jan 2024 12:12:04 -0600 Subject: [PATCH 2/3] lmendoza/batch-fixes-17-jan-2024 --- src/app/register2/components/BaseForm.ts | 2 -- src/locale/properties/register/register.en.properties | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app/register2/components/BaseForm.ts b/src/app/register2/components/BaseForm.ts index bcef75dab2..67888b5de5 100644 --- a/src/app/register2/components/BaseForm.ts +++ b/src/app/register2/components/BaseForm.ts @@ -14,8 +14,6 @@ export abstract class BaseForm implements ControlValueAccessor, AsyncValidator { constructor() {} writeValue(val: any): void { if (val != null && val !== undefined && val !== '') { - console.log('ok lets go', this.form.value) - this.form.setValue(val, { emitEvent: true }) // Trigger registerOnChange custom function by calling form.updateValueAndValidity // require since most form controls extending this class diff --git a/src/locale/properties/register/register.en.properties b/src/locale/properties/register/register.en.properties index fdef023ef6..0cceeb0a9e 100644 --- a/src/locale/properties/register/register.en.properties +++ b/src/locale/properties/register/register.en.properties @@ -210,4 +210,4 @@ register.rolePlaceholder=Your role or job in the organization register.yearPlaceholder=Year register.monthPlaceholder=Month register.clearOrganization=Clear organization -shared.skipThisStepWithoutAddingAnAffiliation=Skip this step without adding an affiliation \ No newline at end of file +shared.skipThisStepWithoutAddingAnAffiliation=Skip this step without adding an affiliation From a23af9d3ea9989e6beb758196d812b1d6b8fdb76 Mon Sep 17 00:00:00 2001 From: Leonardo Mendoza Fernadez Date: Wed, 17 Jan 2024 12:12:33 -0600 Subject: [PATCH 3/3] lmendoza/batch-fixes-17-jan-2024 --- src/app/register2/components/step-c2/step-c2.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/register2/components/step-c2/step-c2.component.ts b/src/app/register2/components/step-c2/step-c2.component.ts index cef6911ad5..76f28bdae3 100644 --- a/src/app/register2/components/step-c2/step-c2.component.ts +++ b/src/app/register2/components/step-c2/step-c2.component.ts @@ -24,7 +24,6 @@ export class StepC2Component extends BaseStepDirective { } optionalNextStep() { - console.log(this.formGroup.value) this.formGroup.setValue({ affiliations: { organization: '', @@ -36,7 +35,6 @@ export class StepC2Component extends BaseStepDirective { }, }, }) - console.log(this.formGroup.value) this.formGroupStepC2OptionalChange.emit(true) this.nextButtonWasClicked = true