diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index e77c8358..624ed479 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -134,6 +134,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + date_source_type: { + edit: true, + verify: true, + }, + date_source_links: { + edit: true, + verify: true, + }, facade_year: { edit: true, verify: true, @@ -285,10 +293,22 @@ 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, }, + planning_in_conservation_area: { + edit: true, + verify: true, + }, planning_in_conservation_area_id: { edit: true, verify: true, @@ -309,6 +329,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + planning_world_heritage_site: { + edit: true, + verify: true, + }, planning_world_list_id: { edit: true, verify: true, @@ -317,14 +341,26 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + planning_in_apa: { + edit: true, + verify: true, + }, planning_in_apa_url: { edit: true, verify: true, }, + planning_local_list: { + edit: true, + verify: true, + }, planning_local_list_url: { edit: true, verify: true, }, + planning_historic_area_assessment: { + edit: true, + verify: true, + }, planning_historic_area_assessment_url: { edit: true, verify: true, @@ -333,6 +369,30 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + planning_missing_data: { + edit: true, + verify: true, + }, + planning_missing_data_links: { + edit: true, + verify: true, + }, + planning_heritage_at_risk: { + edit: true, + verify: true, + }, + planning_scientific_interest: { + edit: true, + verify: true, + }, + planning_scientific_interest_source_type: { + edit: true, + verify: true, + }, + planning_scientific_interest_source_links: { + edit: true, + verify: true, + }, sust_breeam_rating: { edit: true, verify: true, diff --git a/app/src/cc-config.json b/app/src/cc-config.json index dd1361ae..087f5561 100644 --- a/app/src/cc-config.json +++ b/app/src/cc-config.json @@ -1,7 +1,9 @@ { "cityName": "Cities", "projectBlurb": "Colouring {City Name} is part Colouring Cities.", + "githubURL": "https://github.com/colouring-cities/colouring-core", + "manualURL": "https://github.com/colouring-cities/manual/wiki/M3.-COLOURING-BRITAIN", "privacyStatement": "{Privacy statement goes here}", "initialMapPosition": [ 51.5245255, -0.1338422 ], diff --git a/app/src/cc-config.ts b/app/src/cc-config.ts index 54390139..df5d7a85 100644 --- a/app/src/cc-config.ts +++ b/app/src/cc-config.ts @@ -1,8 +1,12 @@ +import { StringNullableChain } from "lodash"; + export interface CCConfig { cityName: string; // City name (i.e. "Colouring {City Name}") projectBlurb: string; // Description used on homepage + githubURL: string; // URL of the project's GitHub repository + manualURL: string; // Link to the project's page in the Open Manual (i.e. https://github.com/colouring-cities/manual/wiki/M3.-COLOURING-BRITAIN) privacyStatement: string; // Privacy statement, including where data is stored initialMapPosition: [number, number]; // Initial location of the map [latitude, longitude] diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index 3d0c4cb7..47d2459e 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -103,6 +103,7 @@ const AgeView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.facade_year} verified_count={props.building.verified.facade_year} /> +
= (props) => { /> } - + + {(props.building.date_source_type == dataFields.date_source_type.items[0] || + props.building.date_source_type == dataFields.date_source_type.items[1] || + props.building.date_source_type == null) ? <> : + <> + + + } + {/* + />*/} = (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 09cf2357..c2f24093 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -16,6 +16,7 @@ export const commonSourceTypes = [ "Other independently managed public database", "Commercial database", "Inferred computationally using existing open attribute data", + "Synthetic data" ]; /** @@ -361,7 +362,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, date_source: { category: Category.Age, - title: "Source type", + title: "Historical source type", tooltip: "Source type for the building dates above", items: [ "Expert knowledge of building", @@ -388,6 +389,19 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "", }, date_link: { + category: Category.Age, + title: "Historical source link(s)", + tooltip: "URL for age and date reference", + example: ["", "", ""], + }, + date_source_type: { + category: Category.Age, + title: "Source type", + tooltip: "Source type for the building dates above", + items: commonSourceTypes, + example: "", + }, + date_source_links: { category: Category.Age, title: "Source link(s)", tooltip: "URL for age and date reference", @@ -695,13 +709,26 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ category: Category.Planning, title: "Has the work on this site been completed?", example: true, - //tooltip: , + tooltip: "Has the work on this site been completed?", }, planning_crowdsourced_site_completion_year: { category: Category.Planning, - title: "Year of completion if known", + title: "Year of completion (best estimate)", example: 2022, - //tooltip: , + tooltip: "Year of completion, if known", + }, + planning_crowdsourced_site_completion_source_type: { + category: Category.Team, + title: "Source type", + tooltip: "Source type for work complete data", + example: "", + items: commonSourceTypes + }, + planning_crowdsourced_site_completion_source_links: { + category: Category.Team, + title: "Source links", + tooltip: "URL(s) for work complete data", + example: ["", "", ""], }, planning_crowdsourced_planning_id: { category: Category.Planning, @@ -709,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", @@ -739,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: , }, @@ -751,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?", @@ -775,6 +832,45 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: true, //tooltip: , }, + planning_missing_data: { + category: Category.Planning, + title: "Is information on a planning application relating to this building missing?", + tooltip: "Is information on a planning application relating to this building missing?", + example: true, + }, + planning_missing_data_links: { + category: Category.Team, + title: "Source links", + 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: { category: Category.Team, title: "Is the building a home/residential building?", diff --git a/app/src/frontend/header.tsx b/app/src/frontend/header.tsx index 04979244..7f11e5c3 100644 --- a/app/src/frontend/header.tsx +++ b/app/src/frontend/header.tsx @@ -78,6 +78,11 @@ function getCurrentMenuLinks(username: string): MenuLink[][] { text: "About the Colouring Cities Research Programme", external: true }, + { + to: config.manualURL, + text: "About the Colouring " + config.cityName + " Project", + external: true + }, { to: "https://github.com/colouring-cities/manual/wiki/A2.-How-to%3F-Guides", text: "How to Use", diff --git a/migrations/041.ui_revamp_tweaks.down.sql b/migrations/041.ui_revamp_tweaks.down.sql index 49a30198..6a6482d5 100644 --- a/migrations/041.ui_revamp_tweaks.down.sql +++ b/migrations/041.ui_revamp_tweaks.down.sql @@ -12,4 +12,23 @@ 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 +ALTER TABLE buildings DROP COLUMN IF EXISTS energy_green_roof_source_links; + +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completion_source_type; +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 d35143f9..04b06baf 100644 --- a/migrations/041.ui_revamp_tweaks.up.sql +++ b/migrations/041.ui_revamp_tweaks.up.sql @@ -12,4 +12,23 @@ 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 +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS energy_green_roof_source_links text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_site_completion_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_site_completion_source_links text[]; +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[]; + +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[]; diff --git a/migrations/042.ui_revamp_tweaks.refactor.sql b/migrations/042.ui_revamp_tweaks.refactor.sql index 1fb5caed..660efc3b 100644 --- a/migrations/042.ui_revamp_tweaks.refactor.sql +++ b/migrations/042.ui_revamp_tweaks.refactor.sql @@ -4,4 +4,11 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS context_flats_garden; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_front_garden boolean; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_back_garden boolean; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_flats_garden boolean; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_flats_garden boolean; + + +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completion_status; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_site_completion_status boolean; + +ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completion_year; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_site_completion_year smallint;