crowdsourced finalizing initial interface

This commit is contained in:
Mateusz Konieczny 2022-11-29 11:31:43 +01:00
parent 69f753c0a4
commit d56a81bff6
6 changed files with 106 additions and 12 deletions

View File

@ -173,11 +173,15 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true,
},
work_on_site_is_completed_on_year: {
planning_crowdsourced_site_completion_status: {
edit: true,
verify: true,
},
planning_planning_application_id_crowdsourced: {
planning_crowdsourced_site_completion_year: {
edit: true,
verify: true,
},
planning_crowdsourced_planning_id: {
edit: true,
verify: true,
},

View File

@ -59,16 +59,54 @@ const PlanningView: React.FunctionComponent<CategoryViewProps> = (props) => {
</DataEntryGroup>
<DataEntryGroup name="Other active application info (crowdsourced data)" collapsed={true} >
<NumericDataEntry
title={"Year of completion"}
slug="date_year"
value={2019}
title={dataFields.planning_crowdsourced_site_completion_year.title}
slug="planning_crowdsourced_site_completion_year"
value={props.building.planning_crowdsourced_site_completion_year}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
min={1}
max={currentYear}
// "type": "year_estimator"
disabled={true}
/>
<Verification
slug="planning_crowdsourced_site_completion_year"
allow_verify={false}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("planning_crowdsourced_site_completion_year")}
user_verified_as={props.user_verified.planning_crowdsourced_site_completion_year}
verified_count={props.building.verified.planning_crowdsourced_site_completion_year}
/>
{/*disabled={true}*/}
<DataEntry
title={dataFields.planning_crowdsourced_planning_id.title}
slug="planning_crowdsourced_planning_id"
value={props.building.planning_crowdsourced_planning_id}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
<Verification
slug="planning_crowdsourced_planning_id"
allow_verify={props.user !== undefined && props.building.planning_crowdsourced_planning_id !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("planning_crowdsourced_planning_id")}
user_verified_as={props.user_verified.planning_crowdsourced_planning_id}
verified_count={props.building.verified.planning_crowdsourced_planning_id}
/>
<UserOpinionEntry
slug='community_expected_planning_application'
title={"If any of the active planning applications are not mapped onto the correct site, please tick here ☑"}
userValue={props.building.community_expected_planning_application}
onChange={props.onSaveChange}
mode={props.mode}
copy={props.copy}
/>
{ /* TODO: have just checkbox, without "Yes" */ }
{/*disabled={true}*/}
</DataEntryGroup>
<DataEntryGroup name="Past applications (official data)" collapsed={true} >
<InfoBox type='warning'>
@ -80,6 +118,23 @@ const PlanningView: React.FunctionComponent<CategoryViewProps> = (props) => {
/>
</DataEntryGroup>
<DataEntryGroup name="Possible future applications (crowdsourced data)" collapsed={true} >
<form className={`flood-switcher-inline`}>
<button className="btn btn-outline btn-outline-dark"
type="submit">
Click to see the data mapped
</button>
</form>
<UserOpinionEntry
slug='community_expected_planning_application'
title={buildingUserFields.community_expected_planning_application.title}
userValue={props.building.community_expected_planning_application}
onChange={props.onSaveChange}
mode={props.mode}
copy={props.copy}
/>
<InfoBox>To also add your opinion on how well this building works for the community, visit <Link to={communityLinkUrl}>Community</Link> section.</InfoBox>
</DataEntryGroup>
</DataEntryGroup>
<DataEntryGroup name="Planning contraints and building protection" collapsed={true} >

View File

@ -452,6 +452,14 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
//tooltip: ,
},
edit_history: {
category: Category.Planning,
title: "PLANNING DATA",
tooltip: "PLANNING DATA",
example: [{}],
},
planning_portal_link: {
category: Category.Planning,
title: "Local authority planning application link",
@ -464,6 +472,24 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
example: "",
//tooltip: ,
},
planning_crowdsourced_site_completion_status: {
category: Category.Planning,
title: "Has the work on this site been completed?",
example: true,
//tooltip: ,
},
planning_crowdsourced_site_completion_year: {
category: Category.Planning,
title: "Year of completion if known",
example: 2022,
//tooltip: ,
},
planning_crowdsourced_planning_id: {
category: Category.Planning,
title: "Are you aware of a planning application that has been recently submitted for this site and is not listed in the green box above, please enter planning application ID below:",
example: "1112/QWERTY",
//tooltip: ,
},
planning_in_conservation_area_id: {
category: Category.Planning,
title: "Conservation Area identifier",

View File

@ -70,6 +70,9 @@ This is the main table, containing almost all data collected by Colouring London
- `sust_dec`: DEC rating
- `sust_retrofit_date`: year of last significant retrofit
- `planning_portal_link`: link to an entry on https://www.planningportal.co.uk/
- `planning_crowdsourced_site_completion_status`: status of completion of costruction at given location
- `planning_crowdsourced_site_completion_year`: year of completion of costruction at given location
- `planning_crowdsourced_planning_id`: id of planning application for a given location
- `planning_list_id`: National Heritage List for England ID
- `planning_in_conservation_area_id`: conservation area ID
- `planning_in_conservation_area_url`: conservation area appraisal link

View File

@ -0,0 +1,3 @@
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completion_status;
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_site_completion_year;
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_crowdsourced_planning_id;

View File

@ -0,0 +1,3 @@
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_site_completion_status boolean;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_site_completion_year smallint;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_crowdsourced_planning_id VARCHAR DEFAULT '';