From 8b8c92afc331d3cfe863406ea6df34634d4a30ff Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Fri, 23 Jun 2023 10:31:32 +0100 Subject: [PATCH 01/81] Remove unnecessary(?) duplicate code The code for the entire category is duplicated here. I did a side by side comparison, but could see no difference between the code in either part of the if statement, so I have removed one copy and tidied up the other. #1155 --- .../building/data-containers/age-history.tsx | 382 +----------------- 1 file changed, 4 insertions(+), 378 deletions(-) diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index 053108b0..be392a7e 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -54,383 +54,6 @@ const AgeView: React.FunctionComponent = (props) => { } } - if (props.building.date_source == "Expert knowledge of building" || - props.building.date_source == "Expert estimate from image" || - props.building.date_source == null - ){ - return ( - - - - - - - - {(props.building.date_source == dataFields.date_source.items[0] || - props.building.date_source == dataFields.date_source.items[1] || - props.building.date_source == null) ? <> : - <> - - - } - - - - - - {(props.building.age_cladding_date_source_type == dataFields.age_cladding_date_source_type.items[0] || - props.building.age_cladding_date_source_type == dataFields.age_cladding_date_source_type.items[1] || - props.building.age_cladding_date_source_type == null) ? <> : - <> - - - } -
- - - - {(props.building.age_extension_date_source_type == dataFields.age_extension_date_source_type.items[0] || - props.building.age_extension_date_source_type == dataFields.age_extension_date_source_type.items[1] || - props.building.age_extension_date_source_type == null) ? <> : - <> - - - } -
- - - - {(props.building.age_retrofit_date_source_type == dataFields.age_retrofit_date_source_type.items[0] || - props.building.age_retrofit_date_source_type == dataFields.age_retrofit_date_source_type.items[1] || - props.building.age_retrofit_date_source_type == null) ? <> : - <> - - - } -
- - - - - - -
- -
-
- -
-
- -
-
-
- { - currentBuildingConstructionYear == undefined ? - To add historical records, fill in the Age data first. : - - <> - 0} - disallowNull={(building.demolished_buildings?.length ?? 0) > 0} - - onChange={props.onSaveChange} - mode={props.mode} - copy={props.copy} - /> - { - building.dynamics_has_demolished_buildings && - <> - - { - props.mode === 'view' && - Switch to edit mode to add/edit past building records - } - - } - - } -
- - This section is under development in collaboration with the historic environment sector. - Please let us know your suggestions on the discussion forum! (external link - save your edits first) - -
- -
- - Can you help us create a map that shows how many buildings in London have survived since the 1890s? - Choose a colour to indicate whether the building has survived. - -
- - - - {(props.building.survival_source == dataFields.survival_source_links[0] || - props.building.survival_source == dataFields.survival_source_links[1] || - props.building.survival_source == null) ? <> : - <> - - } -
-
- ); - }; return ( @@ -751,7 +374,7 @@ const AgeView: React.FunctionComponent = (props) => { Please let us know your suggestions on the discussion forum! (external link - save your edits first) - +
Can you help us create a map that shows how many buildings in London have survived since the 1890s? @@ -800,6 +423,9 @@ const AgeView: React.FunctionComponent = (props) => { } + + + ); }; From b5103327c5cf88369ec01f38556a9cc32cbcb3a5 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Fri, 23 Jun 2023 22:25:35 +0100 Subject: [PATCH 02/81] Tweaks (see #1186) --- .../building/data-containers/age-history.tsx | 9 +- .../building/data-containers/community.tsx | 353 +++++++++--------- .../data-containers/energy-performance.tsx | 96 +++-- .../building/data-containers/land-use.tsx | 4 +- .../building/data-containers/location.tsx | 4 +- .../building/data-containers/planning.tsx | 284 ++++++-------- .../building/data-containers/size.tsx | 6 +- .../data-containers/street-context.tsx | 197 +++++----- .../building/data-containers/team.tsx | 177 ++++----- app/src/frontend/config/data-fields-config.ts | 72 ++-- 10 files changed, 585 insertions(+), 617 deletions(-) diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index be392a7e..7d5fab07 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -424,7 +424,14 @@ const AgeView: React.FunctionComponent = (props) => { } - + + This section is under development + +
+ + This section provides links to open digitised historical maps/mapping data that we are using in the Colouring Cities platform. + +
); diff --git a/app/src/frontend/building/data-containers/community.tsx b/app/src/frontend/building/data-containers/community.tsx index 2b137ca7..88ac3f68 100644 --- a/app/src/frontend/building/data-containers/community.tsx +++ b/app/src/frontend/building/data-containers/community.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { Fragment } from 'react'; import '../../map/map-button.css'; import withCopyEdit from '../data-container'; @@ -15,6 +15,7 @@ import SelectDataEntry from '../data-components/select-data-entry'; import Verification from '../data-components/verification'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import { useDisplayPreferences } from '../../displayPreferences-context'; +import DataEntry from '../data-components/data-entry'; /** * Community view/edit section @@ -38,192 +39,206 @@ const CommunityView: React.FunctionComponent = (props) => { } const { darkLightTheme } = useDisplayPreferences(); const worthKeepingReasonsNonEmpty = Object.values(props.building.community_type_worth_keeping_reasons ?? {}).some(x => x); - return <> - -
- - Note: We are currently only collecting data on non-residential buildings. - -
-
- {(props.building.is_domestic === "no" || props.building.is_domestic === "mixed domestic/non-domestic") ? - <> - + +
+ + Note: We are currently only collecting data on non-residential buildings. + +
+
+ + {(props.building.is_domestic === "no" || props.building.is_domestic === "mixed domestic/non-domestic") ? + <> + + + : + <> + } + + {(props.mapColourScale == "typology_likes") ? + + : + + } + { + props.building.community_type_worth_keeping === true && + ({ + key, + label: definition.title + })) + } + + mode={props.mode} + /> + } +
+ - - : - <> - } - - {(props.mapColourScale == "typology_likes") ? - - : - - } - { - props.building.community_type_worth_keeping === true && - ({ - key, - label: definition.title - })) - } + {(props.mapColourScale == "community_local_significance_total") ? + + : + + } +
+ - } -
- + + For more information on current planning applications, refer to the Planning Controls category. + +
+ {(props.mapColourScale == "community_expected_planning_application_total") ? + + : + + } +
+
+ +
+ + Here we are collecting information on the location of buildings used for community activities so we can track loss of/additions to community space over time. + +
+ + + + - {(props.mapColourScale == "community_local_significance_total") ? + + + + {(props.mapColourScale == "community_in_public_ownership") ? : - } -
- - {(props.mapColourScale == "community_expected_planning_application_total") ? - - : - - } -
-
- -
- - Here we are collecting information on the location of buildings used for community activities so we can track loss of/additions to community space over time. - -
- - - - - - - - {(props.mapColourScale == "community_in_public_ownership") ? - - : - - } -
- +
+
+ ); }; const CommunityContainer = withCopyEdit(CommunityView); diff --git a/app/src/frontend/building/data-containers/energy-performance.tsx b/app/src/frontend/building/data-containers/energy-performance.tsx index bdace92a..d20e380c 100644 --- a/app/src/frontend/building/data-containers/energy-performance.tsx +++ b/app/src/frontend/building/data-containers/energy-performance.tsx @@ -25,9 +25,20 @@ const BreeamRatingOptions = [ * Sustainability view/edit section */ const SustainabilityView: React.FunctionComponent = (props) => { + + const currentYear = new Date().getFullYear(); + return ( - + + + + = (props) = user_verified_as={props.user_verified.sust_breeam_rating} verified_count={props.building.verified.sust_breeam_rating} /> - = (props) = user_verified_as={props.user_verified.sust_dec} verified_count={props.building.verified.sust_dec} /> - = (props) = onChange={props.onChange} /> - - + + step={1} + min={1} + max={currentYear} + tooltip={dataFields.extension_year.tooltip} + /> - {(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.building.age_retrofit_date_source_type == dataFields.age_retrofit_date_source_type.items[0] || + props.building.age_retrofit_date_source_type == dataFields.age_retrofit_date_source_type.items[1] || + props.building.age_retrofit_date_source_type == null) ? <> : <> } - {/*
- - - */}
- + + + = (props) => { const { darkLightTheme } = useDisplayPreferences(); return ( - +
The vast majority of properties are residential (93% in the UK), so we have set 'residential' as the default value. Can you help us identify non-residential and mixed use buildings (and verify residential buildings too)? @@ -87,7 +87,7 @@ const UseView: React.FunctionComponent = (props) => { } - + = (props) => { const osm_url = "https://www.openstreetmap.org/way/"+props.building.ref_osm_id; return ( - + = (props) => { } - + = (props) => { const communityLinkUrl = `/${props.mode}/${Category.Community}/${props.building.building_id}`; return ( - - + + This section provides data on active applications. We define these as applications with any activity in the last year.
@@ -85,49 +87,64 @@ const PlanningView: React.FunctionComponent = (props) => { : <> }
- - - This section provides data on past applications where available from the GLA, including those with no decision in over a year - - {props.building.planning_data ? - isArchived(item))} - messageOnMissingData={ - props.building.planning_data.length > 0 ? - "Only current application data is currently available for this site" - : - "No live planning data are currently available for this building from the Planning London Datahub." - } - /> - : <> - } - - - Click and colour buildings here if you think they may be subject to a future planning application involving demolition. To add your opinion on how well this building works, please also visit the Community section. - { - props.mapColourScale != "community_expected_planning_application_total" ? - - : - - } - + - - Further improvements to this feature are currently being made. + + + + If you feel there are incorrect or missing data relating to this building please contact: + planningdata@London.gov.uk
+ + + This section provides data on past applications where available from the GLA, including those with no decision in over a year + + {props.building.planning_data ? + isArchived(item))} + messageOnMissingData={ + props.building.planning_data.length > 0 ? + "Only current application data is currently available for this site" + : + "No live planning data are currently available for this building from the Planning London Datahub." + } + /> + : <> + } + + + Click and colour buildings here if you think they may be subject to a future planning application involving demolition. To add your opinion on how well this building works, please also visit the Community section. + { + props.mapColourScale != "community_expected_planning_application_total" ? + + : + + } + + + Further improvements to this feature are currently being made. + + To view planning zone data for London click the buttons below. You may need to zoom out. @@ -358,6 +375,24 @@ const PlanningView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.planning_in_conservation_area_url} verified_count={props.building.verified.planning_in_conservation_area_url} /> + + {/* = (props) => { user_verified_as={props.user_verified.planning_historic_area_assessment_url} verified_count={props.building.verified.planning_historic_area_assessment_url} /> - + + + This section is designed to provide information on land parcels and their ownership type. Can you help us to crowdsource this information? + + + /> - - - - {/* will be titled "Other active application info (crowdsourced data)" once active" */} - - This category is not yet activated - Until this section is activated please report inaccuracies or problems on the Discussion Forum. - - {/* that is placeholder display, will be replaced by actual code */} -
-
-
    -
  • Year of completion if known
  • -
  • If you know of a planning application that has been recently submitted for this site, and is not listed in the blue box above, please enter its planning application ID below:
  • -
  • If any of the active planning applications are not mapped onto the correct site, please tick here
  • -
-
-
- { - /* - - - - - - - - on enabling switch it to UserOpinionEntry, remove value and restore userValue - */ - } - -
- - - This category is not yet activated. - - - This section is designed to provide information on land parcels and their ownership type. Can you help us to crowdsource this information? - - -
-
-
    -
  • What type of owner owns this land parcel?
  • -
-
-
- - {/* - - - */ - } -
+ + +
)}; diff --git a/app/src/frontend/building/data-containers/size.tsx b/app/src/frontend/building/data-containers/size.tsx index 02ab7344..1ae07ab8 100644 --- a/app/src/frontend/building/data-containers/size.tsx +++ b/app/src/frontend/building/data-containers/size.tsx @@ -103,7 +103,7 @@ const SizeView: React.FunctionComponent = (props) => ( }
- + = (props) => ( } - + = (props) => ( } - + = (props) => ( - + = (props) => ( /> } +
+ + + + {(props.building.context_green_space_distance_source_type == commonSourceTypes[0] || + props.building.context_green_space_distance_source_type == commonSourceTypes[1] || + props.building.context_green_space_distance_source_type == null) ? <> : + <> + + } +
+ + + + {(props.building.context_tree_distance_source_type == commonSourceTypes[0] || + props.building.context_tree_distance_source_type == commonSourceTypes[1] || + props.building.context_tree_distance_source_type == null) ? <> : + <> + + }
- + = (props) => ( } - - + - - - {(props.building.context_green_space_distance_source_type == commonSourceTypes[0] || - props.building.context_green_space_distance_source_type == commonSourceTypes[1] || - props.building.context_green_space_distance_source_type == null) ? <> : - <> - - } -
- - - - {(props.building.context_tree_distance_source_type == commonSourceTypes[0] || - props.building.context_tree_distance_source_type == commonSourceTypes[1] || - props.building.context_tree_distance_source_type == null) ? <> : - <> - - }
); diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index 3f9a7c32..4cd78237 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -21,7 +21,7 @@ const TeamView: React.FunctionComponent = (props) => { const currentBuildingConstructionYear = building.date_year || undefined; return (
- + = (props) => { ) : (null)} - + = (props) => { } - + = (props) => { } - + = (props) => { /> } -
- - - {props.building.designer_awards ? ( - <> - - - - ) : (null) - }
- - - - - {(props.building.builder_source_type == commonSourceTypes[0] || - props.building.builder_source_type == commonSourceTypes[1] || - props.building.builder_source_type == null) ? <> : - <> + + + + + {(props.building.builder_source_type == commonSourceTypes[0] || + props.building.builder_source_type == commonSourceTypes[1] || + props.building.builder_source_type == null) ? <> : + <> + + + } + + + + + {props.building.designer_awards ? ( + <> - - } - + /> + + + ) : (null) + } + ); }; diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index ecb765cd..8738bccd 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -6,9 +6,9 @@ let ccconfig: CCConfig = require('../../cc-config.json') * Common list of Source Types, used in multiple menus */ export const commonSourceTypes = [ - "Assessed by eye", + "Assessed by eye/personal knowledge of the building", "Assessed using expert knowledge of building or building type", - "Assessed using streetview photographs or satellite imagery", + "Assessed using streetview photographs, satellite imagery or maps", "Assessed by specialist emergency group", "Live streamed from a government source", "Current government record/dataset", @@ -156,7 +156,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, location_street: { category: Category.Location, - title: "Street", + title: "Street name", example: "Gower Street", //tooltip: , }, @@ -342,7 +342,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, facade_year: { category: Category.Age, - title: "Date of front of building", + title: "Date of front of building (best estimate)", tooltip: "Best estimate", example: 1900, }, @@ -416,7 +416,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ category: Category.Size, title: "Height to apex (m)", example: 100.5, - tooltip: "i.e. the highest part of the roof.", + tooltip: "i.e. the highest part of the roof (in meters).", }, size_height_apex_source_type: { category: Category.Team, @@ -435,7 +435,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ category: Category.Size, title: "Height to eaves (m)", example: 20.33, - tooltip: "i.e. to where the top of the wall meets the roof", + tooltip: "i.e. to where the top of the wall meets the roof (in meters)", }, size_height_eaves_source_type: { category: Category.Team, @@ -479,7 +479,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ category: Category.Size, title: "Frontage width (m)", example: 12.2, - //tooltip: , + tooltip: "Size of the frontage of the building (in meters)", }, size_width_frontage_source_type: { category: Category.Team, @@ -583,7 +583,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ sust_breeam_rating: { category: Category.EnergyPerformance, - title: "Official environmental quality rating", + title: "Residential energy rating", tooltip: ccconfig.energy_rating, example: "", }, @@ -716,7 +716,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, planning_list_grade: { category: Category.Planning, - title: "What is its rating?", + title: "What is its protection rating?", example: "II", //tooltip: , }, @@ -740,19 +740,19 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, planning_in_apa_url: { category: Category.Planning, - title: "Is it in an area if archaeological priority?", + title: "Is the building in an area of archaeological priority?", example: "", //tooltip: , }, planning_local_list_url: { category: Category.Planning, - title: "Is it a locally listed heritage asset?", + title: "Is the building a locally listed heritage asset?", example: "", //tooltip: , }, planning_historic_area_assessment_url: { category: Category.Planning, - title: "Does it have any other kind of historic area assessment?", + title: "Does it have any other type of designation?", example: "", //tooltip: , }, @@ -811,19 +811,19 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ community_activities_current: { category: Category.Community, - title: "Are activities open to the community currently taking place in the building?", + title: "Is this building currently used for community activities?", tooltip: "E.g. youth club, place of worship, GP surgery, pub", example: true }, community_activities: { category: Category.Community, - title: "Has this ever been used for community activities in the past?", + title: "If not been used for community activities in the past?", tooltip: "E.g. youth club, place of worship, GP surgery, pub", example: true }, community_activities_always: { category: Category.Community, - title: "Has the building always been used for community activities?", + title: "If in community use now, has it always been used for community activities?", tooltip: "E.g. youth club, place of worship, GP surgery, pub", example: true }, @@ -837,11 +837,15 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ title: "Is the building in public/community ownership?", example: "Privately owned (non-corporate)", items: [ - 'Government-owned', - 'Charity-owned', - 'Community-owned/cooperative', - 'Owned by other non-profit body', - 'Not in public/community ownership' + "Public/State body", + "Public body with Private company", + "Charity", + "Community group/Cooperative", + "Other non-profit body", + "Privately owned company", + "Privately owned offshore company", + "Private individual", + "Other", ] }, community_public_ownership_sources: { @@ -953,7 +957,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ landowner: { category: Category.Team, title: "Landowner(s) at time of construction", - tooltip: "Free text. First name, space, then Last name", + tooltip: "Land owner when the building was constructed.
For info on current land ownership, see 'Planning Controls'.", example: ["", "", ""], }, landowner_source_type: { @@ -1003,14 +1007,14 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, designer_awards: { category: Category.Team, - title: "Did the design team win any awards for this building?", + title: "Has the building won any?", tooltip: "", example: false }, awards_source_link: { category: Category.Team, - title: "Source link(s) for designer award(s)", - tooltip: "URL for source for designer award(s)", + title: "Source link(s) for building award(s)", + tooltip: "URL for source for building award(s)", example: ["", "", ""], }, builder: { @@ -1116,7 +1120,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, context_flats_garden: { category: Category.StreetContext, - title: "Is the building flats with a dedicated green space?", + title: "Are flats with a dedicated green space?", tooltip: "If the building is a block of flats, does it have a dedicated garden area/green space?", example: "", items: [ @@ -1139,8 +1143,8 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, context_street_width: { category: Category.Team, - title: "Street width (m)", - tooltip: "Width of the street in metres.", + title: "Average street width (m)", + tooltip: "Average width of the street in metres.", example: 10 }, context_street_width_source_type: { @@ -1158,8 +1162,8 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, context_pavement_width: { category: Category.Team, - title: "Pavement width (m)", - tooltip: "Width of the pavement in metres.", + title: "Average pavement width (m)", + tooltip: "Average width of the pavement in metres.", example: 10 }, context_pavement_width_source_type: { @@ -1178,7 +1182,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ context_green_space_distance: { category: Category.Team, title: "Distance to nearest green space (m)", - tooltip: "Approximate distance from the front door of the building to the nearest public green space.", + tooltip: "Approximate distance from the front door of the building to the nearest public green space (in meters).", example: 10 }, context_green_space_distance_source_type: { @@ -1197,7 +1201,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ context_tree_distance: { category: Category.Team, title: "Distance to nearest tree (m)", - tooltip: "Approximate distance from the front door of the building to the nearest tree.", + tooltip: "Approximate distance from the front door of the building to the nearest tree in meters.", example: 10 }, context_tree_distance_source_type: { @@ -1234,7 +1238,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, age_cladding_date: { category: Category.Age, - title: "Cladding date", + title: "Cladding date (best estimate)", tooltip: "Width of the street in metres.", example: 1970 }, @@ -1253,7 +1257,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, age_extension_date: { category: Category.Age, - title: "Date of significant extensions", + title: "Date of significant extensions (best estimate)", tooltip: "Width of the street in metres.", example: 1970 }, @@ -1272,7 +1276,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, age_retrofit_date: { category: Category.Age, - title: "Date of significant retrofits", + title: "Date of last significant retrofit (best estimate)", tooltip: "Width of the street in metres.", example: 1970 }, From 725d7710b95a6945068b6fcc28416dde14021452 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 27 Jun 2023 14:55:19 +0100 Subject: [PATCH 03/81] Location category tweaks - Add placeholder data fields - Add Postcode Regex - Add OSM ID Regex - Allow Pattern Data Entry boxes to transform text (to force capitalise, for example) - Add source links and update tooltips - Cosmetic tweaks to CSS --- .../data-components/pattern-data-entry.tsx | 11 +++- .../building/data-containers/location.tsx | 60 +++++++++++++++---- app/src/frontend/building/sidebar.css | 13 ++++ app/src/frontend/config/data-fields-config.ts | 7 +-- 4 files changed, 75 insertions(+), 16 deletions(-) diff --git a/app/src/frontend/building/data-components/pattern-data-entry.tsx b/app/src/frontend/building/data-components/pattern-data-entry.tsx index 9681e981..187fb0df 100644 --- a/app/src/frontend/building/data-components/pattern-data-entry.tsx +++ b/app/src/frontend/building/data-components/pattern-data-entry.tsx @@ -12,11 +12,20 @@ interface PatternDataEntryProps extends BaseDataEntryProps { */ pattern: string; maxLength?: number; + valueTransform?: (val: string) => string; } export const PatternDataEntry: React.FC = props => { const handleChange = (value: string) => { - props.onChange?.(props.slug, value); + props.onChange?.(props.slug, transformValue(value)); + }; + + const transformValue = (value: string) => { + const transform = props.valueTransform || (x => x); + const transformedValue = value === '' ? + null : + transform(value); + return transformedValue; }; return ( diff --git a/app/src/frontend/building/data-containers/location.tsx b/app/src/frontend/building/data-containers/location.tsx index 9ffe6e2d..a1b7ef1e 100644 --- a/app/src/frontend/building/data-containers/location.tsx +++ b/app/src/frontend/building/data-containers/location.tsx @@ -12,9 +12,11 @@ import SelectDataEntry from '../data-components/select-data-entry'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; const locationNumberPattern = "[1-9]\\d*[a-z]?(-([1-9]\\d*))?"; ///[1-9]\d*[a-z]?(-([1-9]\d*))?/; +const postcodeCharacterPattern = "^[A-Z]{1,2}[0-9]{1,2}[A-Z]?(\\s*[0-9][A-Z]{1,2})?$"; +const osmIdentifierPattern = "[0-9]{1,9}"; const LocationView: React.FunctionComponent = (props) => { - const osm_url = "https://www.openstreetmap.org/way/"+props.building.ref_osm_id; + const osm_url = "www.openstreetmap.org/way/"+props.building.ref_osm_id; return ( @@ -26,8 +28,9 @@ const LocationView: React.FunctionComponent = (props) => { copy={props.copy} onChange={props.onChange} tooltip={dataFields.location_name.tooltip} - placeholder="https://..." - isUrl={true} + placeholder="" + isUrl={false} + disabled={true} /> = (props) => { mode='view' tooltip="Not yet activated.

For security reasons, we do not allow the use of free text boxes and are currently looking into alternative ways to collect this data." /> +
= (props) => { copy={props.copy} onChange={props.onChange} tooltip={dataFields.location_number.tooltip} + maxLength={5} /> = (props) => { copy={props.copy} onChange={props.onChange} maxLength={30} + disabled={true} /> = (props) => { copy={props.copy} onChange={props.onChange} maxLength={30} + disabled={true} /> = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} + disabled={true} /> = (props) => { user_verified_as={props.user_verified.location_town} verified_count={props.building.verified.location_town} /> - = (props) => { onChange={props.onChange} disabled={true} /> + { + (props.building.ref_toid == null) ? <> : + + } +
- : + + } +
+ = (props) => { tooltip={dataFields.ref_osm_id.tooltip} maxLength={20} onChange={props.onChange} + pattern={osmIdentifierPattern} /> - { - (props.building.ref_osm_id == null) ? <> : -
- Source: {osm_url} -
- } = (props) => { user_verified_as={props.user_verified.ref_osm_id} verified_count={props.building.verified.ref_osm_id} /> + { + (props.building.ref_osm_id == null) ? <> : +
+ Source: {osm_url} +
+ }
= (props) => { /> } +
+
); diff --git a/app/src/frontend/building/sidebar.css b/app/src/frontend/building/sidebar.css index 5f915241..74bfe22f 100644 --- a/app/src/frontend/building/sidebar.css +++ b/app/src/frontend/building/sidebar.css @@ -183,4 +183,17 @@ .source-url { padding-top: 0px; padding-bottom: 5px; +} + +dd { + margin-bottom: 15px; +} + +.uprn-list { + margin-top: 10px; + margin-bottom: 0px; +} + +.uprn-list li { + margin-bottom: 10px; } \ No newline at end of file diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 8738bccd..60e6e17d 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -194,7 +194,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ ref_toid: { category: Category.Location, title: "Building footprint ID", - tooltip: "Ordnance Survey Topography Layer ID (TOID) [link]", + tooltip: "Ordnance Survey Topography Layer ID (TOID)", example: "", }, @@ -205,7 +205,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ uprns: { category: Category.Location, title: "Unique Property Reference Number(s) (UPRN)", - tooltip: "Unique Property Reference Numbers (to be filled automatically) [LINK]", + tooltip: "Unique Property Reference Number(s) (UPRN) (derived automatically)", example: [{ uprn: "", parent_uprn: "" }, { uprn: "", parent_uprn: "" }], }, @@ -218,11 +218,10 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ ], }, - ref_osm_id: { category: Category.Location, title: "OpenStreetMap ID", - tooltip: "OpenStreetMap feature ID", + tooltip: "OpenStreetMap building ('way') ID - Numerical string of up to 9 characters", example: "", }, location_latitude: { From e150b1b36f71d4c87a6a5d5cdba2945c2c925d1a Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 27 Jun 2023 16:48:33 +0100 Subject: [PATCH 04/81] Change Land Use source to default source type --- app/src/frontend/config/data-fields-config.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 60e6e17d..5205203a 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -266,15 +266,16 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ title: "Source type", tooltip: "Source for the current land use", example: "", - items: [ - "Expert/personal knowledge of building", - "Online streetview image", - "Open planning authority dataset", - "Open property tax dataset", - "Open housing dataset", - "Open address dataset", - "Other" - ], + items: commonSourceTypes + // items: [ + // "Expert/personal knowledge of building", + // "Online streetview image", + // "Open planning authority dataset", + // "Open property tax dataset", + // "Open housing dataset", + // "Open address dataset", + // "Other" + // ], }, current_landuse_source_detail: { category: Category.LandUse, From 35611f87da04e41616d3856224224af272096874 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 27 Jun 2023 19:39:19 +0100 Subject: [PATCH 05/81] Add Building Name link --- app/src/api/config/dataFields.ts | 4 ++++ .../building/data-containers/location.tsx | 20 ++++++++++++++----- app/src/frontend/config/data-fields-config.ts | 8 +++++++- .../extract_data/export_attributes.sql | 1 + migrations/041.ui_revamp_tweaks.down.sql | 1 + migrations/041.ui_revamp_tweaks.up.sql | 1 + 6 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 migrations/041.ui_revamp_tweaks.down.sql create mode 100644 migrations/041.ui_revamp_tweaks.up.sql diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 8f150f47..6688529d 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -59,6 +59,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + location_name_link: { + edit: true, + verify: true, + }, location_number: { edit: true, verify: true, diff --git a/app/src/frontend/building/data-containers/location.tsx b/app/src/frontend/building/data-containers/location.tsx index a1b7ef1e..5ba69820 100644 --- a/app/src/frontend/building/data-containers/location.tsx +++ b/app/src/frontend/building/data-containers/location.tsx @@ -48,12 +48,22 @@ const LocationView: React.FunctionComponent = (props) => { tooltip="Not yet activated.

For security reasons, we do not allow the use of free text boxes and are currently looking into alternative ways to collect this data." /> + { + (props.building.location_name_link == null) ? <> : + + }

(For security reasons, we currently only collect the names of non-residential buildings).", + tooltip: "The name of the building.

(For security reasons, we currently only collect the names of non-residential buildings).", + example: "Broadcasting House", + }, + location_name_link: { + category: Category.Location, + title: "Building name link", + tooltip: "Link to a website with the name of the building.", example: "https://en.wikipedia.org/wiki/Palace_of_Westminster", }, location_number: { diff --git a/maintenance/extract_data/export_attributes.sql b/maintenance/extract_data/export_attributes.sql index b87926f7..ce1e602b 100644 --- a/maintenance/extract_data/export_attributes.sql +++ b/maintenance/extract_data/export_attributes.sql @@ -4,6 +4,7 @@ COPY (SELECT ref_osm_id, revision_id, location_name, + location_name_link, location_number, location_street, location_line_two, diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql new file mode 100644 index 00000000..477f342e --- /dev/null +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -0,0 +1 @@ +ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.up.sql b/migrations/041.ui_revamp_tweaks.up.sql new file mode 100644 index 00000000..a2c7903a --- /dev/null +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -0,0 +1 @@ +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text; \ No newline at end of file From 91eb5aeef8e7dbb520210c46d52b947c97a43e75 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 27 Jun 2023 19:47:40 +0100 Subject: [PATCH 06/81] Add alternative building footprint links (Location) --- app/src/api/config/dataFields.ts | 4 ++++ .../building/data-containers/location.tsx | 17 +++++++++++------ app/src/frontend/config/data-fields-config.ts | 6 ++++++ maintenance/extract_data/export_attributes.sql | 1 + migrations/041.ui_revamp_tweaks.down.sql | 3 ++- migrations/041.ui_revamp_tweaks.up.sql | 3 ++- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 6688529d..f632688d 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -107,6 +107,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + location_alternative_footprint_links: { + edit: true, + verify: true + }, date_year: { edit: true, verify: true, diff --git a/app/src/frontend/building/data-containers/location.tsx b/app/src/frontend/building/data-containers/location.tsx index 5ba69820..c31d3bbb 100644 --- a/app/src/frontend/building/data-containers/location.tsx +++ b/app/src/frontend/building/data-containers/location.tsx @@ -315,12 +315,17 @@ const LocationView: React.FunctionComponent = (props) => { }
-
diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 33bfced3..90c1ad5b 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -203,6 +203,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Ordnance Survey Topography Layer ID (TOID)", example: "", }, + location_alternative_footprint_links: { + category: Category.Location, + title: "Alternative open building footprint links", + tooltip: "Links to alternative building footprint datasets (include the direct link to the footprint of this building where possible).", + example: ["", "", ""], + }, /** * UPRNs is not part of the buildings table, but the string fields diff --git a/maintenance/extract_data/export_attributes.sql b/maintenance/extract_data/export_attributes.sql index ce1e602b..4f5672bf 100644 --- a/maintenance/extract_data/export_attributes.sql +++ b/maintenance/extract_data/export_attributes.sql @@ -14,6 +14,7 @@ COPY (SELECT location_address_links, location_latitude, location_longitude, + location_alternative_footprint_links current_landuse_group, current_landuse_order, building_attachment_form, diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql index 477f342e..dc30b17f 100644 --- a/migrations/041.ui_revamp_tweaks.down.sql +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -1 +1,2 @@ -ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link; \ No newline at end of file +ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link; +ALTER TABLE buildings DROP COLUMN IF EXISTS location_alternative_footprint_links; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.up.sql b/migrations/041.ui_revamp_tweaks.up.sql index a2c7903a..bb1d12b7 100644 --- a/migrations/041.ui_revamp_tweaks.up.sql +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -1 +1,2 @@ -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_alternative_footprint_links text[]; \ No newline at end of file From cfb441a2735e18e70401ab7fec8ed92395fe4149 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 10:11:12 +0100 Subject: [PATCH 07/81] Add tooltip to postcode --- app/src/frontend/building/data-containers/location.tsx | 1 + app/src/frontend/config/data-fields-config.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/location.tsx b/app/src/frontend/building/data-containers/location.tsx index c31d3bbb..6df12b42 100644 --- a/app/src/frontend/building/data-containers/location.tsx +++ b/app/src/frontend/building/data-containers/location.tsx @@ -147,6 +147,7 @@ const LocationView: React.FunctionComponent = (props) => { onChange={props.onChange} maxLength={8} valueTransform={x=>x.toUpperCase()} + tooltip={dataFields.location_postcode.tooltip} /> Date: Wed, 28 Jun 2023 10:21:35 +0100 Subject: [PATCH 08/81] Change domestic to residential In interface but not in dropdowns/database yet --- app/src/frontend/building/data-containers/land-use.tsx | 2 +- app/src/frontend/config/category-maps-config.ts | 6 +++--- app/src/frontend/config/data-fields-config.ts | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/frontend/building/data-containers/land-use.tsx b/app/src/frontend/building/data-containers/land-use.tsx index 27dbaa4c..a9e92b8c 100644 --- a/app/src/frontend/building/data-containers/land-use.tsx +++ b/app/src/frontend/building/data-containers/land-use.tsx @@ -39,7 +39,7 @@ const UseView: React.FunctionComponent = (props) => {

(For security reasons, we currently only collect the names of non-residential buildings).", example: "Broadcasting House", }, @@ -776,8 +776,8 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, is_domestic: { category: Category.Team, - title: "Is the building a home/domestic building?", - tooltip: "Note: Homes used as offices for working from home should be classified as domestic.", + title: "Is the building a home/residential building?", + tooltip: "Note: Homes used as offices for working from home should be classified as residential.", example: "mixed domestic/non-domestic", items: [ "Yes", @@ -788,14 +788,14 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ is_domestic_source: { category: Category.Team, title: "Source type", - tooltip: "Source of domestic/non-domestic data", + tooltip: "Source of residential/non-residential data", example: "", items: commonSourceTypes }, is_domestic_links: { category: Category.Team, title: "Source links", - tooltip: "URL(s) for domestic/non-domestic data source(s)", + tooltip: "URL(s) for residential/non-residential data source(s)", example: ["", "", ""], }, likes_total: { From 0517222670b5828dc4f01126c449c9883fcbec92 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 13:16:11 +0100 Subject: [PATCH 09/81] Add fields to Age and History --- app/src/api/config/dataFields.ts | 8 +++++++ .../building/data-containers/age-history.tsx | 24 +++++++++++++++++++ app/src/frontend/config/data-fields-config.ts | 12 ++++++++++ migrations/041.ui_revamp_tweaks.down.sql | 4 +++- migrations/041.ui_revamp_tweaks.up.sql | 4 +++- 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index f632688d..4349fe86 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -693,6 +693,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint age_retrofit_date_source_links : { edit: true, verify: true + }, + age_historical_raster_map_links : { + edit: true, + verify: true + }, + age_historical_vectorised_footprint_links : { + 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 7d5fab07..5d8d1e57 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -432,6 +432,30 @@ const AgeView: React.FunctionComponent = (props) => { This section provides links to open digitised historical maps/mapping data that we are using in the Colouring Cities platform.
+ + ); diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index d4eea902..6838613d 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -1305,6 +1305,18 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Source link(s) for street width data", example: ["", "", ""], }, + age_historical_raster_map_links: { + category: Category.Age, + title: "Historical maps links", + tooltip: "Links to rasterised historical maps", + example: ["", "", ""], + }, + age_historical_vectorised_footprint_links: { + category: Category.Age, + title: "Extracted vectorised historical footprints links", + tooltip: "Extracted vectorised historical footprints links", + example: ["", "", ""], + } }; export const allFieldsConfig = { ...dataFields, ...buildingUserFields }; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql index dc30b17f..34132357 100644 --- a/migrations/041.ui_revamp_tweaks.down.sql +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -1,2 +1,4 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link; -ALTER TABLE buildings DROP COLUMN IF EXISTS location_alternative_footprint_links; \ No newline at end of file +ALTER TABLE buildings DROP COLUMN IF EXISTS location_alternative_footprint_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_raster_map_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_vectorised_footprint_links; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.up.sql b/migrations/041.ui_revamp_tweaks.up.sql index bb1d12b7..549dee4b 100644 --- a/migrations/041.ui_revamp_tweaks.up.sql +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -1,2 +1,4 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_alternative_footprint_links text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_alternative_footprint_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_raster_map_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_vectorised_footprint_links text[]; \ No newline at end of file From 9f842dd445e9cc1e1f9367b9bfe99effe2db1f47 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 13:19:04 +0100 Subject: [PATCH 10/81] Placeholder walkability index --- .../frontend/building/data-containers/street-context.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/frontend/building/data-containers/street-context.tsx b/app/src/frontend/building/data-containers/street-context.tsx index dd6d1457..025913fb 100644 --- a/app/src/frontend/building/data-containers/street-context.tsx +++ b/app/src/frontend/building/data-containers/street-context.tsx @@ -200,6 +200,14 @@ const StreetscapeView: React.FunctionComponent = (props) => ( } + +
= (props) => ( slug="" value="" mode='view' + tooltip='Under development' />
From fd1429e2da7b93a9f34f59b6eaf206a5102157da Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 16:40:45 +0100 Subject: [PATCH 11/81] Disable free-text boxes on Team category Edit Multi Data Entry to display something when editing and the box is disabled when it has no data. --- .../multi-data-entry/multi-data-entry.tsx | 142 +++++++++--------- .../building/data-containers/team.tsx | 5 +- app/src/frontend/config/data-fields-config.ts | 6 +- 3 files changed, 81 insertions(+), 72 deletions(-) diff --git a/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx b/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx index 318debf1..6c1565c6 100644 --- a/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx +++ b/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx @@ -69,83 +69,89 @@ export const MultiDataEntry: React.FC = ({ copy={copyable ? props.copy : undefined} />
+ { + values.length === 0 && !isEditing && +
+ +
+ } +
    { - values.length === 0 && !isEditing && + isEditing && isDisabled && values.length === 0 &&
    } -
      - { - values.map((val, i) => ( -
    • - edit(i, val)} + { + values.map((val, i) => ( +
    • + edit(i, val)} - maxLength={props.maxLength} - isUrl={props.isUrl} - valueTransform={props.valueTransform} + maxLength={props.maxLength} + isUrl={props.isUrl} + valueTransform={props.valueTransform} - autofill={props.autofill} - showAllOptionsOnEmpty={props.showAllOptionsOnEmpty} - /> - { - !isDisabled && -
      - -
      - } -
    • - )) - } - { - !isDisabled && -
    • - setNewValue(val)} - onConfirm={(_key, val) => addNew(val)} + autofill={props.autofill} + showAllOptionsOnEmpty={props.showAllOptionsOnEmpty} + /> + { + !isDisabled && +
      + +
      + } +
    • + )) + } + { + !isDisabled && +
    • + setNewValue(val)} + onConfirm={(_key, val) => addNew(val)} - maxLength={props.maxLength} - placeholder={props.placeholder} - isUrl={props.isUrl} - valueTransform={props.valueTransform} - confirmOnEnter={confirmOnEnter} + maxLength={props.maxLength} + placeholder={props.placeholder} + isUrl={props.isUrl} + valueTransform={props.valueTransform} + confirmOnEnter={confirmOnEnter} - autofill={props.autofill} - showAllOptionsOnEmpty={props.showAllOptionsOnEmpty} - confirmOnAutofillSelect={true} - /> - { - newValue != undefined && - <> -
      - -
      -
      - -
      - - } -
    • + autofill={props.autofill} + showAllOptionsOnEmpty={props.showAllOptionsOnEmpty} + confirmOnAutofillSelect={true} + /> + { + newValue != undefined && + <> +
      + +
      +
      + +
      + + } + }
diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index 4cd78237..cf9773ef 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -146,6 +146,7 @@ const TeamView: React.FunctionComponent = (props) => { tooltip={dataFields.landowner.tooltip} placeholder="" editableEntries={true} + disabled={true} /> = (props) => { tooltip={dataFields.developer_name.tooltip} placeholder="" editableEntries={true} + disabled={true} /> = (props) => { tooltip={dataFields.designers.tooltip} placeholder="" editableEntries={true} + disabled={true} /> = (props) => { user_verified_as={props.user_verified.designers} verified_count={props.building.verified.designers} /> - = (props) => { onChange={props.onChange} placeholder="" editableEntries={true} + disabled={true} /> For info on current land ownership, see 'Planning Controls'.", + tooltip: "Land owner when the building was constructed.

Free-text entry disabled for security reasons.

For info on current land ownership, see 'Planning Controls'.", example: ["", "", ""], }, landowner_source_type: { @@ -988,7 +988,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ designers: { category: Category.Team, title: "Who were the main designer(s)?", - tooltip: "Free text. First name, space, then Last name", + tooltip: "First name, space, then Last name.

Free-text entry disabled for security reasons.", example: ["", "", ""], }, designers_source_type: { @@ -1031,7 +1031,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, builder: { category: Category.Team, - title: "Name of builder/construction team", + title: "Name of builder/construction team.

Free-text entry disabled for security reasons.", example: ["", "", ""], }, builder_source_type: { From 392e9ced3d41407ac838f92cb3fcd69d5f654b18 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 17:14:27 +0100 Subject: [PATCH 12/81] Add links as an alternative to free-text names (Team) --- app/src/api/config/dataFields.ts | 16 ++++++ .../building/data-containers/team.tsx | 50 ++++++++++++++++++- app/src/frontend/config/data-fields-config.ts | 24 +++++++++ migrations/041.ui_revamp_tweaks.down.sql | 6 ++- migrations/041.ui_revamp_tweaks.up.sql | 6 ++- 5 files changed, 99 insertions(+), 3 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 4349fe86..e23c88b5 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -490,6 +490,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + developer_links: { + edit: true, + verify: true + }, developer_source_type: { edit: true, verify: true @@ -502,6 +506,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + landowner_links: { + edit: true, + verify: true + }, landowner_source_type: { edit: true, verify: true @@ -514,6 +522,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + designers_links: { + edit: true, + verify: true + }, designers_source_type: { edit: true, verify: true @@ -538,6 +550,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + builder_links: { + edit: true, + verify: true + }, builder_source_type: { edit: true, verify: true diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index cf9773ef..5db04212 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -4,9 +4,9 @@ import { commonSourceTypes, dataFields } from '../../config/data-fields-config'; import SelectDataEntry from '../data-components/select-data-entry'; import NumericDataEntry from '../data-components/numeric-data-entry'; import Verification from '../data-components/verification'; -import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import { LogicalDataEntry, LogicalDataEntryYesOnly } from '../data-components/logical-data-entry/logical-data-entry'; import { DataEntryGroup } from '../data-components/data-entry-group'; +import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import withCopyEdit from '../data-container'; @@ -156,6 +156,18 @@ const TeamView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.landowner} verified_count={props.building.verified.landowner} /> + = (props) => { user_verified_as={props.user_verified.developer_name} verified_count={props.building.verified.developer_name} /> + = (props) => { user_verified_as={props.user_verified.designers} verified_count={props.building.verified.designers} /> + = (props) => { user_verified_as={props.user_verified.builder} verified_count={props.building.verified.builder} /> +
Free-text entry disabled for security reasons.

For info on current land ownership, see 'Planning Controls'.", example: ["", "", ""], }, + landowner_links: { + category: Category.Team, + title: "Landowner link(s)", + tooltip: "A link to a webpage explaining who the land owner was when the building was built.", + example: ["", "", ""], + }, landowner_source_type: { category: Category.Team, title: "Source type", @@ -991,6 +1003,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "First name, space, then Last name.

Free-text entry disabled for security reasons.", example: ["", "", ""], }, + designers_links: { + category: Category.Team, + title: "Designer link(s)", + tooltip: "A link to webpage(s) explaining who the designer of the building was.", + example: ["", "", ""], + }, designers_source_type: { category: Category.Team, title: "Source type", @@ -1034,6 +1052,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ title: "Name of builder/construction team.

Free-text entry disabled for security reasons.", example: ["", "", ""], }, + builder_links: { + category: Category.Team, + title: "Builder link(s)", + tooltip: "A link to webpage(s) explaining who built the building was.", + example: ["", "", ""], + }, builder_source_type: { category: Category.Team, title: "Source type", diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql index 34132357..9b732961 100644 --- a/migrations/041.ui_revamp_tweaks.down.sql +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -1,4 +1,8 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link; ALTER TABLE buildings DROP COLUMN IF EXISTS location_alternative_footprint_links; ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_raster_map_links; -ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_vectorised_footprint_links; \ No newline at end of file +ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_vectorised_footprint_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS landowner_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS designers_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS builder_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS developer_links; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.up.sql b/migrations/041.ui_revamp_tweaks.up.sql index 549dee4b..3cd18818 100644 --- a/migrations/041.ui_revamp_tweaks.up.sql +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -1,4 +1,8 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_alternative_footprint_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_raster_map_links text[]; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_vectorised_footprint_links text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_vectorised_footprint_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS landowner_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS developer_links text[]; \ No newline at end of file From ad77c80a4efb11d26c4b158fa801540156851d92 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 17:18:27 +0100 Subject: [PATCH 13/81] Working tweak --- app/src/frontend/building/data-containers/planning.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/planning.tsx b/app/src/frontend/building/data-containers/planning.tsx index a034359d..6f75bc4e 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -432,7 +432,7 @@ const PlanningView: React.FunctionComponent = (props) => { - This section is designed to provide information on land parcels and their ownership type. Can you help us to crowdsource this information? + This section is designed to provide information on land parcels and their ownership type. Can you help us collect this information? Date: Wed, 28 Jun 2023 20:32:15 +0100 Subject: [PATCH 14/81] Add land parcel geometry link to Planning --- .../frontend/building/data-containers/planning.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/planning.tsx b/app/src/frontend/building/data-containers/planning.tsx index 6f75bc4e..463b840e 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -468,7 +468,19 @@ const PlanningView: React.FunctionComponent = (props) => { onChange={props.onChange} mode={props.mode} copy={props.copy} - /> + /> +
+ From dfb35a909ff72ccd42602ec4aa63526c3a6eb784 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 28 Jun 2023 20:35:03 +0100 Subject: [PATCH 15/81] Placeholder for new field --- app/src/frontend/building/data-containers/age-history.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index 5d8d1e57..3d0c4cb7 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -132,6 +132,13 @@ const AgeView: React.FunctionComponent = (props) => { /> } +
Date: Wed, 28 Jun 2023 20:57:28 +0100 Subject: [PATCH 16/81] Placeholders for possible new fields --- .../building/data-containers/planning.tsx | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/planning.tsx b/app/src/frontend/building/data-containers/planning.tsx index 463b840e..d2d3588e 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -87,7 +87,14 @@ const PlanningView: React.FunctionComponent = (props) => { : <> } - + + = (props) => { /> + + If you feel there are incorrect or missing data relating to this building please contact: planningdata@London.gov.uk From 1708d6e5f011bfe383a8a1b73613c23ed17a8a0e Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 10:53:17 +0100 Subject: [PATCH 17/81] Update menu links See issue #1195 --- app/src/frontend/header.tsx | 47 ++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/app/src/frontend/header.tsx b/app/src/frontend/header.tsx index 4a2e8951..ac3ec9cf 100644 --- a/app/src/frontend/header.tsx +++ b/app/src/frontend/header.tsx @@ -57,7 +57,8 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { }, { to: "https://github.com/colouring-cities/manual/wiki", - text: "Open Manual - Wiki", + text: "Colouring Cities Open Manual/Wiki", + disabled: false, external: true }, { @@ -65,12 +66,6 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { text: "Open code", external: true }, - { - to: "https://github.com/colouring-cities/manual/wiki", - text: "Colouring Cities Open Manual/Wiki", - disabled: false, - external: true - }, { to: "/showcase.html", text: "Case Study Showcase", @@ -79,12 +74,17 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { ], [ { - to: "https://pages.colouring.london", - text: "About", + to: "https://github.com/colouring-cities/manual/wiki/A.-What-is-the-CCRP%3F", + text: "About the Colouring Cities Research Programme", external: true }, { - to: "https://pages.colouring.london/buildingcategories", + to: "https://github.com/colouring-cities/manual/wiki/A2.-How-to%3F-Guides", + text: "How to Use", + external: true + }, + { + to: "https://github.com/colouring-cities/manual/wiki/I.--DATA", text: "Data Categories", external: true }, @@ -94,15 +94,10 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { external: true }, { - to: "https://pages.colouring.london/data-ethics", - text: "Data Ethics", + to: "https://github.com/colouring-cities/manual/wiki/C.-Ethical-framework-and-ethics-policies", + text: "Ethical Framework", external: true - }, - { - to: "https://pages.colouring.london/colouring-cities", - text: "Colouring Cities Research Programme", - external: true - }, + } ], [ { @@ -122,11 +117,11 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { ], [ { - to: "/privacy-policy.html", + to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-contributor-privacy-statement", text: "Privacy Policy" }, { - to: "/contributor-agreement.html", + to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-contributor--data-user-data-accuracy--ethical-use-agreement", text: "Contributor Agreement" }, { @@ -134,8 +129,16 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { text: "Code of Conduct" }, { - to: "/data-accuracy.html", - text: "Data Accuracy Agreement" + to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-contributor--data-user-data-accuracy--ethical-use-agreement", + text: "Data Accuracy and Use Agreement" + }, + { + to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-equality-diversity-and-inclusion-policy", + text: "Equality, Diversity and Inclusion" + }, + { + to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-protocols-for-international-academic-partners", + text: "CCRP Academic Partner Protocols" }, { to: "/ordnance-survey-uprn.html", From ff8618beb8cf34c83c1c7c31623cfdb9729d502b Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 11:09:12 +0100 Subject: [PATCH 18/81] Calculate total floors #1192 --- .../building/data-containers/size.tsx | 830 +++++++++--------- 1 file changed, 429 insertions(+), 401 deletions(-) diff --git a/app/src/frontend/building/data-containers/size.tsx b/app/src/frontend/building/data-containers/size.tsx index 1ae07ab8..763b2a5a 100644 --- a/app/src/frontend/building/data-containers/size.tsx +++ b/app/src/frontend/building/data-containers/size.tsx @@ -15,441 +15,469 @@ import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-e /** * Size view/edit section */ -const SizeView: React.FunctionComponent = (props) => ( - - - - - - - - - - {(props.building.size_storeys_source_type == commonSourceTypes[0] || - props.building.size_storeys_source_type == commonSourceTypes[1] || - props.building.size_storeys_source_type == null) ? <> : - <> = (props) => { + + // Calculate the total number of floors + let total_floors = 0; + + if (props.building.size_storeys_attic != null) { + total_floors += props.building.size_storeys_attic; + } + if (props.building.size_storeys_core != null) { + total_floors += props.building.size_storeys_core; + } + if (props.building.size_storeys_basement != null) { + total_floors += props.building.size_storeys_basement; + } + + return ( + + + + + + + + + + - - } - - - - - - {(props.building.size_height_apex_source_type == commonSourceTypes[0] || - props.building.size_height_apex_source_type == commonSourceTypes[1] || - props.building.size_height_apex_source_type == null) ? <> : - <> : + <> + + } + + + - - } -
- - - - {(props.building.size_height_eaves_source_type == commonSourceTypes[0] || - props.building.size_height_eaves_source_type == commonSourceTypes[1] || - props.building.size_height_eaves_source_type == null) ? <> : - <> + - - } -
- - - - - - - {(props.building.size_floor_area_source_type == commonSourceTypes[0] || - props.building.size_floor_area_source_type == commonSourceTypes[1] || - props.building.size_floor_area_source_type == null) ? <> : - <> : + <> + + } +
+ - - } -
- - - - - {(props.building.size_width_frontage_source_type == commonSourceTypes[0] || - props.building.size_width_frontage_source_type == commonSourceTypes[1] || - props.building.size_width_frontage_source_type == null) ? <> : - <> + - - } -
- - - - {(props.building.size_plot_area_total_source_type == commonSourceTypes[0] || - props.building.size_plot_area_total_source_type == commonSourceTypes[1] || - props.building.size_far_ratio_source_type == null) ? <> : - <> : + <> + + } +
+ + - - } -
- - - - {(props.building.size_far_ratio_source_type == commonSourceTypes[0] || - props.building.size_far_ratio_source_type == commonSourceTypes[1] || - props.building.size_far_ratio_source_type == null) ? <> : - <> + - - } -
- - - - {(props.building.size_parcel_geometry_source_type == commonSourceTypes[0] || - props.building.size_parcel_geometry_source_type == commonSourceTypes[1] || - props.building.size_parcel_geometry_source_type == null) ? <> : - <> + + {(props.building.size_floor_area_source_type == commonSourceTypes[0] || + props.building.size_floor_area_source_type == commonSourceTypes[1] || + props.building.size_floor_area_source_type == null) ? <> : + <> + + } +
+ + + + + {(props.building.size_width_frontage_source_type == commonSourceTypes[0] || + props.building.size_width_frontage_source_type == commonSourceTypes[1] || + props.building.size_width_frontage_source_type == null) ? <> : + <> + + } +
+ + + + {(props.building.size_plot_area_total_source_type == commonSourceTypes[0] || + props.building.size_plot_area_total_source_type == commonSourceTypes[1] || + props.building.size_far_ratio_source_type == null) ? <> : + <> + + } +
+ + + + {(props.building.size_far_ratio_source_type == commonSourceTypes[0] || + props.building.size_far_ratio_source_type == commonSourceTypes[1] || + props.building.size_far_ratio_source_type == null) ? <> : + <> + + } +
+ - - } -
-
-); + + + {(props.building.size_parcel_geometry_source_type == commonSourceTypes[0] || + props.building.size_parcel_geometry_source_type == commonSourceTypes[1] || + props.building.size_parcel_geometry_source_type == null) ? <> : + <> + + } +
+
+ ) +}; const SizeContainer = withCopyEdit(SizeView); export default SizeContainer; From a765f94d2074b85c24ccef9e8fe54e78faa38ba8 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 13:50:49 +0100 Subject: [PATCH 19/81] Instruction text when editing --- .../data-components/multi-data-entry/multi-data-entry.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx b/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx index 6c1565c6..5ad08e6c 100644 --- a/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx +++ b/app/src/frontend/building/data-components/multi-data-entry/multi-data-entry.tsx @@ -79,7 +79,7 @@ export const MultiDataEntry: React.FC = ({ { isEditing && isDisabled && values.length === 0 &&
- +
} { From 8edac435c10c4b8e3ede5fa0d511ab2d14d5bff5 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 13:51:15 +0100 Subject: [PATCH 20/81] Tweaks to common source types list --- app/src/frontend/config/data-fields-config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 83601dbc..8ef8a77e 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -7,12 +7,13 @@ let ccconfig: CCConfig = require('../../cc-config.json') */ export const commonSourceTypes = [ "Assessed by eye/personal knowledge of the building", - "Assessed using expert knowledge of building or building type", + "Assessed using professional knowledge of building or building type", "Assessed using streetview photographs, satellite imagery or maps", "Assessed by specialist emergency group", + "Current government record/database", "Live streamed from a government source", - "Current government record/dataset", - "Independently managed public database", + "Open database", + "Other independently managed public database", "Commercial database", "Inferred computationally using existing open attribute data", ]; From 64969ecb7e35e7f7a80f431803f11524fec1b39a Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 13:52:11 +0100 Subject: [PATCH 21/81] New links and bug fixes - Add link to Discussions instead of the old forum - Make sure external links are correctly flagged - Make external links open in new tab --- app/src/frontend/header.tsx | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/src/frontend/header.tsx b/app/src/frontend/header.tsx index ac3ec9cf..04979244 100644 --- a/app/src/frontend/header.tsx +++ b/app/src/frontend/header.tsx @@ -105,24 +105,26 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { text: "Top Contributors" }, { - to: "https://discuss.colouring.london", + to: config.githubURL+"/discussions", text: "Discussion Forum", external: true }, - { - to: "https://discuss.colouring.london/c/blog/9", - text: "Blog", - external: true - }, + // { + // to: "https://discuss.colouring.london/c/blog/9", + // text: "Blog", + // external: true + // }, ], [ { to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-contributor-privacy-statement", - text: "Privacy Policy" + text: "Privacy Policy", + external: true }, { to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-contributor--data-user-data-accuracy--ethical-use-agreement", - text: "Contributor Agreement" + text: "Contributor Agreement", + external: true }, { to: "/code-of-conduct.html", @@ -130,15 +132,18 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { }, { to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-contributor--data-user-data-accuracy--ethical-use-agreement", - text: "Data Accuracy and Use Agreement" + text: "Data Accuracy and Use Agreement", + external: true }, { to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-equality-diversity-and-inclusion-policy", - text: "Equality, Diversity and Inclusion" + text: "Equality, Diversity and Inclusion", + external: true }, { to: "https://github.com/colouring-cities/manual/wiki/C1.-Protocols,-codes-of-conduct-&-data-sharing-agreements#ccrp-protocols-for-international-academic-partners", - text: "CCRP Academic Partner Protocols" + text: "CCRP Academic Partner Protocols", + external: true }, { to: "/ordnance-survey-uprn.html", @@ -186,7 +191,7 @@ const InternalNavLink: React.FC<{to: string; onClick: () => void}> = ({ to, onCl ); const ExternalNavLink: React.FC<{to: string}> = ({ to, children }) => ( - + {children} ); From 8b38f7a076c5f2d0419be442ea7e8b72c4088620 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 14:29:23 +0100 Subject: [PATCH 22/81] Team update - Remove unused data from "General info" - Fix logic of boolean question - Update hints etc. --- .../building/data-containers/team.tsx | 53 +------------------ app/src/frontend/config/data-fields-config.ts | 19 +++---- 2 files changed, 12 insertions(+), 60 deletions(-) diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index 5db04212..63779bd6 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -22,56 +22,6 @@ const TeamView: React.FunctionComponent = (props) => { return (
- - - - {(props.building.date_source == dataFields.date_source.items[0] || - props.building.date_source == dataFields.date_source.items[1] || - props.building.date_source == null) ? <> : - <> - - - } -
= (props) => { onChange={props.onChange} tooltip={dataFields.has_extension.tooltip} /> - {props.building.has_extension ? ( + {props.building.has_extension!=null && !props.building.has_extension ? ( <> = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} + tooltip={dataFields.builder.tooltip} placeholder="" editableEntries={true} disabled={true} diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 8ef8a77e..d4d64e39 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -909,8 +909,8 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, has_extension: { category: Category.Team, - title: "Was a later extension added?", - tooltip: "", + title: "Does this information relate to the original main building?", + tooltip: "If the data in this section relates to the original main building, select \"yes\". If the data relates to a later extension/ redevelopment, select \"no\".", example: false }, extension_year: { @@ -951,13 +951,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ developer_name: { category: Category.Team, title: "Who were the developer(s)?", - tooltip: "Free text. First name, space, then Last name", + tooltip: "Name(s) of the building's developers.

Free-text entry disabled for security reasons.", example: ["", "", ""], }, developer_links: { category: Category.Team, title: "Developer link(s)", - tooltip: "A link to a webpage explaining who the developer of the building was.", + tooltip: "Link(s) to webpage(s) explaining who developed the building.", example: ["", "", ""], }, developer_source_type: { @@ -982,7 +982,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ landowner_links: { category: Category.Team, title: "Landowner link(s)", - tooltip: "A link to a webpage explaining who the land owner was when the building was built.", + tooltip: "Link(s) to webpage(s) explaining who owned the land when when the building was built.", example: ["", "", ""], }, landowner_source_type: { @@ -1001,13 +1001,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ designers: { category: Category.Team, title: "Who were the main designer(s)?", - tooltip: "First name, space, then Last name.

Free-text entry disabled for security reasons.", + tooltip: "Free-text entry disabled for security reasons.", example: ["", "", ""], }, designers_links: { category: Category.Team, title: "Designer link(s)", - tooltip: "A link to webpage(s) explaining who the designer of the building was.", + tooltip: "Link(s) to webpage(s) explaining who designed the building.", example: ["", "", ""], }, designers_source_type: { @@ -1050,13 +1050,14 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, builder: { category: Category.Team, - title: "Name of builder/construction team.

Free-text entry disabled for security reasons.", + title: "Name of builder/construction team.", + tooltip: "Free-text entry disabled for security reasons.", example: ["", "", ""], }, builder_links: { category: Category.Team, title: "Builder link(s)", - tooltip: "A link to webpage(s) explaining who built the building was.", + tooltip: "Link(s) to webpage(s) explaining who built the building.", example: ["", "", ""], }, builder_source_type: { From fae06c6910ad5d3b1aa95495be5813aa072fe75a Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 14:30:32 +0100 Subject: [PATCH 23/81] "Domestic" -> "Residential" --- app/src/frontend/config/data-fields-config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index d4d64e39..fe9b5892 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -602,13 +602,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, sust_dec: { category: Category.EnergyPerformance, - title: "Non-domestic Building Energy Rating", + title: "Non-residential Building Energy Rating", tooltip: "Display Energy Certificate (DEC) Any public building should have (and display) a DEC. Showing how the energy use for that building compares to other buildings with same use", example: "G", }, sust_aggregate_estimate_epc: { category: Category.EnergyPerformance, - title: "Domestic Building Energy Rating", + title: "Residential Building Energy Rating", tooltip: "Energy Performance Certificate (EPC) Any premises sold or rented is required to have an EPC to show how energy efficient it is. Only buildings rate grade E or higher may be rented", example: "", }, From 11258132e5ce7f3af82d3ad224f121641725d355 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 14:31:21 +0100 Subject: [PATCH 24/81] Remove placeholder field --- app/src/frontend/building/data-containers/community.tsx | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/src/frontend/building/data-containers/community.tsx b/app/src/frontend/building/data-containers/community.tsx index 88ac3f68..6ee45f8a 100644 --- a/app/src/frontend/building/data-containers/community.tsx +++ b/app/src/frontend/building/data-containers/community.tsx @@ -48,13 +48,6 @@ const CommunityView: React.FunctionComponent = (props) => {
- {(props.building.is_domestic === "no" || props.building.is_domestic === "mixed domestic/non-domestic") ? <> Date: Thu, 29 Jun 2023 14:37:11 +0100 Subject: [PATCH 25/81] Typo fix --- app/src/frontend/config/data-fields-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index fe9b5892..4540d3b5 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -1038,7 +1038,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, designer_awards: { category: Category.Team, - title: "Has the building won any?", + title: "Has the building won any awards?", tooltip: "", example: false }, From 621601745b88d19c58c840db05f29b2811945441 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 14:39:18 +0100 Subject: [PATCH 26/81] Remove HR --- app/src/frontend/building/data-containers/street-context.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/street-context.tsx b/app/src/frontend/building/data-containers/street-context.tsx index 025913fb..5fd400a7 100644 --- a/app/src/frontend/building/data-containers/street-context.tsx +++ b/app/src/frontend/building/data-containers/street-context.tsx @@ -74,7 +74,6 @@ const StreetscapeView: React.FunctionComponent = (props) => ( user_verified_as={props.user_verified.context_flats_garden} verified_count={props.building.verified.context_flats_garden} /> -
Date: Thu, 29 Jun 2023 14:41:15 +0100 Subject: [PATCH 27/81] Streetscape -> StreetContext --- .../building/data-containers/street-context.tsx | 11 ++++------- app/src/frontend/config/category-ui-config.ts | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/frontend/building/data-containers/street-context.tsx b/app/src/frontend/building/data-containers/street-context.tsx index 5fd400a7..33b571d9 100644 --- a/app/src/frontend/building/data-containers/street-context.tsx +++ b/app/src/frontend/building/data-containers/street-context.tsx @@ -1,11 +1,8 @@ import React, { Fragment } from 'react'; -import InfoBox from '../../components/info-box'; import { commonSourceTypes, dataFields } from '../../config/data-fields-config'; import DataEntry from '../data-components/data-entry'; import NumericDataEntry from '../data-components/numeric-data-entry'; - import withCopyEdit from '../data-container'; - import { CategoryViewProps } from './category-view-props'; import { DataEntryGroup } from '../data-components/data-entry-group'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; @@ -13,9 +10,9 @@ import SelectDataEntry from '../data-components/select-data-entry'; import Verification from '../data-components/verification'; /** -* Streetscape view/edit section +* Street Context view/edit section */ -const StreetscapeView: React.FunctionComponent = (props) => ( +const StreetContextView: React.FunctionComponent = (props) => ( = (props) => ( ); -const StreetscapeContainer = withCopyEdit(StreetscapeView); +const StreetContextContainer = withCopyEdit(StreetContextView); -export default StreetscapeContainer; +export default StreetContextContainer; diff --git a/app/src/frontend/config/category-ui-config.ts b/app/src/frontend/config/category-ui-config.ts index 64d751e3..fdc2d332 100644 --- a/app/src/frontend/config/category-ui-config.ts +++ b/app/src/frontend/config/category-ui-config.ts @@ -7,7 +7,7 @@ import ResilienceContainer from '../building/data-containers/resilience'; import LocationContainer from '../building/data-containers/location'; import PlanningContainer from '../building/data-containers/planning'; import SizeContainer from '../building/data-containers/size'; -import StreetscapeContainer from '../building/data-containers/street-context'; +import StreetContextContainer from '../building/data-containers/street-context'; import SustainabilityContainer from '../building/data-containers/energy-performance'; import TeamContainer from '../building/data-containers/team'; import TypeContainer from '../building/data-containers/typology'; @@ -22,7 +22,7 @@ export const categoryUiConfig: {[key in Category]: DataContainerType} = { [Category.Age]: AgeContainer, [Category.Size]: SizeContainer, [Category.Construction]: ConstructionContainer, - [Category.StreetContext]: StreetscapeContainer, + [Category.StreetContext]: StreetContextContainer, [Category.Team]: TeamContainer, [Category.Planning]: PlanningContainer, [Category.EnergyPerformance]: SustainabilityContainer, From b44738e6277a9ed2399f9004ecc4e606103c7486 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 14:51:31 +0100 Subject: [PATCH 28/81] Change to logical/boolean questions --- .../data-containers/street-context.tsx | 12 ++++-------- app/src/frontend/config/data-fields-config.ts | 18 +++--------------- migrations/042.ui_revamp_tweaks.refactor.sql | 7 +++++++ 3 files changed, 14 insertions(+), 23 deletions(-) create mode 100644 migrations/042.ui_revamp_tweaks.refactor.sql diff --git a/app/src/frontend/building/data-containers/street-context.tsx b/app/src/frontend/building/data-containers/street-context.tsx index 33b571d9..351c4ddb 100644 --- a/app/src/frontend/building/data-containers/street-context.tsx +++ b/app/src/frontend/building/data-containers/street-context.tsx @@ -8,6 +8,7 @@ import { DataEntryGroup } from '../data-components/data-entry-group'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; import Verification from '../data-components/verification'; +import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; /** * Street Context view/edit section @@ -15,11 +16,10 @@ import Verification from '../data-components/verification'; const StreetContextView: React.FunctionComponent = (props) => ( - = (props) => user_verified_as={props.user_verified.context_front_garden} verified_count={props.building.verified.context_front_garden} /> - = (props) => copy={props.copy} onChange={props.onChange} tooltip={dataFields.context_back_garden.tooltip} - //placeholder={dataFields.context_back_garden.example} - options={dataFields.context_back_garden.items} /> = (props) => user_verified_as={props.user_verified.context_back_garden} verified_count={props.building.verified.context_back_garden} /> - = (props) => copy={props.copy} onChange={props.onChange} tooltip={dataFields.context_flats_garden.tooltip} - //placeholder={dataFields.context_flats_garden.example} - options={dataFields.context_flats_garden.items} /> Date: Thu, 29 Jun 2023 15:21:20 +0100 Subject: [PATCH 29/81] Green roof & solar panels --- app/src/api/config/dataFields.ts | 24 ++++ .../data-containers/energy-performance.tsx | 111 ++++++++++++++++-- app/src/frontend/config/data-fields-config.ts | 41 ++++++- migrations/041.ui_revamp_tweaks.down.sql | 9 +- migrations/041.ui_revamp_tweaks.up.sql | 9 +- 5 files changed, 180 insertions(+), 14 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index e23c88b5..e77c8358 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -717,6 +717,30 @@ export const buildingAttributesConfig = valueType()({ /* eslint age_historical_vectorised_footprint_links : { edit: true, verify: true + }, + energy_solar : { + edit: true, + verify: true + }, + energy_solar_source_type : { + edit: true, + verify: true + }, + energy_solar_source_links : { + edit: true, + verify: true + }, + energy_green_roof : { + edit: true, + verify: true + }, + energy_green_roof_source_type : { + edit: true, + verify: true + }, + energy_green_roof_source_links : { + edit: true, + verify: true } }); diff --git a/app/src/frontend/building/data-containers/energy-performance.tsx b/app/src/frontend/building/data-containers/energy-performance.tsx index d20e380c..aa7f0971 100644 --- a/app/src/frontend/building/data-containers/energy-performance.tsx +++ b/app/src/frontend/building/data-containers/energy-performance.tsx @@ -11,6 +11,7 @@ import InfoBox from '../../components/info-box'; import { CategoryViewProps } from './category-view-props'; 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 EnergyCategoryOptions = ["A", "B", "C", "D", "E", "F", "G"]; const BreeamRatingOptions = [ @@ -88,7 +89,7 @@ const SustainabilityView: React.FunctionComponent = (props) = /> - = (props) = } - + + {props.building.energy_solar == null ? <> : + <> + + {(props.building.energy_solar_source_type == dataFields.energy_solar_source_type.items[0] || + props.building.energy_solar_source_type == dataFields.energy_solar_source_type.items[1] || + props.building.energy_solar_source_type == null) ? <> : + <> + + + } + + } - + + {props.building.energy_green_roof == null ? <> : + <> + + {(props.building.energy_green_roof_source_type == dataFields.energy_green_roof_source_type.items[0] || + props.building.energy_green_roof_source_type == dataFields.energy_green_roof_source_type.items[1] || + props.building.energy_green_roof_source_type == null) ? <> : + <> + + + } + + } ); diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 8177e44d..09cf2357 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -1330,7 +1330,46 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ title: "Extracted vectorised historical footprints links", tooltip: "Extracted vectorised historical footprints links", example: ["", "", ""], - } + }, + + energy_solar: { + category: Category.EnergyPerformance, + title: "Does the building have solar panels?", + tooltip: "Are there any kinds of solar panels on the roof of the building?", + example: true + }, + energy_solar_source_type: { + category: Category.EnergyPerformance, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + energy_solar_source_links: { + category: Category.EnergyPerformance, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, + energy_green_roof: { + category: Category.EnergyPerformance, + title: "Does the building have green walls/green roof?", + tooltip: "Are there any green walls, or a green roof, on the building?", + example: true + }, + energy_green_roof_source_type: { + category: Category.EnergyPerformance, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + energy_green_roof_source_links: { + category: Category.EnergyPerformance, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, }; export const allFieldsConfig = { ...dataFields, ...buildingUserFields }; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql index 9b732961..49a30198 100644 --- a/migrations/041.ui_revamp_tweaks.down.sql +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -5,4 +5,11 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_vectorised_footprint_ ALTER TABLE buildings DROP COLUMN IF EXISTS landowner_links; ALTER TABLE buildings DROP COLUMN IF EXISTS designers_links; ALTER TABLE buildings DROP COLUMN IF EXISTS builder_links; -ALTER TABLE buildings DROP COLUMN IF EXISTS developer_links; \ No newline at end of file +ALTER TABLE buildings DROP COLUMN IF EXISTS developer_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_solar; +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_solar_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_solar_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_green_roof; +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_green_roof_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_green_roof_source_links; \ No newline at end of file diff --git a/migrations/041.ui_revamp_tweaks.up.sql b/migrations/041.ui_revamp_tweaks.up.sql index 3cd18818..d35143f9 100644 --- a/migrations/041.ui_revamp_tweaks.up.sql +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -5,4 +5,11 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_vectorised_footpri ALTER TABLE buildings ADD COLUMN IF NOT EXISTS landowner_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_links text[]; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS developer_links text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS developer_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_solar boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_solar_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_solar_source_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_green_roof boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_green_roof_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_green_roof_source_links text[]; \ No newline at end of file From 9b73dd5e622dfec1d0c598b91eb5884861b038c3 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 16:54:17 +0100 Subject: [PATCH 30/81] Activate fields in Planning Section - Year of Completion #1197 - Incomplete/missing data #1198 --- app/src/api/config/dataFields.ts | 16 ++ .../building/data-containers/planning.tsx | 165 +++++++++++++----- app/src/frontend/config/data-fields-config.ts | 33 +++- migrations/041.ui_revamp_tweaks.down.sql | 7 +- migrations/041.ui_revamp_tweaks.up.sql | 7 +- migrations/042.ui_revamp_tweaks.refactor.sql | 9 +- 6 files changed, 187 insertions(+), 50 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index e77c8358..0cf01a03 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -285,6 +285,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + planning_crowdsourced_site_completion_source_type: { + edit: true, + verify: true, + }, + planning_crowdsourced_site_completion_source_links: { + edit: true, + verify: true, + }, planning_crowdsourced_planning_id: { edit: true, verify: true, @@ -333,6 +341,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + planning_missing_data: { + edit: true, + verify: true, + }, + planning_missing_data_links: { + edit: true, + verify: true, + }, sust_breeam_rating: { edit: true, verify: true, diff --git a/app/src/frontend/building/data-containers/planning.tsx b/app/src/frontend/building/data-containers/planning.tsx index d2d3588e..ce091231 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -65,6 +65,8 @@ const PlanningView: React.FunctionComponent = (props) => { } const { flood, floodSwitchOnClick, housing, housingSwitchOnClick, creative, creativeSwitchOnClick, vista, vistaSwitchOnClick, parcel, parcelSwitchOnClick, conservation, conservationSwitchOnClick, darkLightTheme } = useDisplayPreferences(); const communityLinkUrl = `/${props.mode}/${Category.Community}/${props.building.building_id}`; + const currentYear = new Date().getFullYear(); + return ( @@ -88,36 +90,111 @@ const PlanningView: React.FunctionComponent = (props) => { } - - + {props.building.planning_crowdsourced_site_completion_status == null ? <> : + <> + + + + {(props.building.planning_crowdsourced_site_completion_source_type == dataFields.planning_crowdsourced_site_completion_source_type.items[0] || + props.building.planning_crowdsourced_site_completion_source_type == dataFields.planning_crowdsourced_site_completion_source_type.items[1] || + props.building.planning_crowdsourced_site_completion_source_type == null) ? <> : + <> + + + } + + } - - + {props.building.planning_missing_data == null ? <> : + <> + + + } If you feel there are incorrect or missing data relating to this building please contact: planningdata@London.gov.uk @@ -179,41 +256,41 @@ const PlanningView: React.FunctionComponent = (props) => {
- +
+ { return "https://historicengland.org.uk/listing/the-list/list-entry/" + id + "?section=official-list-entry" } } - linkDescriptionFunction={(id: String) => { return "ID Link" } } + mode={props.mode} /> - + {(props.building.planning_heritage_at_risk == null || props.building.planning_heritage_at_risk == false) ? <> : + <> + + + + } +
+ - - + + {(props.building.planning_world_heritage_site == null || props.building.planning_world_heritage_site == false) ? <> : + <> + { return "https://whc.unesco.org/en/list/" + id } } + linkDescriptionFunction={(id: String) => { return "ID Link" } } + /> + + + } +
+ - - + + {(props.building.planning_local_list == null || props.building.planning_local_list == false) ? <> : + <> + + + + } +
+ { return "https://whc.unesco.org/en/list/" + id } } - linkDescriptionFunction={(id: String) => { return "ID Link" } } - /> - - + + {(props.building.planning_in_conservation_area == null || props.building.planning_in_conservation_area == false) ? <> : + <> + + {props.building.planning_in_conservation_area_url === "" ? "Our CA map records this building as not being within a CA. To help us verify this, please click ā€˜verifyā€™ or, if info is incorrect, please add the local authorityā€™s CA appraisal link." : "" } + {props.building.planning_in_conservation_area_url === "identified as listed: please replace with links" ? "Our CA map records this building as being within a CA. To help us verify this information please add the local authorityā€™s CA appraisal link and then click ā€˜verifyā€™." : "" } + + + } +
+ - - - {/* - + + {(props.building.planning_in_apa == null || props.building.planning_in_apa == false) ? <> : + <> + + + + } +
+ - - */} - + + {(props.building.planning_scientific_interest == null || props.building.planning_scientific_interest == false) ? <> : + <> + + {(props.building.planning_scientific_interest_source_type == dataFields.planning_scientific_interest_source_type.items[0] || + props.building.planning_scientific_interest_source_type == dataFields.planning_scientific_interest_source_type.items[1] || + props.building.planning_scientific_interest_source_type == null) ? <> : + <> + + + } + + } +
+ - {props.building.planning_in_conservation_area_url === "" ? "Our CA map records this building as not being within a CA. To help us verify this, please click ā€˜verifyā€™ or, if info is incorrect, please add the local authorityā€™s CA appraisal link." : "" } - {props.building.planning_in_conservation_area_url === "identified as listed: please replace with links" ? "Our CA map records this building as being within a CA. To help us verify this information please add the local authorityā€™s CA appraisal link and then click ā€˜verifyā€™." : "" } - - + /> - {/* - - - */} - - + user_verified={props.user_verified.hasOwnProperty("planning_historic_area_assessment")} + user_verified_as={props.user_verified.planning_historic_area_assessment} + verified_count={props.building.verified.planning_historic_area_assessment} + /> + {(props.building.planning_historic_area_assessment == null || props.building.planning_historic_area_assessment == false) ? <> : + <> + + + + }
diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 617fda6f..c2f24093 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -736,6 +736,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "1112/QWERTY", //tooltip: , }, + planning_in_conservation_area: { + category: Category.Planning, + title: "Is the building in a conservation area?", + tooltip: "Is the building in a conservation area?", + example: true, + }, planning_in_conservation_area_id: { category: Category.Planning, title: "Conservation Area identifier", @@ -766,9 +772,15 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "", //tooltip: , }, + planning_world_heritage_site: { + category: Category.Planning, + title: "Is the building on a World Heritage Site?", + tooltip: "Is the building on a World Heritage Site", + example: true, + }, planning_world_list_id: { category: Category.Planning, - title: "If the building is on a World Heritage Site please add the ID:", + title: "If the building is on a World Heritage Site please add the ID:", example: "488", //tooltip: , }, @@ -778,18 +790,36 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "", //tooltip: , }, + planning_in_apa: { + category: Category.Planning, + title: "Is the building in an area of archaeological priority?", + tooltip: "Is the building in an area of archaeological priority?", + example: true, + }, planning_in_apa_url: { category: Category.Planning, title: "Is the building in an area of archaeological priority?", example: "", //tooltip: , }, + planning_local_list: { + category: Category.Planning, + title: "Is the building a locally listed heritage asset?", + tooltip: "Is the building a locally listed heritage asset?", + example: true, + }, planning_local_list_url: { category: Category.Planning, title: "Is the building a locally listed heritage asset?", example: "", //tooltip: , }, + planning_historic_area_assessment: { + category: Category.Planning, + title: "Does the building have any other type of designation?", + tooltip: "Does the building have any other type of designation?", + example: true, + }, planning_historic_area_assessment_url: { category: Category.Planning, title: "Does it have any other type of designation?", @@ -814,6 +844,31 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "URL(s) for missing planning information", example: ["", "", ""], }, + planning_heritage_at_risk: { + category: Category.Planning, + title: "Is the building on a heritage at risk register?", + tooltip: "Is the building on a heritage at risk register?", + example: true, + }, + planning_scientific_interest: { + category: Category.Planning, + title: "Is the building on a site of special scientific interest?", + tooltip: "Is the building on a site of special scientific interest?", + example: true, + }, + planning_scientific_interest_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for site of special scientific interest data", + example: "", + items: commonSourceTypes + }, + planning_scientific_interest_source_links: { + category: Category.Team, + title: "Source links", + tooltip: "URL(s) for site of special scientific interest data", + example: ["", "", ""], + }, is_domestic: { diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql index 795fca5e..6a6482d5 100644 --- a/migrations/041.ui_revamp_tweaks.down.sql +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -18,3 +18,17 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completio ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completion_source_links; ALTER TABLE buildings DROP COLUMN IF EXISTS planning_missing_data; ALTER TABLE buildings DROP COLUMN IF EXISTS planning_missing_data_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS date_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS date_source_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_heritage_at_risk; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_world_heritage_site; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_local_list; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_conservation_area; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_apa; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_historic_area_assessment; + +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_scientific_interest; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_scientific_interest_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_scientific_interest_source_links; diff --git a/migrations/041.ui_revamp_tweaks.up.sql b/migrations/041.ui_revamp_tweaks.up.sql index dce58c01..04b06baf 100644 --- a/migrations/041.ui_revamp_tweaks.up.sql +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -20,4 +20,15 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_missing_data boolean; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_missing_data_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS date_source_type text; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS date_source_links text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS date_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_heritage_at_risk boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_world_heritage_site boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_local_list boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_conservation_area boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_apa boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_historic_area_assessment boolean; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_scientific_interest boolean; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_scientific_interest_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_scientific_interest_source_links text[]; From 49ab1c68368b404809788011f7d561ec5db73ce2 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 18 Jul 2023 12:32:44 +0100 Subject: [PATCH 37/81] Typology Section Updates #1151 --- app/src/api/config/dataFields.ts | 58 +++- app/src/api/services/autofill.ts | 1 + .../building/data-containers/typology.tsx | 295 ++++++++++++++---- app/src/frontend/config/data-fields-config.ts | 138 +++++++- migrations/043.typology_updates.down.sql | 18 ++ migrations/043.typology_updates_up.sql | 18 ++ 6 files changed, 451 insertions(+), 77 deletions(-) create mode 100644 migrations/043.typology_updates.down.sql create mode 100644 migrations/043.typology_updates_up.sql diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 624ed479..6a249cb5 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -423,6 +423,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + building_attachment_source_type: { + edit: true, + verify: true, + }, + building_attachment_source_links: { + edit: true, + verify: true, + }, date_change_building_use: { edit: true, }, @@ -801,7 +809,55 @@ export const buildingAttributesConfig = valueType()({ /* eslint energy_green_roof_source_links : { edit: true, verify: true - } + }, + typology_classification : { + edit: true, + verify: true + }, + typology_classification_source_type : { + edit: true, + verify: true + }, + typology_classification_source_links: { + edit: true, + verify: true + }, + typology_style_period : { + edit: true, + verify: true + }, + typology_style_period_source_type : { + edit: true, + verify: true + }, + typology_style_period_source_links: { + edit: true, + verify: true + }, + typology_dynamic_classification : { + edit: true, + verify: true + }, + typology_dynamic_classification_source_type : { + edit: true, + verify: true + }, + typology_dynamic_classification_source_links: { + edit: true, + verify: true + }, + typology_original_use : { + edit: true, + verify: true + }, + typology_original_use_source_type : { + edit: true, + verify: true + }, + typology_original_use_source_links: { + edit: true, + verify: true + }, }); diff --git a/app/src/api/services/autofill.ts b/app/src/api/services/autofill.ts index 8021a277..f0e1c285 100644 --- a/app/src/api/services/autofill.ts +++ b/app/src/api/services/autofill.ts @@ -10,6 +10,7 @@ type GetAutofillOptionsFn = (value: string, all?: boolean) => Promise = (props) => { return ( - + + + + + {(props.building.typology_classification_source_type == commonSourceTypes[0] || + props.building.typology_classification_source_type == commonSourceTypes[1] || + props.building.typology_classification_source_type == null) ? <> : + <> + + + } + + + + + + {(props.building.typology_style_period_source_type == commonSourceTypes[0] || + props.building.typology_style_period_source_type == commonSourceTypes[1] || + props.building.typology_style_period_source_type == null) ? <> : + <> + + + } + + + + + + {(props.building.typology_dynamic_classification_source_type == commonSourceTypes[0] || + props.building.typology_dynamic_classification_source_type == commonSourceTypes[1] || + props.building.typology_dynamic_classification_source_type == null) ? <> : + <> + + + } + + + + + + {(props.building.typology_original_use_source_type == commonSourceTypes[0] || + props.building.typology_original_use_source_type == commonSourceTypes[1] || + props.building.typology_original_use_source_type == null) ? <> : + <> + + + } + + = (props) => { user_verified_as={props.user_verified.building_attachment_form} verified_count={props.building.verified.building_attachment_form} /> - - -
- - - - + {(props.building.building_attachment_source_type == commonSourceTypes[0] || + props.building.building_attachment_source_type == commonSourceTypes[1] || + props.building.building_attachment_source_type == null) ? <> : + <> + + + }
- - - + {/*} + = (props) => { value="" mode='view' /> + {/* = (props) => { 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 c2f24093..ebd235c0 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -310,26 +310,23 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, building_attachment_form: { category: Category.Typology, - title: "Attachment type/adjacency", + 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: "", }, - date_change_building_use: { - category: Category.Typology, - title: "When did use change?", - tooltip: "This is the date the building stopped being used for for the function it was built for. I.e. if it was Victorian warehouse which is now an office this would be when it became an office or if it was something before that, maybe a garage then the date that happened", - example: 1920, - }, - /** - * original_building_use does not exist in database yet. - * Slug needs to be adjusted if the db column will be named differently - */ - original_building_use: { - category: Category.Typology, - title: "Original building use", - tooltip: "What was the building originally used for when it was built?", + building_attachment_source_type: { + category: Category.Age, + title: "Source type", + tooltip: "Source type for the building data above", + items: commonSourceTypes, example: "", }, + building_attachment_source_links: { + category: Category.Age, + title: "Source link(s)", + tooltip: "URL for data reference", + example: ["", "", ""], + }, size_roof_shape: { category: Category.Typology, title: "Roof type", @@ -1466,6 +1463,117 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Source link(s) for street width data", example: ["", "", ""], }, + + typology_classification: { + category: Category.Typology, + title: "Which description best suits the building and its context?", + tooltip: "HINT: Adapted from building type classifications developed in urban morphology. See https://www.smog.chalmers.se/ 'Space Matrix' for further information.", + example: "High rise: Not part of a group/cluster", + items: [ + 'Low-rise: Not part of a group/cluster (1-3 core floors- excluding extensions)', + 'Low-rise: Part of dense block/row/terrace', + 'Low-rise: Part of group of widely spaced blocks (includes semi-detached houses)', + 'Mid-rise: Not part of a group/cluster (4-7 core floors)', + 'Mid-rise: Part of group of densely spaced blocks', + 'Mid-rise: Part of group of widely spaced blocks', + 'High rise: Not part of a group/cluster', + 'High-rise: Part of group of densely spaced blocks (8 + core floors)', + 'High-rise: Part of group of widely spaced blocks', + ] + }, + typology_classification_source_type: { + category: Category.Typology, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + typology_classification_source_links: { + category: Category.Typology, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, + typology_style_period: { + category: Category.Typology, + title: "Which description best suits the building's architectural style/historical period?", + tooltip: "", + example: "High rise: Not part of a group/cluster", + items: [ + 'Roman (43AD-410)', + 'Early Medieval (410-1066)', + 'Mid- Late Medieval (1066-1485)', + 'Tudor (1485-1603)', + 'Stuart (1603 -1714)', + 'Georgian/William IV (1714-1837)', + 'Victorian (1837-1901)', + 'Edwardian (1901-1914)', + 'World War I (1914-18)', + 'Interwar (1918-39)', + 'World War II (1939-45)', + 'Post war (1945-1975)', + 'Postmodern (1975-1990)', + '1990s', + '2000s/2010s', + '2020s', + ] + }, + typology_style_period_source_type: { + category: Category.Typology, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + typology_style_period_source_links: { + category: Category.Typology, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, + typology_dynamic_classification: { + category: Category.Typology, + title: "Which description best suits the building's plot?", + tooltip: "HINT: Based on a dynamic classification system for urban tissue developed by Brenda Case Scheer. For further information see: https://www.researchgate.net/publication/242150847_The_Anatomy_of_Sprawl.", + example: "High rise: Not part of a group/cluster", + items: [ + 'Small fairly regular plot part of repetitive domestic streets', + 'Irregular shaped plots built along the edge of long established routes (e.g high streets)', + 'Large plot with internal access roads (e.g. infrastructure hubs/large institution such as hospitals/universities/airports)', + ] + }, + typology_dynamic_classification_source_type: { + category: Category.Typology, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + typology_dynamic_classification_source_links: { + category: Category.Typology, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, + typology_original_use: { + category: Category.Typology, + title: "Which land use best describes the purpose for which the building was built?", + tooltip: "Land use Groups as classified by [NLUD](https://www.gov.uk/government/statistics/national-land-use-database-land-use-and-land-cover-classification)", + example: ["", ""], + }, + typology_original_use_source_type: { + category: Category.Typology, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + typology_original_use_source_links: { + category: Category.Typology, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, }; export const allFieldsConfig = { ...dataFields, ...buildingUserFields }; \ No newline at end of file diff --git a/migrations/043.typology_updates.down.sql b/migrations/043.typology_updates.down.sql new file mode 100644 index 00000000..bc3f3b84 --- /dev/null +++ b/migrations/043.typology_updates.down.sql @@ -0,0 +1,18 @@ +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_classification; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_classification_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_classification_source_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_style_period; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_style_period_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_style_period_source_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_dynamic_classification; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_dynamic_classification_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_dynamic_classification_source_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_original_use; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_original_use_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS typology_original_use_source_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS building_attachment_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS building_attachment_source_links; diff --git a/migrations/043.typology_updates_up.sql b/migrations/043.typology_updates_up.sql new file mode 100644 index 00000000..af0f4a72 --- /dev/null +++ b/migrations/043.typology_updates_up.sql @@ -0,0 +1,18 @@ +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_classification text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_classification_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_classification_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_style_period text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_style_period_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_style_period_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_dynamic_classification text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_dynamic_classification_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_dynamic_classification_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_original_use text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_original_use_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS typology_original_use_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS building_attachment_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS building_attachment_source_links text[]; \ No newline at end of file From a970fe3d1eac21630057fab30614d15f54ac7407 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 06:36:12 +0000 Subject: [PATCH 38/81] Bump word-wrap from 1.2.3 to 1.2.4 in /app Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- app/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/package-lock.json b/app/package-lock.json index 0f667430..dc47f5e2 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -20145,9 +20145,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -35833,9 +35833,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "worker-rpc": { From 79adb2d49d59fe8081382cf58142fa06349cdb50 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 25 Jul 2023 17:05:20 +0100 Subject: [PATCH 39/81] New Keys for Typology category - Keys for all subcategories (except original building use) - Buttons to change key/visible layer Re: Issue #1212 --- app/map_styles/polygon.xml | 151 ++++++++++++++++++ .../building/data-containers/typology.tsx | 56 +++++++ .../frontend/config/category-maps-config.ts | 76 +++++++-- app/src/frontend/config/data-fields-config.ts | 2 +- app/src/frontend/config/tileserver-config.ts | 5 +- app/src/tiles/dataDefinition.ts | 21 +++ 6 files changed, 298 insertions(+), 13 deletions(-) diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index 652f698d..d90205d5 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -973,4 +973,155 @@ + + + diff --git a/app/src/frontend/building/data-containers/typology.tsx b/app/src/frontend/building/data-containers/typology.tsx index 3a8e33e0..430943db 100644 --- a/app/src/frontend/building/data-containers/typology.tsx +++ b/app/src/frontend/building/data-containers/typology.tsx @@ -11,6 +11,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 { useDisplayPreferences } from '../../displayPreferences-context'; const AttachmentFormOptions = [ "Detached", @@ -23,9 +24,37 @@ const AttachmentFormOptions = [ * Type view/edit section */ const TypeView: React.FunctionComponent = (props) => { + const { darkLightTheme } = useDisplayPreferences(); + + const switchToClassificationMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_classification') + } + const switchToStylePeriodMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_style_period') + } + const switchToDynamicClassificationMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_dynamic_classification') + } + const switchToAttachmentMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('building_attachment_form') + } + return ( + {(props.mapColourScale == "typology_classification") ? + + : + + } = (props) => { } + {(props.mapColourScale == "typology_style_period") ? + + : + + } = (props) => { } + {(props.mapColourScale == "typology_dynamic_classification") ? + + : + + } = (props) => { } + {(props.mapColourScale == "building_attachment_form") ? + + : + + } 0 OR dynamics_has_demolished_buildings = FALSE`, + typology_classification: ` + SELECT + geometry_id, + typology_classification + FROM + buildings + WHERE typology_classification IS NOT NULL`, + typology_style_period: ` + SELECT + geometry_id, + typology_style_period + FROM + buildings + WHERE typology_style_period IS NOT NULL`, + typology_dynamic_classification: ` + SELECT + geometry_id, + typology_dynamic_classification + FROM + buildings + WHERE typology_dynamic_classification IS NOT NULL`, }; const GEOMETRY_FIELD = 'geometry_geom'; From b9e9db4bc2de30fb43cb6f1ba50c6e179e72d715 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Tue, 25 Jul 2023 17:06:38 +0100 Subject: [PATCH 40/81] Tweak key text size #1212 --- app/src/frontend/map/legend.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/map/legend.css b/app/src/frontend/map/legend.css index 2b95cfbe..e412cace 100644 --- a/app/src/frontend/map/legend.css +++ b/app/src/frontend/map/legend.css @@ -57,7 +57,7 @@ padding: 0.5rem 0.25rem; margin: 0.25rem 0.5rem; width: auto; - font-size: 18px; + font-size: 17px; border: 1px solid; border-radius: 4px; } From 5e1db5a5890e7988c531cc1ee0d4582beb675b0c Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 26 Jul 2023 13:34:32 +0100 Subject: [PATCH 41/81] Changes to Architectural Styles as requested in #1212 --- app/map_styles/polygon.xml | 24 ++++--------------- .../frontend/config/category-maps-config.ts | 12 ++++------ app/src/frontend/config/data-fields-config.ts | 12 ++++------ 3 files changed, 12 insertions(+), 36 deletions(-) diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index d90205d5..20bb9c0c 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -1028,13 +1028,9 @@ - [typology_style_period] = "Early Medieval (410-1066)" + [typology_style_period] = "Medieval (410-1485)" - - [typology_style_period] = "Mid-Late Medieval (1066-1485)" - - [typology_style_period] = "Tudor (1485-1603)" @@ -1044,7 +1040,7 @@ - [typology_style_period] = "Georgian/William IV (1714-1837)" + [typology_style_period] = "Georgian (1714-1837)" @@ -1056,17 +1052,9 @@ - [typology_style_period] = "World War I (1914-18)" + [typology_style_period] = "WWI - WWII (1914-45)" - - [typology_style_period] = "Interwar (1918-39)" - - - - [typology_style_period] = "World War II (1939-45)" - - [typology_style_period] = "Post war (1945-1975)" @@ -1080,13 +1068,9 @@ - [typology_style_period] = "2000s/2010s" + [typology_style_period] = "2000s" - - [typology_style_period] = "2020s" - - 17061 diff --git a/app/src/frontend/config/category-maps-config.ts b/app/src/frontend/config/category-maps-config.ts index d9d575dd..19815c58 100644 --- a/app/src/frontend/config/category-maps-config.ts +++ b/app/src/frontend/config/category-maps-config.ts @@ -323,21 +323,17 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} = title: 'Architectural style', elements: [ { color: '#00B2CB', text: 'Roman (43AD-410)' }, - { color: '#00A9C6', text: 'Early Medieval (410-1066)' }, - { color: '#00A0C1', text: 'Mid-Late Medieval (1066-1485)' }, + { color: '#00A9C6', text: 'Medieval (410-1485)' }, { color: '#0097BC', text: 'Tudor (1485-1603)' }, { color: '#008EB7', text: 'Stuart (1603 -1714)' }, - { color: '#0085B2', text: 'Georgian/William IV (1714-1837)' }, + { color: '#0085B2', text: 'Georgian (1714-1837)' }, { color: '#007CAD', text: 'Victorian (1837-1901)' }, { color: '#0073A8', text: 'Edwardian (1901-1914)' }, - { color: '#006AA3', text: 'World War I (1914-18)' }, - { color: '#00619E', text: 'Interwar (1918-39)' }, - { color: '#005899', text: 'World War II (1939-45)' }, + { color: '#006AA3', text: 'WWI - WWII (1914-45)' }, { color: '#004F94', text: 'Post war (1945-1975)' }, { color: '#00468F', text: 'Postmodern (1975-1990)' }, { color: '#003D8A', text: '1990s' }, - { color: '#003485', text: '2000s/2010s' }, - { color: '#002C7C', text: '2020s' }, + { color: '#003485', text: '2000s' }, ] } }, diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index d90e16ce..91ddb459 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -1501,21 +1501,17 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "High rise: Not part of a group/cluster", items: [ 'Roman (43AD-410)', - 'Early Medieval (410-1066)', - 'Mid-Late Medieval (1066-1485)', + 'Medieval (410-1485)', 'Tudor (1485-1603)', 'Stuart (1603 -1714)', - 'Georgian/William IV (1714-1837)', + 'Georgian (1714-1837)', 'Victorian (1837-1901)', 'Edwardian (1901-1914)', - 'World War I (1914-18)', - 'Interwar (1918-39)', - 'World War II (1939-45)', + 'WWI - WWII (1914-45)',, 'Post war (1945-1975)', 'Postmodern (1975-1990)', '1990s', - '2000s/2010s', - '2020s', + '2000s', ] }, typology_style_period_source_type: { From b55617aaae118cbd97d9addcafcdc83851522e7f Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 26 Jul 2023 13:46:31 +0100 Subject: [PATCH 42/81] Add label pointing to Age data #1212 --- app/src/frontend/building/data-containers/typology.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/frontend/building/data-containers/typology.tsx b/app/src/frontend/building/data-containers/typology.tsx index 430943db..4180df45 100644 --- a/app/src/frontend/building/data-containers/typology.tsx +++ b/app/src/frontend/building/data-containers/typology.tsx @@ -131,6 +131,9 @@ const TypeView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.typology_style_period} verified_count={props.building.verified.typology_style_period} /> +
+ For building age by year see Age & History. +
Date: Wed, 26 Jul 2023 13:54:57 +0100 Subject: [PATCH 43/81] Changes to Dynamic classification subcategory --- app/map_styles/polygon.xml | 6 +++--- app/src/frontend/building/data-containers/typology.tsx | 2 +- app/src/frontend/config/category-maps-config.ts | 6 +++--- app/src/frontend/config/data-fields-config.ts | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index 20bb9c0c..b472d134 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -1085,15 +1085,15 @@ +