From 0db7ceb4e9a45f4d7bbef29e55a049709c39456d Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 3 Aug 2023 15:12:12 +0100 Subject: [PATCH 1/7] Move Attachment Form Options to be consistent with the rest of the code --- app/src/frontend/building/data-containers/typology.tsx | 9 +-------- app/src/frontend/config/data-fields-config.ts | 6 ++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/frontend/building/data-containers/typology.tsx b/app/src/frontend/building/data-containers/typology.tsx index 7ccc6854..736f418e 100644 --- a/app/src/frontend/building/data-containers/typology.tsx +++ b/app/src/frontend/building/data-containers/typology.tsx @@ -13,13 +13,6 @@ import { DataEntryGroup } from '../data-components/data-entry-group'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import { useDisplayPreferences } from '../../displayPreferences-context'; -const AttachmentFormOptions = [ - "Detached", - "Semi-Detached", - "End-Terrace", - "Mid-Terrace" -]; - /** * Type view/edit section */ @@ -290,7 +283,7 @@ const TypeView: React.FunctionComponent = (props) => { slug="building_attachment_form" value={props.building.building_attachment_form} tooltip={dataFields.building_attachment_form.tooltip} - options={AttachmentFormOptions} + options={dataFields.building_attachment_form.items} mode={props.mode} copy={props.copy} onChange={props.onChange} diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 9bc3deb0..66f913ec 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -314,6 +314,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ title: "Which description best explains the way the building is attached to others?", tooltip: "We have prepopulated these based on their current attachment. A building can either be detached, semi-detached or part of a terrace (middle or end)", example: "", + items: [ + "Detached", + "Semi-Detached", + "End-Terrace", + "Mid-Terrace" + ] }, building_attachment_source_type: { category: Category.Age, From 602449cf58f9e9630a6cb17f7dd6e8927b05b88f Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 3 Aug 2023 16:42:12 +0100 Subject: [PATCH 2/7] Add Original Land Use (Order) to Key Copied code from Current Land Use (Land Use Category) to automatically calculate the Land Use Order for Original Land Use and then visualise it on the map. #1219 --- app/map_styles/polygon.xml | 77 +++++++++++++++++++ app/src/api/config/dataFields.ts | 8 ++ .../domainLogic/processBuildingUpdate.ts | 36 ++++++++- app/src/frontend/building/data-container.tsx | 11 ++- .../building/data-containers/land-use.tsx | 1 + .../building/data-containers/typology.tsx | 34 ++++++++ .../frontend/config/category-maps-config.ts | 23 ++++++ app/src/frontend/config/data-fields-config.ts | 11 +++ app/src/frontend/config/tileserver-config.ts | 1 + app/src/tiles/dataDefinition.ts | 9 +++ migrations/045.typology_changes.down.sql | 2 + migrations/045.typology_changes.up.sql | 9 +++ 12 files changed, 220 insertions(+), 2 deletions(-) create mode 100644 migrations/045.typology_changes.down.sql create mode 100644 migrations/045.typology_changes.up.sql diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index 40fb04db..5023f6aa 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -913,6 +913,83 @@ +