From d10d2c12b7296775221669724a42a41d434173a8 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 27 Jul 2023 16:15:38 +0100 Subject: [PATCH] Add source types for Core Material --- app/src/api/config/dataFields.ts | 8 +++++ .../building/data-containers/construction.tsx | 29 +++++++++++++++++++ app/src/frontend/config/data-fields-config.ts | 13 +++++++++ migrations/044.construction_updates.down.sql | 5 +++- migrations/044.construction_updates.up.sql | 5 +++- 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 9c5de64a..a14a1b4f 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -270,6 +270,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + construction_core_material_source_type: { + edit: true, + verify: true, + }, + construction_core_material_source_links: { + edit: true, + verify: true, + }, construction_secondary_materials: { edit: false, }, diff --git a/app/src/frontend/building/data-containers/construction.tsx b/app/src/frontend/building/data-containers/construction.tsx index e3a1e4a0..1111b606 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -241,6 +241,35 @@ const ConstructionView: React.FunctionComponent = (props) => user_verified_as={props.user_verified.construction_core_material} verified_count={props.building.verified.construction_core_material} /> + + {(props.building.construction_core_material_source_type == commonSourceTypes[0] || + props.building.construction_core_material_source_type == commonSourceTypes[1] || + props.building.construction_core_material_source_type == null) ? <> : + <> + + + }