fix: simplify official source labels
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-15 15:59:14 +02:00
parent 312400759f
commit 6b996d42f5
4 changed files with 15 additions and 2 deletions
+2
View File
@@ -22,6 +22,8 @@
- Added focused source, clipping, metric, pagination, packaging and UI tests.
- Added compatibility for the official comma-separated grain and horticulture
group labels after live source validation exposed their exact wording.
- Replaced internal agriculture/BWK/Waterinfo source identifiers with concise
authority labels in the shared end-user dataset display path.
## Sprint 204 Governed BWK and Natura 2000 for Mol (2026-07-15)
@@ -263,6 +263,7 @@ def test_operator_uses_canonical_upload_and_is_packaged_for_runtime() -> None:
readiness = (ROOT / "scripts" / "run_readiness_check.sh").read_text(encoding="utf-8")
map_workspace = (ROOT / "frontend" / "src" / "components" / "map" / "MapWorkspace.tsx").read_text(encoding="utf-8")
source_catalog = (ROOT / "frontend" / "src" / "components" / "datasets" / "SourceCatalogPanel.tsx").read_text(encoding="utf-8")
dataset_display = (ROOT / "frontend" / "src" / "lib" / "datasetDisplay.ts").read_text(encoding="utf-8")
assert "/datasets/upload" in operator
assert "VectorFeature" not in operator
@@ -273,6 +274,8 @@ def test_operator_uses_canonical_upload_and_is_packaged_for_runtime() -> None:
assert "py_compile scripts/provision_agricultural_parcel_history.py" in readiness
assert "id: 'agriculture'" in map_workspace
assert "Landbouwgebruikspercelen" in source_catalog
assert "agriculture: 'Landbouwgebruikspercelen'" in dataset_display
assert "agentschap_landbouw_zeevisserij_agricultural_parcels: 'Agentschap Landbouw en Zeevisserij'" in dataset_display
def test_upload_contract_is_annual_definitive_and_scope_specific(tmp_path: Path) -> None:
@@ -1,4 +1,5 @@
import type { DatasetCreateResponse } from '../../types'
import { getDatasetSourceDisplayName } from '../../lib/datasetDisplay'
interface SourceCatalogPanelProps {
datasets: DatasetCreateResponse[]
@@ -139,7 +140,7 @@ export function SourceCatalogPanel({ datasets }: SourceCatalogPanelProps): JSX.E
otherMethodCount: matches.length - comparableObservations.length,
firstYear: years.length ? Math.min(...years) : null,
lastYear: years.length ? Math.max(...years) : null,
source: latest?.source_name ?? latest?.source ?? null,
source: latest ? getDatasetSourceDisplayName(latest) : null,
}
})
@@ -159,7 +160,7 @@ export function SourceCatalogPanel({ datasets }: SourceCatalogPanelProps): JSX.E
<article className="source-catalog-card" key={theme.theme}>
<div>
<strong>{theme.label}</strong>
<span>{theme.source ? theme.source.replaceAll('_', ' ') : 'Nog niet ingeladen'}</span>
<span>{theme.source ?? 'Nog niet ingeladen'}</span>
</div>
<b>{theme.datasetCount > 0 ? 'Beschikbaar' : 'Ontbreekt'}</b>
<p>{timelineSummary(
+7
View File
@@ -7,15 +7,22 @@ const DATASET_LABEL_BY_LAYER: Record<string, string> = {
parcels: 'Percelen',
population: 'Bevolking',
forest: 'Bos en groen',
nature_value: 'Natuurwaarde',
agriculture: 'Landbouwgebruikspercelen',
regional_boundary: 'Grens vervoerregio Kempen',
municipality_boundaries: 'Gemeentegrenzen Kempen',
}
const DATASET_SOURCE_LABELS: Record<string, string> = {
department_omgeving_land_use: 'Departement Omgeving',
agentschap_landbouw_zeevisserij_agricultural_parcels: 'Agentschap Landbouw en Zeevisserij',
digitaal_vlaanderen_orthophoto: 'Digitaal Vlaanderen',
grb: 'GRB',
historical_landuse: 'Digitaal Vlaanderen',
inbo_bwk_natura2000: 'INBO',
statbel: 'Statbel',
vrbg: 'Digitaal Vlaanderen',
waterinfo: 'Waterinfo Vlaanderen',
}
export function getDatasetSourceDisplayName(dataset: DatasetCreateResponse): string {