From b326551d309ed09cdddbae364d8ef0ebec84cd0f Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 27 Jul 2023 15:48:01 +0100 Subject: [PATCH] Add fields to Materials section --- app/src/api/config/dataFields.ts | 38 +++++ .../building/data-containers/construction.tsx | 144 ++++++++++++++++++ app/src/frontend/config/data-fields-config.ts | 93 +++++++++++ migrations/044.construction_updates.down.sql | 12 ++ migrations/044.construction_updates.up.sql | 14 +- 5 files changed, 300 insertions(+), 1 deletion(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index b868bd07..9c5de64a 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -349,6 +349,44 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + construction_external_wall: { + edit: true, + verify: true, + }, + construction_external_wall_source_type: { + edit: true, + verify: true, + }, + construction_external_wall_source_links: { + edit: true, + verify: true, + }, + construction_internal_wall: { + edit: true, + verify: true, + }, + construction_internal_wall_source_type: { + edit: true, + verify: true, + }, + construction_internal_wall_source_links: { + edit: true, + verify: true, + }, + construction_ground_floor: { + edit: true, + verify: true, + }, + construction_ground_floor_source_type: { + edit: true, + verify: true, + }, + construction_ground_floor_source_links: { + edit: true, + verify: true, + }, + + planning_portal_link: { edit: true, verify: true, diff --git a/app/src/frontend/building/data-containers/construction.tsx b/app/src/frontend/building/data-containers/construction.tsx index 63416966..e3a1e4a0 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -242,6 +242,150 @@ const ConstructionView: React.FunctionComponent = (props) => verified_count={props.building.verified.construction_core_material} />
+ + + + {(props.building.construction_external_wall_source_type == commonSourceTypes[0] || + props.building.construction_external_wall_source_type == commonSourceTypes[1] || + props.building.construction_external_wall_source_type == null) ? <> : + <> + + + } +
+ + + + {(props.building.construction_internal_wall_source_type == commonSourceTypes[0] || + props.building.construction_internal_wall_source_type == commonSourceTypes[1] || + props.building.construction_internal_wall_source_type == null) ? <> : + <> + + + } +
+ + + + {(props.building.construction_ground_floor_source_type == commonSourceTypes[0] || + props.building.construction_ground_floor_source_type == commonSourceTypes[1] || + props.building.construction_ground_floor_source_type == null) ? <> : + <> + + + } +