Skip to content

Commit

Permalink
fix: fix scale value to avoid nullity
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 20, 2023
1 parent 326ef4b commit 2c8f0b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apps/datafeeder/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -76,6 +77,7 @@ export function apiConfigurationFactory() {
MatIconModule,
UtilI18nModule,
FeatureEditorModule,
BrowserAnimationsModule,
ApiModule.forRoot(apiConfigurationFactory),
TranslateModule.forRoot(TRANSLATE_DEFAULT_CONFIG),
StoreModule.forRoot({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
AfterViewInit,
ChangeDetectorRef,
Component,
Input,
OnDestroy,
Expand Down Expand Up @@ -103,15 +104,20 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy {
return data ? new Date(Number(data)) : new Date()
}
case WizardFieldType.DROPDOWN: {
//TODO called continuously
return data ? JSON.parse(data) : this.dropdownChoices[0]?.value
}
}
}

constructor(private wizardService: WizardService) {}
constructor(
private wizardService: WizardService,
private cdr: ChangeDetectorRef
) {}

ngAfterViewInit() {
this.initializeListeners()
this.cdr.detectChanges()
}

ngOnDestroy() {
Expand Down Expand Up @@ -196,6 +202,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(
Expand Down

0 comments on commit 2c8f0b8

Please sign in to comment.