From 68c7a6d4b615bddedb0a94e3adca88a307c32ee1 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sun, 27 Sep 2026 05:14:56 +0000 Subject: [PATCH] Kit 4d-2: useDashboardData moves to the library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 82 lines, one importer (useDashboardShell), and every import already @map/ — so it moves as-is with no adapter and no shim. Its inject('profileConfig') stays inside its try/catch: it can be called from outside setup, and that is the property the move had to preserve. Source only. research-dashboard and dashboard-plus-grid need a rebuild. --- documentation/reference-library-index.md | 2 ++ .../src => library}/composables/useDashboardData.js | 4 ++++ .../research-dashboard/src/composables/useDashboardShell.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) rename {plugin-designs/research-dashboard/src => library}/composables/useDashboardData.js (93%) diff --git a/documentation/reference-library-index.md b/documentation/reference-library-index.md index 2c97b9aa0..ec497ef9b 100644 --- a/documentation/reference-library-index.md +++ b/documentation/reference-library-index.md @@ -135,6 +135,8 @@ and a change here can break other maps. `import … from '@map/composables/useCountryOutline.js'` - **useCsvExport** — useCsvExport.js — ★ SHARED LIBRARY CODE (dashboard-kit landing 3). Two parameters make it `import … from '@map/composables/useCsvExport.js'` +- **useDashboardData** — useDashboardData.js — RDASH phase 2: the single in-memory row store (kills the hardcode). + `import … from '@map/composables/useDashboardData.js'` - **useDashboardLayout** — useDashboardLayout.js — reusable drag-resize + persistence engine for the CMV dashboard grid. `import … from '@map/composables/useDashboardLayout.js'` - **useDashboardSearch** — useDashboardSearch.js — the ONE free-text search the whole dashboard shares. diff --git a/plugin-designs/research-dashboard/src/composables/useDashboardData.js b/library/composables/useDashboardData.js similarity index 93% rename from plugin-designs/research-dashboard/src/composables/useDashboardData.js rename to library/composables/useDashboardData.js index f28fd4767..62a1c86a7 100644 --- a/plugin-designs/research-dashboard/src/composables/useDashboardData.js +++ b/library/composables/useDashboardData.js @@ -11,6 +11,10 @@ * * Shadow-DOM safe: pure data, no DOM/style. Reuses read-only @map config without editing it. */ +// KIT LANDING 4d-2: moved from plugin-designs/research-dashboard/src/composables/. It needed no +// adapter — every import was already @map/ — and it injects profileConfig in a try/catch because it +// can be called outside setup, which is the one property the move had to preserve. + import { ref, shallowRef, inject } from 'vue' import { getApiBaseUrl } from '@map/api/apiBaseUrl.js' import sourcesConfig from '@map/api/sources.json' diff --git a/plugin-designs/research-dashboard/src/composables/useDashboardShell.js b/plugin-designs/research-dashboard/src/composables/useDashboardShell.js index 0cd5a9c70..f1fce9e7d 100644 --- a/plugin-designs/research-dashboard/src/composables/useDashboardShell.js +++ b/plugin-designs/research-dashboard/src/composables/useDashboardShell.js @@ -26,7 +26,7 @@ import { exactMatches, fuzzyMatches, resolveFuzzyValues } from '@map/components/search/fuzzy.js' import { provide, inject, ref, computed, watch, onMounted, onBeforeUnmount } from 'vue' import { createSelectionBus } from '@map/composables/useSelectionBus.js' -import { useDashboardData } from './useDashboardData.js' +import { useDashboardData } from '@map/composables/useDashboardData.js' import { useCsvExport } from '@map/composables/useCsvExport.js' import { buildSearchAccessors, makeSearchMatcher, filterRowsBySearch } from '@map/composables/useDashboardSearch.js' import { formatCount } from '@map/utils/formatCount.js'