From 89607ead6ab3e72a346e55b7dc454612fa93c24a Mon Sep 17 00:00:00 2001 From: Tobias Kohr Date: Fri, 22 Nov 2024 15:04:54 +0100 Subject: [PATCH] refactor(feature-info): rename content to featureInfoPanelContent --- src/components/info/feature-info.composable.ts | 5 +++-- src/components/info/info-panel.vue | 10 ++++++---- src/stores/feature-info.store.ts | 15 ++++++++------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/components/info/feature-info.composable.ts b/src/components/info/feature-info.composable.ts index 52bda872..c825b6be 100644 --- a/src/components/info/feature-info.composable.ts +++ b/src/components/info/feature-info.composable.ts @@ -15,7 +15,8 @@ const INFO_SERVICE_URL = import.meta.env.VITE_GET_INFO_SERVICE_URL export default function useFeatureInfo() { const map = useMap().getOlMap() - const { setContent, setLoading, setInfoPanelHidden } = useFeatureInfoStore() + const { setFeatureInfoPanelContent, setLoading, setInfoPanelHidden } = + useFeatureInfoStore() const { fid } = storeToRefs(useFeatureInfoStore()) const { toggleInfoOpen } = useAppStore() const { findById } = useThemes() @@ -274,7 +275,7 @@ export default function useFeatureInfo() { } featureInfoService.highlightFeatures(lastHighlightedFeatures.value, fit) - setContent(content) + setFeatureInfoPanelContent(content) } function reset(openPanel = false) { diff --git a/src/components/info/info-panel.vue b/src/components/info/info-panel.vue index 3b408ab8..583c4def 100644 --- a/src/components/info/info-panel.vue +++ b/src/components/info/info-panel.vue @@ -8,7 +8,9 @@ import FeatureInfo from '@/components/info/feature-info.vue' const { t } = useTranslation() const appStore = useAppStore() -const { content, isLoading } = storeToRefs(useFeatureInfoStore()) +const { featureInfoPanelContent, isLoading } = storeToRefs( + useFeatureInfoStore() +) diff --git a/src/stores/feature-info.store.ts b/src/stores/feature-info.store.ts index b843bd52..ec5fb220 100644 --- a/src/stores/feature-info.store.ts +++ b/src/stores/feature-info.store.ts @@ -5,22 +5,23 @@ import { shallowRef, ShallowRef } from 'vue' export const useFeatureInfoStore = defineStore( 'featureInfo', () => { - const content: ShallowRef = shallowRef() + const featureInfoPanelContent: ShallowRef = + shallowRef() const fid: ShallowRef = shallowRef() const isLoading: ShallowRef = shallowRef(false) const infoPanelHidden: ShallowRef = shallowRef(false) - function setContent(value: FeatureInfoJSON[]) { + function setFeatureInfoPanelContent(value: FeatureInfoJSON[]) { if (!value || value.length === 0) { - content.value = undefined + featureInfoPanelContent.value = undefined } else { - content.value = [...value] + featureInfoPanelContent.value = [...value] isLoading.value = false } } function clearContent() { - content.value = undefined + featureInfoPanelContent.value = undefined isLoading.value = false } @@ -37,11 +38,11 @@ export const useFeatureInfoStore = defineStore( } return { - content, + featureInfoPanelContent, fid, isLoading, infoPanelHidden, - setContent, + setFeatureInfoPanelContent, clearContent, setFid, setLoading,