diff --git a/apps/datafeeder/src/app/app.module.ts b/apps/datafeeder/src/app/app.module.ts index 9af9382362..21237b8d8d 100644 --- a/apps/datafeeder/src/app/app.module.ts +++ b/apps/datafeeder/src/app/app.module.ts @@ -37,6 +37,7 @@ import { SummarizeBackgroundComponent } from './presentation/components/svg/summ import { DATAFEEDER_STATE_KEY, reducer } from './store/datafeeder.reducer' import { FeatureAuthModule } from '@geonetwork-ui/feature/auth' import { MatIconModule } from '@angular/material/icon' +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' export function apiConfigurationFactory() { return new Configuration({ @@ -76,6 +77,7 @@ export function apiConfigurationFactory() { MatIconModule, UtilI18nModule, FeatureEditorModule, + BrowserAnimationsModule, ApiModule.forRoot(apiConfigurationFactory), TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG), StoreModule.forRoot({ diff --git a/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts b/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts index fe45598346..cc945cbd37 100644 --- a/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts +++ b/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts @@ -1,5 +1,7 @@ import { AfterViewInit, + ChangeDetectionStrategy, + ChangeDetectorRef, Component, Input, OnDestroy, @@ -66,6 +68,7 @@ export const MY_FORMATS = { }, { provide: MAT_DATE_FORMATS, useValue: MY_FORMATS }, ], + changeDetection: ChangeDetectionStrategy.OnPush, }) export class WizardFieldComponent implements AfterViewInit, OnDestroy { @Input() wizardFieldConfig: WizardFieldModel @@ -108,10 +111,14 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy { } } - constructor(private wizardService: WizardService) {} + constructor( + private wizardService: WizardService, + private cdr: ChangeDetectorRef + ) {} ngAfterViewInit() { this.initializeListeners() + this.cdr.detectChanges() } ngOnDestroy() { @@ -196,6 +203,17 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy { } private initializeDropdownListener() { + if ( + this.wizardService.getWizardFieldData(this.wizardFieldConfig.id) === + undefined && + !!this.dropdown.selected + ) { + this.wizardService.setWizardFieldData( + this.wizardFieldConfig.id, + this.dropdown.selected + ) + } + this.subs.add( this.dropdown.selectValue.subscribe((value) => { this.wizardService.onWizardWizardFieldDataChanged(