From 39a0a01d5753280e2545df5e33207ea0ba76234c Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 27 Jul 2023 14:25:50 +0100 Subject: [PATCH 1/5] Add Structural System Subcategory --- app/src/api/config/dataFields.ts | 48 +++++ .../building/data-containers/construction.tsx | 198 +++++++++++++++++- app/src/frontend/config/data-fields-config.ts | 105 ++++++++++ migrations/044.construction_updates.down.sql | 17 ++ migrations/044.construction_updates.up.sql | 16 ++ 5 files changed, 382 insertions(+), 2 deletions(-) create mode 100644 migrations/044.construction_updates.down.sql create mode 100644 migrations/044.construction_updates.up.sql diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 6a249cb5..8acde159 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -277,6 +277,54 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + construction_structural_system: { + edit: true, + verify: true, + }, + construction_structural_system_source_type: { + edit: true, + verify: true, + }, + construction_structural_system_source_links: { + edit: true, + verify: true, + }, + construction_foundation: { + edit: true, + verify: true, + }, + construction_foundation_source_type: { + edit: true, + verify: true, + }, + construction_foundation_source_links: { + edit: true, + verify: true, + }, + construction_roof_shape: { + edit: true, + verify: true, + }, + construction_roof_shape_source_type: { + edit: true, + verify: true, + }, + construction_roof_shape_source_links: { + edit: true, + verify: true, + }, + construction_irregularities: { + edit: true, + verify: true, + }, + construction_irregularities_source_type: { + edit: true, + verify: true, + }, + construction_irregularities_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 69f709a1..962e9c23 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -1,6 +1,6 @@ import React, { Fragment } from 'react'; -import { dataFields } from '../../config/data-fields-config'; +import { commonSourceTypes, dataFields } from '../../config/data-fields-config'; import DataEntry from '../data-components/data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; import withCopyEdit from '../data-container'; @@ -9,6 +9,7 @@ import Verification from '../data-components/verification'; import { CategoryViewProps } from './category-view-props'; import InfoBox from '../../components/info-box'; import { DataEntryGroup } from '../data-components/data-entry-group'; +import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; const ConstructionMaterialsOptions = [ 'Wood', @@ -38,6 +39,199 @@ const RoofCoveringOptions = [ const ConstructionView: React.FunctionComponent = (props) => { return ( + + + + + {(props.building.construction_structural_system_source_type == commonSourceTypes[0] || + props.building.construction_structural_system_source_type == commonSourceTypes[1] || + props.building.construction_structural_system_source_type == null) ? <> : + <> + + + } +
+ + + + {(props.building.construction_foundation_source_type == commonSourceTypes[0] || + props.building.construction_foundation_source_type == commonSourceTypes[1] || + props.building.construction_foundation_source_type == null) ? <> : + <> + + + } +
+ + + + {(props.building.construction_roof_shape_source_type == commonSourceTypes[0] || + props.building.construction_roof_shape_source_type == commonSourceTypes[1] || + props.building.construction_roof_shape_source_type == null) ? <> : + <> + + + } +
+ + + + {(props.building.construction_irregularities_source_type == commonSourceTypes[0] || + props.building.construction_irregularities_source_type == commonSourceTypes[1] || + props.building.construction_irregularities_source_type == null) ? <> : + <> + + + } +
= (props) => user_verified={props.user_verified.hasOwnProperty("construction_core_material")} user_verified_as={props.user_verified.construction_core_material} verified_count={props.building.verified.construction_core_material} - /> + /> Date: Thu, 27 Jul 2023 15:16:50 +0100 Subject: [PATCH 2/5] Decorative Features (and other tweaks) - Add Decorative Features sub category + data - Add Source data to existing roof covering - Move existing roof covering options to the correct place - Add missed hints with links to GEM taxonomy - Add fields to Database --- app/src/api/config/dataFields.ts | 24 ++++ .../building/data-containers/construction.tsx | 133 ++++++++++++++---- app/src/frontend/config/data-fields-config.ts | 68 ++++++++- migrations/044.construction_updates.down.sql | 6 + migrations/044.construction_updates.up.sql | 7 + 5 files changed, 201 insertions(+), 37 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 8acde159..b868bd07 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -277,6 +277,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + construction_roof_covering_source_type: { + edit: true, + verify: true, + }, + construction_roof_covering_source_links: { + edit: true, + verify: true, + }, construction_structural_system: { edit: true, verify: true, @@ -325,6 +333,22 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + construction_decorative_features: { + edit: true, + verify: true, + }, + construction_decorative_feature_materials: { + edit: true, + verify: true, + }, + construction_decorative_feature_source_type: { + edit: true, + verify: true, + }, + construction_decorative_feature_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 962e9c23..63416966 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -10,6 +10,7 @@ import { CategoryViewProps } from './category-view-props'; import InfoBox from '../../components/info-box'; import { DataEntryGroup } from '../data-components/data-entry-group'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; +import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; const ConstructionMaterialsOptions = [ 'Wood', @@ -22,17 +23,6 @@ const ConstructionMaterialsOptions = [ 'Other Man-Made Material' ]; -const RoofCoveringOptions = [ - 'Slate', - 'Clay Tile', - 'Wood', - 'Asphalt', - 'Iron or Steel', - 'Other Metal', - 'Other Natural Material', - 'Other Man-Made Material' -]; - /** * Construction view/edit section */ @@ -251,23 +241,13 @@ const ConstructionView: React.FunctionComponent = (props) => user_verified_as={props.user_verified.construction_core_material} verified_count={props.building.verified.construction_core_material} /> - +
= (props) => user_verified={props.user_verified.hasOwnProperty("construction_roof_covering")} user_verified_as={props.user_verified.construction_roof_covering} verified_count={props.building.verified.construction_roof_covering} - /> -
- - + + {(props.building.construction_roof_covering_source_type == commonSourceTypes[0] || + props.building.construction_roof_covering_source_type == commonSourceTypes[1] || + props.building.construction_roof_covering_source_type == null) ? <> : + <> + + + } + + + + + { + props.building.construction_decorative_features && + <> + + + + {(props.building.construction_decorative_feature_source_type == commonSourceTypes[0] || + props.building.construction_decorative_feature_source_type == commonSourceTypes[1] || + props.building.construction_decorative_feature_source_type == null) ? <> : + <> + + + } + + }
); diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 3c8ecffb..ae135052 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -601,14 +601,37 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ construction_roof_covering: { category: Category.Construction, - title: "Main roof covering", - tooltip: 'Main roof covering material', + title: "What is the main roof covering?", + tooltip: '', example: "", + items: [ + 'Slate', + 'Clay Tile', + 'Wood', + 'Asphalt', + 'Iron or Steel', + 'Other Metal', + 'Other Natural Material', + 'Other Man-Made Material' + ] + }, + construction_roof_covering_source_type: { + category: Category.Construction, + title: "Source type", + tooltip: "Source of roof covering data", + example: "", + items: commonSourceTypes + }, + construction_roof_covering_source_links: { + category: Category.Construction, + title: "Source links", + tooltip: "URL(s) for roof covering data source(s)", + example: ["", "", ""], }, construction_structural_system: { category: Category.Construction, title: "What type of structural system does the building appear to have?", - tooltip: "", + tooltip: "Refer to GEM Taxonomy [LINK]", example: "Solid masonry walls supporting the roof", items: [ "Solid masonry walls supporting the roof", @@ -632,7 +655,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ construction_foundation: { category: Category.Construction, title: "What is the foundation system thought to be", - tooltip: "", + tooltip: "Refer to GEM Taxonomy [LINK]", example: "Deep Foundations with lateral support", items: [ "Shallow foundations with no lateral support", @@ -658,7 +681,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ construction_roof_shape: { category: Category.Construction, title: "What kind of roof shape does the building have?", - tooltip: "", + tooltip: "Refer to GEM Taxonomy [LINK]", example: "Pitched with gable ends", items: [ "What kind of roof shape does the building have?", @@ -689,7 +712,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ construction_irregularities: { category: Category.Construction, title: "Are there any structural irregularities in the shape of the building?", - tooltip: "i.e. Is one side higher than other?", + tooltip: "i.e. Is one side higher than other? - Refer to GEM Taxonomy [LINK]", example: "No irregularities", items: [ "Vertical irregularities", @@ -710,6 +733,39 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "URL(s) for irregularity data source(s)", example: ["", "", ""], }, + construction_decorative_features: { + category: Category.Construction, + title: "Are there decorative features/mouldings integrated into the facade ?", + example: true, + tooltip: "", + }, + construction_decorative_feature_materials: { + category: Category.Construction, + title: "What are these decorative features mainly made of?", + tooltip: "", + example: "Concrete", + items: [ + "Wood", + "Clay", + "Concrete", + "Glass", + "Metal", + "Other" + ] + }, + construction_decorative_feature_source_type: { + category: Category.Construction, + title: "Source type", + tooltip: "Source of roof shape data", + example: "", + items: commonSourceTypes + }, + construction_decorative_feature_source_links: { + category: Category.Construction, + title: "Source links", + tooltip: "URL(s) for roof shape data source(s)", + example: ["", "", ""], + }, sust_breeam_rating: { category: Category.EnergyPerformance, diff --git a/migrations/044.construction_updates.down.sql b/migrations/044.construction_updates.down.sql index 3c6cdebb..27411779 100644 --- a/migrations/044.construction_updates.down.sql +++ b/migrations/044.construction_updates.down.sql @@ -14,4 +14,10 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS construction_irregularities; ALTER TABLE buildings DROP COLUMN IF EXISTS construction_irregularities_source_type; ALTER TABLE buildings DROP COLUMN IF EXISTS construction_irregularities_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS construction_roof_covering_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS construction_roof_covering_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS construction_decorative_features; +ALTER TABLE buildings DROP COLUMN IF EXISTS construction_decorative_feature_materials; +ALTER TABLE buildings DROP COLUMN IF EXISTS construction_decorative_feature_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS construction_decorative_feature_source_links; diff --git a/migrations/044.construction_updates.up.sql b/migrations/044.construction_updates.up.sql index a64fe307..9630d0ac 100644 --- a/migrations/044.construction_updates.up.sql +++ b/migrations/044.construction_updates.up.sql @@ -14,3 +14,10 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_irregularities text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_irregularities_source_type text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_irregularities_source_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_roof_covering_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_roof_covering_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_decorative_features boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_decorative_feature_materials text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_decorative_feature_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS construction_decorative_feature_source_links text[]; \ No newline at end of file From b326551d309ed09cdddbae364d8ef0ebec84cd0f Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 27 Jul 2023 15:48:01 +0100 Subject: [PATCH 3/5] 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) ? <> : + <> + + + } +
Date: Thu, 27 Jul 2023 16:15:38 +0100 Subject: [PATCH 4/5] 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) ? <> : + <> + + + }
Date: Thu, 27 Jul 2023 16:20:44 +0100 Subject: [PATCH 5/5] Changes to interface text --- app/src/frontend/config/data-fields-config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index c8c761ff..ca141343 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -587,21 +587,21 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ construction_core_material: { category: Category.Construction, - title: "Core material", + title: "What is the main structural material thought to be?", tooltip: "The main structural material", example: "", }, construction_core_material_source_type: { category: Category.Construction, title: "Source type", - tooltip: "Source of roof covering data", + tooltip: "Source of main structural material data", example: "", items: commonSourceTypes }, construction_core_material_source_links: { category: Category.Construction, title: "Source links", - tooltip: "URL(s) for roof covering data source(s)", + tooltip: "URL(s) for main structural material data source(s)", example: ["", "", ""], },