Skip to content

Commit

Permalink
Only get component settings id from leaf nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
hvangeffen committed Feb 18, 2025
1 parent 0ee7571 commit 4572518
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
2 changes: 0 additions & 2 deletions src/views/DashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import DashboardDisplay from '@/components/general/DashboardDisplay.vue'
import type { TopologyNode } from '@deltares/fews-pi-requests'
import { useDashboard } from '@/services/useDashboard'
import { configManager } from '@/services/application-config'
import type { ComponentSettings } from '@/lib/topology/componentSettings'
interface Props {
topologyNode?: TopologyNode
settings?: ComponentSettings
}
const props = defineProps<Props>()
Expand Down
23 changes: 3 additions & 20 deletions src/views/TopologyDisplayView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -269,28 +269,11 @@ function updateItems(): void {
watch(subNodes, updateItems)
watch(thresholds, updateItems)
const topologyComponentSettingIds = computed(() => {
if (!topologyNode.value) return []
const ids: string[] = []
let node: TopologyNode | undefined = topologyNode.value
while (node) {
// @ts-expect-error FIXME: Update when the types are updated
const componentSettingsId = node.componentSettingsId as string | undefined
if (componentSettingsId) {
ids.push(componentSettingsId)
}
node = topologyNodesStore.getParentNodeById(node.id)
}
return ids.toReversed()
})
const { componentSettings } = useComponentSettings(baseUrl, () => [
// @ts-expect-error FIXME: Update when the types are updated
topologyComponentConfig.value.componentSettingsId,
...topologyComponentSettingIds.value,
topologyComponentConfig.value?.componentSettingsId,
// @ts-expect-error FIXME: Update when the types are updated
topologyNode.value?.componentSettingsId,
])
// Update the displayTabs if the active node changes (or if the topologyMap changes).
Expand Down

0 comments on commit 4572518

Please sign in to comment.