Select usable Flanders theme by default
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-17 18:37:40 +02:00
parent ce597ee0b4
commit c28958d9c7
2 changed files with 36 additions and 0 deletions
@@ -17,6 +17,8 @@ def test_flanders_workspace_exposes_governed_thematic_products_on_demand() -> No
assert "activeScopeProject?.name === FLANDERS_WORKSPACE_PROJECT_NAME" in workspace
assert "new Map<DataThemeId, ThematicRasterProductRead>" in workspace
assert "'Op aanvraag'" in workspace
assert "theme.id === 'space_occupation'" in workspace
assert "setActiveThemeId(fallbackTheme.id)" in workspace
assert "thematicProductKey: thematicProduct.key" in workspace
assert "datasetsApi.listThematicRasterProducts" in product_hook
assert "datasetsApi.acquireThematicRaster" in selection_hook
@@ -790,6 +790,40 @@ export function MapWorkspace({
const onDemandThematicThemeActive = analysisMode === 'current' && Boolean(activeOnDemandThematicProduct)
const regionalOnDemandThematicThemeActive = regionalScopeSelected && onDemandThematicThemeActive
const activeThemeAvailable = Boolean(activeThemeDataset) || onDemandThematicThemeActive
useEffect(() => {
if (
!flandersScopeSelected
|| analysisMode !== 'current'
|| activeThemeAvailable
|| (onDemandThematicProductMap.size === 0 && !thematicRasterProductsError)
) {
return
}
const fallbackTheme = DATA_THEMES.find((theme) =>
theme.id === 'space_occupation'
&& Boolean(themeDatasetMap[theme.id] || onDemandThematicProductMap.get(theme.id)),
) ?? DATA_THEMES.find((theme) =>
Boolean(themeDatasetMap[theme.id] || onDemandThematicProductMap.get(theme.id)),
)
if (!fallbackTheme) {
return
}
setActiveThemeId(fallbackTheme.id)
const fallbackDataset = themeDatasetMap[fallbackTheme.id]
if (fallbackDataset) {
onOpenDatasetInMap(fallbackDataset)
}
}, [
activeThemeAvailable,
analysisMode,
flandersScopeSelected,
onDemandThematicProductMap,
onOpenDatasetInMap,
thematicRasterProductsError,
themeDatasetMap,
])
const terrainImageOverlays = useMemo(
() =>
activeTheme.id === 'elevation' && selectedProjectId