From fbb9f942c4b75be1a885b66c59d130f991e5c19b Mon Sep 17 00:00:00 2001 From: Mark Fee Date: Tue, 4 Aug 2026 10:39:18 +0100 Subject: [PATCH 1/3] IM-417 Fixed issue when all keys show in a group, not just checked ones --- plugins/datasets/src/registry/datasetRegistry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/datasets/src/registry/datasetRegistry.js b/plugins/datasets/src/registry/datasetRegistry.js index c952e042..c6c99373 100644 --- a/plugins/datasets/src/registry/datasetRegistry.js +++ b/plugins/datasets/src/registry/datasetRegistry.js @@ -115,7 +115,7 @@ const datasetRegistry = { type: 'group', groupLabel: dataset.groupLabel, datasets: this.topLevelDatasets() - .filter(groupDataset => (groupDataset.groupLabel === dataset.groupLabel && !groupDataset.hasSublayers && groupDataset.showInKey)) + .filter(groupDataset => (groupDataset.groupLabel === dataset.groupLabel && !groupDataset.hasSublayers && groupDataset.keyVisibility)) }) } else { items.push({ type: 'flat', dataset }) From 89a8dc806b4b37b5bd7aca8537b9f7283d732b76 Mon Sep 17 00:00:00 2001 From: Mark Fee Date: Tue, 4 Aug 2026 13:19:31 +0100 Subject: [PATCH 2/3] IM-417 added a h3 wrapper to the Layers Menu Headings --- plugins/datasets/src/components/LayersMenu/Layers.module.scss | 3 +++ .../src/components/LayersMenu/LayersMenuGroupWrapper.jsx | 4 +++- .../src/components/LayersMenu/LayersRadioGroupWrapper.jsx | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/datasets/src/components/LayersMenu/Layers.module.scss b/plugins/datasets/src/components/LayersMenu/Layers.module.scss index da6b1ba0..f36606e6 100644 --- a/plugins/datasets/src/components/LayersMenu/Layers.module.scss +++ b/plugins/datasets/src/components/LayersMenu/Layers.module.scss @@ -75,6 +75,9 @@ font-size: 1rem; font-weight: bold; color: var(--foreground-color); + h3 { + font-size: inherit; + } } .im-c-datasets-layers-group:first-child .im-c-datasets-layers-group__legend { diff --git a/plugins/datasets/src/components/LayersMenu/LayersMenuGroupWrapper.jsx b/plugins/datasets/src/components/LayersMenu/LayersMenuGroupWrapper.jsx index 912948ac..0dceae16 100644 --- a/plugins/datasets/src/components/LayersMenu/LayersMenuGroupWrapper.jsx +++ b/plugins/datasets/src/components/LayersMenu/LayersMenuGroupWrapper.jsx @@ -7,7 +7,9 @@ export const LayersMenuGroupWrapper = ({ menuGroup, children }) => {
- {menuGroup.groupLabel} +

+ {menuGroup.groupLabel} +

{children}
diff --git a/plugins/datasets/src/components/LayersMenu/LayersRadioGroupWrapper.jsx b/plugins/datasets/src/components/LayersMenu/LayersRadioGroupWrapper.jsx index 9f12b17b..5c1d63fd 100644 --- a/plugins/datasets/src/components/LayersMenu/LayersRadioGroupWrapper.jsx +++ b/plugins/datasets/src/components/LayersMenu/LayersRadioGroupWrapper.jsx @@ -20,7 +20,9 @@ export const LayersRadioGroupWrapper = ({ pluginState, menuGroup }) => {
- {menuGroup.label} +

+ {menuGroup.label} +

{items.map((menuGroupItem) => From bdd75d0338c125e087c665eb7ea2c5bce45c0f40 Mon Sep 17 00:00:00 2001 From: Mark Fee Date: Tue, 4 Aug 2026 13:21:37 +0100 Subject: [PATCH 3/3] IM-417 Make the datasets menu render more quickly --- plugins/datasets/src/adapters/esri/esriLayerAdapter.js | 8 +++++++- .../datasets/src/adapters/esri/esriLayerAdapter.test.js | 1 + plugins/datasets/src/initialise/initialiseDatasets.js | 4 ++-- plugins/datasets/src/reducers/pluginState.js | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/datasets/src/adapters/esri/esriLayerAdapter.js b/plugins/datasets/src/adapters/esri/esriLayerAdapter.js index 12555fd2..f872dfc9 100644 --- a/plugins/datasets/src/adapters/esri/esriLayerAdapter.js +++ b/plugins/datasets/src/adapters/esri/esriLayerAdapter.js @@ -9,6 +9,9 @@ import { logger } from '../../../../../src/services/logger.js' export default class EsriLayerAdapter extends LayerAdapter { constructor (mapProvider) { super() + this.ready = new Promise((resolve) => { + this.resolveReady = resolve + }) this._mapProvider = mapProvider this._map = mapProvider.map @@ -46,6 +49,7 @@ export default class EsriLayerAdapter extends LayerAdapter { // Finally show all layers that are visible based on the dataset/mapStyle visibility await Promise.all(topLevelDatasets.map(registryDataset => this.applyDatasetVisibility(registryDataset.id))) + this.resolveReady() } _addGroupLayer (esriGroupId) { @@ -199,7 +203,9 @@ export default class EsriLayerAdapter extends LayerAdapter { if (!esriStyleLayerId || !vectorTileLayer) { return } - vectorTileLayer.setStyleLayerVisibility(esriStyleLayerId, registryDataset.visibility) + this.ready.then(() => { + vectorTileLayer.setStyleLayerVisibility(esriStyleLayerId, registryDataset.visibility) + }) } _applyStyleLayerPaintProperties (registryDataset, vectorTileLayer) { diff --git a/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js b/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js index 172ef854..16032c73 100644 --- a/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +++ b/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js @@ -56,6 +56,7 @@ describe('esriLayerAdapter', () => { map = makeMap() mapProvider = makeMapProvider(map) adapter = new EsriLayerAdapter(mapProvider, null, null) + adapter.resolveReady() }) // ─── createDataset ─────────────────────────────────────────────────────────── diff --git a/plugins/datasets/src/initialise/initialiseDatasets.js b/plugins/datasets/src/initialise/initialiseDatasets.js index 91b70a1a..3a182c24 100644 --- a/plugins/datasets/src/initialise/initialiseDatasets.js +++ b/plugins/datasets/src/initialise/initialiseDatasets.js @@ -32,6 +32,8 @@ export const initialiseDatasets = ({ datasetRegistry.attach(mappedDatasets, orderedDatasets, mapStyle) const menu = pluginConfig.menu || datasetsToMenu({ datasets: processedDatasets }) setMenuState(buildMenuState(menu)) // Must be called before adapter.init so that menuState is set before any datasets are checked for visibility + dispatch({ type: 'SET_MENU', payload: { menu } }) + dispatch({ type: 'SET_DATASETS', payload: { mappedDatasets, orderedDatasets } }) adapter.init().then(() => { datasetRegistry.forEachDataset(registryDataset => { @@ -48,8 +50,6 @@ export const initialiseDatasets = ({ }) adapter.attachDynamicSources(dynamicSources) // TODO - apply dynamic source defaults here, and include in mappedDatasets - dispatch({ type: 'SET_MENU', payload: { menu } }) - dispatch({ type: 'SET_DATASETS', payload: { datasets: processedDatasets, mappedDatasets, orderedDatasets } }) eventBus.emit('datasets:ready') }) diff --git a/plugins/datasets/src/reducers/pluginState.js b/plugins/datasets/src/reducers/pluginState.js index 8603ce1e..6176bfc6 100755 --- a/plugins/datasets/src/reducers/pluginState.js +++ b/plugins/datasets/src/reducers/pluginState.js @@ -16,6 +16,8 @@ const initialState = { items: [], hasGroups: false }, + mappedDatasets: {}, + orderedDatasets: [], actionsArray: [], menu: [], menuState: {}