From 31c5e0cb5271a2a283f9f97d4613ccc5560dfd01 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Fri, 15 Dec 2023 13:49:13 +0100 Subject: [PATCH] Aw3998 Add click --- projects/common-map/src/fm-map/actions/map.actions.ts | 8 ++++++++ .../components/feature-list/feature-list.component.ts | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/common-map/src/fm-map/actions/map.actions.ts b/projects/common-map/src/fm-map/actions/map.actions.ts index 9c23f4f..5225421 100644 --- a/projects/common-map/src/fm-map/actions/map.actions.ts +++ b/projects/common-map/src/fm-map/actions/map.actions.ts @@ -18,6 +18,7 @@ export const SETPARENT = '[Map] SetParent'; export const SETPERIOD = '[Map] SetPeriod'; export const STARTSEARCH = '[Map] StartSearch'; export const STARTSEARCHSUCCESS = '[Map] StartSearchSuccess'; +export const CLICKFEATURE = '[Map] ClickFeature'; export const SELECTFEATURE = '[Map] SelectFeature'; export const SELECTITEM = '[Map] SelectItem'; export const SELECTITEMSUCCESS = '[Map] SelectItemSuccess'; @@ -112,6 +113,12 @@ export class StartSearchSuccess implements Action { constructor(public features: Array>, public query:IQueryState) { } } +export class ClickFeature implements Action { + readonly type = CLICKFEATURE; + + constructor(public feature:Feature) { } +} + export class SelectFeature implements Action { readonly type = SELECTFEATURE; @@ -341,6 +348,7 @@ export type Actions = SetMapState | SetParent | StartSearch | StartSearchSuccess + | ClickFeature | SelectFeature | SelectItem | SelectItemSuccess diff --git a/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts b/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts index d81bdcf..4f359df 100644 --- a/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts +++ b/projects/common-map/src/fm-map/components/feature-list/feature-list.component.ts @@ -23,8 +23,9 @@ export abstract class AbstractFeatureListComponent { handleFeatureClick(feature:Feature) { if(feature) { + this.store.dispatch(new mapActions.ClickFeature(feature)); const action = this.getAction(feature); - this.store.dispatch(action); + this.store.dispatch(action); } }