Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scale value to avoid nullity #699

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -81,7 +82,7 @@
return WizardFieldType
}

get dropdownChoices(): any {

Check warning on line 85 in libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts

View workflow job for this annotation

GitHub Actions / Format check, lint, unit tests

Unexpected any. Specify a different type
return this.wizardFieldConfig.options
}

Expand All @@ -103,15 +104,20 @@
return data ? new Date(Number(data)) : new Date()
}
case WizardFieldType.DROPDOWN: {
//TODO called continuously
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you maybe make that clearer? does that mean that this code is executed a lot and that it's undesirable?

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 @@
}

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
Loading