From 9b73dd5e622dfec1d0c598b91eb5884861b038c3 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Thu, 29 Jun 2023 16:54:17 +0100 Subject: [PATCH] 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) => {