diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 2b9b563e..0583c2ab 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -304,6 +304,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + sust_retrofit_source_type: { + edit: true, + verify: true, + }, + sust_retrofit_source_links: { + edit: true, + verify: true, + }, sust_life_expectancy: { edit: false, }, @@ -422,6 +430,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + extension_source_type: { + edit: true, + verify: true + }, + extension_source_links: { + edit: true, + verify: true + }, developer_type: { edit: true, verify: true @@ -430,6 +446,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + developer_source_type: { + edit: true, + verify: true + }, developer_source_link: { edit: true, verify: true @@ -438,6 +458,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + landowner_source_type: { + edit: true, + verify: true + }, landowner_source_link: { edit: true, verify: true @@ -446,6 +470,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + designers_source_type: { + edit: true, + verify: true + }, designers_source_link: { edit: true, verify: true @@ -466,6 +494,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + builder_source_type: { + edit: true, + verify: true + }, builder_source_link: { edit: true, verify: true diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index 93420d73..0b491e85 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -106,6 +106,24 @@ const AgeView: React.FunctionComponent = (props) => { placeholder={dataFields.date_source.example} options={dataFields.date_source.items} /> + {(props.building.date_source == dataFields.date_source.items[0] || + props.building.date_source == dataFields.date_source.items[1] || + props.building.date_source == null) ? <> : + <> + + + }
This section is under development. @@ -331,18 +349,24 @@ const AgeView: React.FunctionComponent = (props) => { options={dataFields.date_source.items} placeholder={dataFields.date_source.example} /> - + {(props.building.date_source == dataFields.date_source.items[0] || + props.building.date_source == dataFields.date_source.items[1] || + props.building.date_source == null) ? <> : + <> + + + }
This section is under development. @@ -373,14 +397,14 @@ const AgeView: React.FunctionComponent = (props) => { value="" mode='view' /> - + /> */} = (props) => { value="" mode='view' /> - + /> */} = (props) = user_verified_as={props.user_verified.sust_retrofit_date} verified_count={props.building.verified.sust_retrofit_date} /> + + {(props.building.sust_retrofit_source_type == dataFields.sust_retrofit_source_type.items[0] || + props.building.sust_retrofit_source_type == dataFields.sust_retrofit_source_type.items[1] || + props.building.sust_retrofit_source_type == null) ? <> : + <> + + + } +
- + /> */} = (props) => { return (<> + + This section is under development. +
This feature is designed as an assessment tool to help communities capture data on the state of buildings following major disasters. @@ -76,7 +79,7 @@ const ResilienceView: React.FunctionComponent = (props) => { 'Other human (blast damage/spills etc.)', 'Other' ]} - + tooltip={dataFields.disaster_type.tooltip} onChange={props.onChange} mode={props.mode} copy={props.copy} @@ -93,7 +96,7 @@ const ResilienceView: React.FunctionComponent = (props) => { 'Minimal', 'No damage visible', ]} - + tooltip={dataFields.disaster_severity.tooltip} onChange={props.onChange} mode={props.mode} copy={props.copy} @@ -116,7 +119,7 @@ const ResilienceView: React.FunctionComponent = (props) => { 'Specialist emergency group/charity', 'Other', ]} - + tooltip={dataFields.disaster_assessment_method.tooltip} onChange={props.onChange} mode={props.mode} copy={props.copy} diff --git a/app/src/frontend/building/data-containers/size.tsx b/app/src/frontend/building/data-containers/size.tsx index 4e7f99c4..76151a57 100644 --- a/app/src/frontend/building/data-containers/size.tsx +++ b/app/src/frontend/building/data-containers/size.tsx @@ -160,6 +160,14 @@ const SizeView: React.FunctionComponent = (props) => ( step={0.1} min={0} /> + = (props) => { user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} /> + + {(props.building.date_source == dataFields.date_source.items[0] || + props.building.date_source == dataFields.date_source.items[1] || + props.building.date_source == null) ? <> : + <> + + + } +
= (props) => { user_verified_as={props.user_verified.extension_year} verified_count={props.building.verified.extension_year} /> + + {(props.building.extension_source_type == dataFields.extension_source_type.items[0] || + props.building.extension_source_type == dataFields.extension_source_type.items[1] || + props.building.extension_source_type == null) ? <> : + <> + + + } ) : (null)} @@ -96,18 +155,35 @@ const TeamView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.landowner} verified_count={props.building.verified.landowner} /> - + {(props.building.landowner_source_type == commonSourceTypes[0] || + props.building.landowner_source_type == commonSourceTypes[1] || + props.building.landowner_source_type == null) ? <> : + <> + + + } = (props) => { user_verified_as={props.user_verified.developer_name} verified_count={props.building.verified.developer_name} /> - + {(props.building.developer_source_type == commonSourceTypes[0] || + props.building.developer_source_type == commonSourceTypes[1] || + props.building.developer_source_type == null) ? <> : + <> + + + } = (props) => { user_verified_as={props.user_verified.designers} verified_count={props.building.verified.designers} /> - + = (props) => { user_verified_as={props.user_verified.lead_designer_type} verified_count={props.building.verified.lead_designer_type} /> + + {(props.building.designers_source_type == commonSourceTypes[0] || + props.building.designers_source_type == commonSourceTypes[1] || + props.building.designers_source_type == null) ? <> : + <> + + + } +
= (props) => { user_verified_as={props.user_verified.builder} verified_count={props.building.verified.builder} /> - + {(props.building.builder_source_type == commonSourceTypes[0] || + props.building.builder_source_type == commonSourceTypes[1] || + props.building.builder_source_type == null) ? <> : + <> + + + }
); diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 62bd018b..e1a90f71 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -557,6 +557,19 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Date of last major building refurbishment", example: 1920, }, + sust_retrofit_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source of last significant retrofit data", + example: "", + items: commonSourceTypes + }, + sust_retrofit_source_links: { + category: Category.Team, + title: "Source links", + tooltip: "URL(s) for last significant retrofit data source(s)", + example: ["", "", ""], + }, sust_life_expectancy: { category: Category.EnergyPerformance, title: "Expected lifespan for typology", @@ -837,6 +850,19 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip_extension: "This should be the year the extension was built, not the original building", example: 2020 }, + extension_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for extension data", + example: "", + items: commonSourceTypes + }, + extension_source_links: { + category: Category.Team, + title: "Source link(s)", + tooltip: "Source link(s) for extension data", + example: ["", "", ""], + }, developer_type: { category: Category.Team, title: "What type of developer built the building?", @@ -858,6 +884,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Free text. First name, space, then Last name", example: ["", "", ""], }, + developer_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for developer data", + example: "", + items: commonSourceTypes + }, developer_source_link: { category: Category.Team, title: "Source links for developer(s)", @@ -870,10 +903,17 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Free text. First name, space, then Last name", example: ["", "", ""], }, + landowner_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for landowner data", + example: "", + items: commonSourceTypes + }, landowner_source_link: { category: Category.Team, - title: "Source links for landowner(s)", - tooltip: "URL for source for landowner(s)", + title: "Source link(s)", + tooltip: "URL(s) for source for landowner data", example: ["", "", ""], }, designers: { @@ -882,6 +922,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Free text. First name, space, then Last name", example: ["", "", ""], }, + designers_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for designer data", + example: "", + items: commonSourceTypes + }, designers_source_link: { category: Category.Team, title: "Source links for designer(s)", @@ -918,6 +965,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ title: "Name of builder/construction team", example: ["", "", ""], }, + builder_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for builder data", + example: "", + items: commonSourceTypes + }, builder_source_link: { category: Category.Team, title: "Source for builder/construction team", @@ -935,23 +989,26 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, disaster_type: { category: Category.Resilience, - title: "What type of disaster management do you wish to collect data for?", + title: "Disaster type", + tooltip: "What type of disaster management do you wish to collect data for?", example: "Flood" }, disaster_severity: { category: Category.Resilience, title: "How severe do you assess the damage to be?", + tooltip: "Best estimate for the severity of damage to the building", example: "Building destroyed" }, disaster_assessment_method: { category: Category.Resilience, - title: "Please add a method of assessment", + title: "Method of assessment", + tooltip: "Please add a Best estimate for the severity of damage to the building", example: "Citizen/Passerby by eye" }, disaster_source_link: { category: Category.Resilience, - title: "Please add a source link to official documentation/photographic evidence where applicable", - tooltip: "URL for data sources(s)", + title: "Source link(s)", + tooltip: "Please add a source link(s) to official documentation/photographic evidence where applicable", example: ["", "", ""], }, disaster_start_date: { diff --git a/migrations/040.ui_revamp_sources.down.sql b/migrations/040.ui_revamp_sources.down.sql index 3b3d4a6e..9af8c0f0 100644 --- a/migrations/040.ui_revamp_sources.down.sql +++ b/migrations/040.ui_revamp_sources.down.sql @@ -14,3 +14,8 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS size_height_eaves; ALTER TABLE buildings DROP COLUMN IF EXISTS size_width_frontage_source_type; ALTER TABLE buildings DROP COLUMN IF EXISTS size_width_frontage_source_links; ALTER TABLE buildings DROP COLUMN IF EXISTS survival_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS landowner_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS designers_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS builder_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS extension_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS extension_source_links; diff --git a/migrations/040.ui_revamp_sources.up.sql b/migrations/040.ui_revamp_sources.up.sql index 49e3cd76..b73dc463 100644 --- a/migrations/040.ui_revamp_sources.up.sql +++ b/migrations/040.ui_revamp_sources.up.sql @@ -15,4 +15,9 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_floor_area_source_type text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_floor_area_source_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_width_frontage_source_type text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_width_frontage_source_links text[]; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS survival_source_links text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS survival_source_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS landowner_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_source_links text[]; \ No newline at end of file