diff --git a/CHANGELOG.md b/CHANGELOG.md index 61078d85..0e439e2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/backend/tests/test_sprint205_agricultural_parcel_history.py b/backend/tests/test_sprint205_agricultural_parcel_history.py index 3523058c..ae172f0b 100644 --- a/backend/tests/test_sprint205_agricultural_parcel_history.py +++ b/backend/tests/test_sprint205_agricultural_parcel_history.py @@ -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: diff --git a/frontend/src/components/datasets/SourceCatalogPanel.tsx b/frontend/src/components/datasets/SourceCatalogPanel.tsx index 57233fa6..9b57cb7e 100644 --- a/frontend/src/components/datasets/SourceCatalogPanel.tsx +++ b/frontend/src/components/datasets/SourceCatalogPanel.tsx @@ -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
{theme.label} - {theme.source ? theme.source.replaceAll('_', ' ') : 'Nog niet ingeladen'} + {theme.source ?? 'Nog niet ingeladen'}
{theme.datasetCount > 0 ? 'Beschikbaar' : 'Ontbreekt'}

{timelineSummary( diff --git a/frontend/src/lib/datasetDisplay.ts b/frontend/src/lib/datasetDisplay.ts index 93a8be5d..ea408047 100644 --- a/frontend/src/lib/datasetDisplay.ts +++ b/frontend/src/lib/datasetDisplay.ts @@ -7,15 +7,22 @@ const DATASET_LABEL_BY_LAYER: Record = { 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 = { 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 {