From 00f3c40ded910c48ef32bbe7b4375447c52c495b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 13 May 2022 15:24:13 +0100 Subject: [PATCH 01/60] add verification date_source --- .../frontend/building/data-containers/age.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 15ff3c70..d1916323 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -68,6 +68,14 @@ const AgeView: React.FunctionComponent = (props) => { placeholder={dataFields.date_source.example} options={dataFields.date_source.items} /> + ); }; @@ -119,6 +127,14 @@ const AgeView: React.FunctionComponent = (props) => { options={dataFields.date_source.items} placeholder={dataFields.date_source.example} /> + Date: Thu, 19 May 2022 09:55:58 +0100 Subject: [PATCH 02/60] verify date source --- app/src/api/config/dataFields.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index daee34da..61a099f1 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -93,6 +93,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, date_source: { edit: true, + verify: true, }, date_source_detail: { edit: true, From fec9134d1d0dd93f845a36ca47016bf2300f3a31 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 10:20:18 +0100 Subject: [PATCH 03/60] add verification date_year --- .../frontend/building/data-containers/age.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index d1916323..7daeb194 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -30,6 +30,14 @@ const AgeView: React.FunctionComponent = (props) => { copy={props.copy} onChange={props.onChange} + allow_verify={props.user !== undefined && props.building.date_year !== null && !props.edited} + onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_year")} + user_verified_as={props.user_verified.date_year} + verified_count={props.building.verified.date_year} + /> + = (props) => { copy={props.copy} onChange={props.onChange} + allow_verify={props.user !== undefined && props.building.date_year !== null && !props.edited} + onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_year")} + user_verified_as={props.user_verified.date_year} + verified_count={props.building.verified.date_year} + /> + Date: Thu, 19 May 2022 10:28:51 +0100 Subject: [PATCH 04/60] verfication for each year box --- .../frontend/building/data-containers/age.tsx | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 7daeb194..dd2d4cd4 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -35,15 +35,27 @@ const AgeView: React.FunctionComponent = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} + + allow_verify={props.user !== undefined && props.building.date_upper !== null && !props.edited} + // onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as={props.user_verified.date_upper} + verified_count={props.building.verified.date_upper} + + allow_verify={props.user !== undefined && props.building.date_lower !== null && !props.edited} + // onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as={props.user_verified.date_lower} + verified_count={props.building.verified.date_lower} /> - + // = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} + + allow_verify={props.user !== undefined && props.building.date_upper !== null && !props.edited} + // onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as={props.user_verified.date_upper} + verified_count={props.building.verified.date_upper} + + allow_verify={props.user !== undefined && props.building.date_lower !== null && !props.edited} + // onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as={props.user_verified.date_lower} + verified_count={props.building.verified.date_lower} /> - + // Date: Thu, 19 May 2022 10:31:48 +0100 Subject: [PATCH 05/60] remove commented --- .../frontend/building/data-containers/age.tsx | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index dd2d4cd4..e41e4942 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -37,25 +37,15 @@ const AgeView: React.FunctionComponent = (props) => { verified_count={props.building.verified.date_year} allow_verify={props.user !== undefined && props.building.date_upper !== null && !props.edited} - // onVerify={props.onVerify} user_verified={props.user_verified.hasOwnProperty("date_upper")} user_verified_as={props.user_verified.date_upper} verified_count={props.building.verified.date_upper} allow_verify={props.user !== undefined && props.building.date_lower !== null && !props.edited} - // onVerify={props.onVerify} user_verified={props.user_verified.hasOwnProperty("date_lower")} user_verified_as={props.user_verified.date_lower} verified_count={props.building.verified.date_lower} /> - // = (props) => { verified_count={props.building.verified.date_year} allow_verify={props.user !== undefined && props.building.date_upper !== null && !props.edited} - // onVerify={props.onVerify} user_verified={props.user_verified.hasOwnProperty("date_upper")} user_verified_as={props.user_verified.date_upper} verified_count={props.building.verified.date_upper} allow_verify={props.user !== undefined && props.building.date_lower !== null && !props.edited} - // onVerify={props.onVerify} user_verified={props.user_verified.hasOwnProperty("date_lower")} user_verified_as={props.user_verified.date_lower} verified_count={props.building.verified.date_lower} /> - // Date: Thu, 19 May 2022 10:35:13 +0100 Subject: [PATCH 06/60] refactor dates verification --- .../frontend/building/data-containers/age.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index e41e4942..ce6ff6bd 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -35,13 +35,19 @@ const AgeView: React.FunctionComponent = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} - + /> + + = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} - + /> + + Date: Thu, 19 May 2022 10:39:11 +0100 Subject: [PATCH 07/60] fix --- app/src/frontend/building/data-containers/age.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index ce6ff6bd..29a58aeb 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -29,7 +29,9 @@ const AgeView: React.FunctionComponent = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} - + /> + = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} - + /> + Date: Thu, 19 May 2022 10:40:12 +0100 Subject: [PATCH 08/60] Revert "fix" This reverts commit 66ecd2b6196ee5cf7cc1a3e61872e0c23f3161c9. --- app/src/frontend/building/data-containers/age.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 29a58aeb..ce6ff6bd 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -29,9 +29,7 @@ const AgeView: React.FunctionComponent = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} - /> - = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} - /> - Date: Thu, 19 May 2022 10:44:48 +0100 Subject: [PATCH 09/60] allow verify dates --- app/src/api/config/dataFields.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 61a099f1..073d0d6a 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -87,9 +87,11 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, date_lower: { edit: true, + verify: true, }, date_upper: { edit: true, + verify: true, }, date_source: { edit: true, From 3b5ca75eefe8175baf10e048b679f3565aeeb43b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 10:48:53 +0100 Subject: [PATCH 10/60] refactor date verification buttons --- .../data-components/year-data-entry.tsx | 16 ++++++++++ .../frontend/building/data-containers/age.tsx | 32 ------------------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index 472a72d8..d3b7ac18 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -73,6 +73,14 @@ class YearDataEntry extends Component { max={currentYear} tooltip={dataFields.date_lower.tooltip} /> + { min={1} max={currentYear} tooltip={dataFields.date_upper.tooltip} + /> + ); diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index ce6ff6bd..d1916323 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -36,22 +36,6 @@ const AgeView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} /> - - = (props) => { user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} /> - - Date: Thu, 19 May 2022 10:51:20 +0100 Subject: [PATCH 11/60] use props.allow_verify --- app/src/frontend/building/data-components/year-data-entry.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index d3b7ac18..6aeae20e 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -75,7 +75,7 @@ class YearDataEntry extends Component { /> { /> Date: Thu, 19 May 2022 10:53:57 +0100 Subject: [PATCH 12/60] fix veriification buttons --- .../building/data-components/year-data-entry.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index 6aeae20e..50c07ae5 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -77,9 +77,9 @@ class YearDataEntry extends Component { slug="date_lower" allow_verify={props.allow_verify} onVerify={props.onVerify} - user_verified={props.user_verified.hasOwnProperty("date_lower")} - user_verified_as={props.user_verified.date_lower} - verified_count={props.building.verified.date_lower} + user_verified={props.user_verified} + user_verified_as={props.user_verified_as} + verified_count={props.verified_count} /> { slug="date_upper" allow_verify={props.allow_verify} onVerify={props.onVerify} - user_verified={props.user_verified.hasOwnProperty("date_upper")} - user_verified_as={props.user_verified.date_upper} - verified_count={props.building.verified.date_upper} + user_verified={props.user_verified} + user_verified_as={props.user_verified_as} + verified_count={props.verified_count} /> ); From 2b7fd00d6420388aac18754fc015bd331a767da3 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 10:58:09 +0100 Subject: [PATCH 13/60] fix v buttons again - separate them --- .../data-components/year-data-entry.tsx | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index 50c07ae5..aea54267 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -19,6 +19,19 @@ interface YearDataEntryProps { user_verified_as: string; verified_count: number; allow_verify: boolean; + + onVerify_upper: (slug: string, verify: boolean, x: number, y: number) => void; + user_verified_upper: boolean; + user_verified_as_upper: string; + verified_count_upper: number; + allow_verify_upper: boolean; + + onVerify_lower: (slug: string, verify: boolean, x: number, y: number) => void; + user_verified_lower: boolean; + user_verified_as_lower: string; + verified_count_lower: number; + allow_verify_lower: boolean; + } class YearDataEntry extends Component { @@ -75,11 +88,11 @@ class YearDataEntry extends Component { /> { /> ); From dafd6d0468211800064473cde1e46557000ac955 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 11:00:22 +0100 Subject: [PATCH 14/60] add separated buttons to Age --- app/src/frontend/building/data-containers/age.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index d1916323..70aaae83 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -94,6 +94,18 @@ const AgeView: React.FunctionComponent = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} + + allow_verify_upper={props.user !== undefined && props.building.date_upper !== null && !props.edited} + onVerify_upper={props.onVerify} + user_verified_upper={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as_upper={props.user_verified.date_upper} + verified_count_upper={props.building.verified.date_upper} + + allow_verify_lower={props.user !== undefined && props.building.date_lower !== null && !props.edited} + onVerify_lower={props.onVerify} + user_verified_lower={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as_lower={props.user_verified.date_lower} + verified_count_lower={props.building.verified.date_lower} /> Date: Thu, 19 May 2022 11:01:26 +0100 Subject: [PATCH 15/60] finish prev commit --- app/src/frontend/building/data-containers/age.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 70aaae83..2f9d08e2 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -35,6 +35,18 @@ const AgeView: React.FunctionComponent = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} + + allow_verify_upper={props.user !== undefined && props.building.date_upper !== null && !props.edited} + onVerify_upper={props.onVerify} + user_verified_upper={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as_upper={props.user_verified.date_upper} + verified_count_upper={props.building.verified.date_upper} + + allow_verify_lower={props.user !== undefined && props.building.date_lower !== null && !props.edited} + onVerify_lower={props.onVerify} + user_verified_lower={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as_lower={props.user_verified.date_lower} + verified_count_lower={props.building.verified.date_lower} /> Date: Thu, 19 May 2022 11:18:17 +0100 Subject: [PATCH 16/60] verify current_landuse_source --- app/src/api/config/dataFields.ts | 1 + app/src/frontend/building/data-containers/use.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 073d0d6a..f55a679f 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -262,6 +262,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, current_landuse_source: { edit: true, + verify: true, }, current_landuse_source_detail: { edit: true, diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 64ba958c..08403b4d 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -69,6 +69,14 @@ const UseView: React.FunctionComponent = (props) => { placeholder={dataFields.date_source.example} options={dataFields.current_landuse_source.items} /> + ); }; From fee86c1ee3a1b74aa2401d0db98388cd37fbccc8 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 11:32:31 +0100 Subject: [PATCH 17/60] fix verify button current_landuse_source --- app/src/frontend/building/data-containers/use.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 08403b4d..f120f8fa 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -74,7 +74,7 @@ const UseView: React.FunctionComponent = (props) => { allow_verify={props.user !== undefined && props.building.current_landuse_source !== null && !props.edited} onVerify={props.onVerify} user_verified={props.user_verified.hasOwnProperty("current_landuse_source")} - user_verified_as={props.user_verified.current_landuse_source && props.user_verified.current_landuse_source.join(", ")} + user_verified_as={props.user_verified.current_landuse_source} verified_count={props.building.verified.current_landuse_source} /> From 4c0a5d0475e0d0cb9c5b90f3fce052b417656376 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 11:34:56 +0100 Subject: [PATCH 18/60] add verification to other side of if statement --- app/src/frontend/building/data-containers/use.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index f120f8fa..8e507b31 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -130,6 +130,14 @@ const UseView: React.FunctionComponent = (props) => { placeholder={dataFields.date_source.example} options={dataFields.current_landuse_source.items} /> + Date: Thu, 19 May 2022 11:37:06 +0100 Subject: [PATCH 19/60] add veriification current_landuse_link --- app/src/api/config/dataFields.ts | 1 + app/src/frontend/building/data-containers/use.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index f55a679f..4e8f1c66 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -269,6 +269,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, current_landuse_link: { edit: true, + verify: true, }, dynamics_has_demolished_buildings: { edit: true, diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 8e507b31..d7588231 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -149,6 +149,14 @@ const UseView: React.FunctionComponent = (props) => { placeholder="https://..." editableEntries={true} /> + ); }; From c7ff672e3bc863b1ad14b7781e76933c767f1233 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 12:56:31 +0100 Subject: [PATCH 20/60] add verify button ref_osm_id --- app/src/api/config/dataFields.ts | 1 + app/src/frontend/building/data-containers/location.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 4e8f1c66..1f9d09d4 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -53,6 +53,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, ref_osm_id: { edit: true, + verify: true, }, location_name: { edit: false, diff --git a/app/src/frontend/building/data-containers/location.tsx b/app/src/frontend/building/data-containers/location.tsx index d631388e..c908fc4a 100644 --- a/app/src/frontend/building/data-containers/location.tsx +++ b/app/src/frontend/building/data-containers/location.tsx @@ -127,6 +127,14 @@ const LocationView: React.FunctionComponent = (props) => ( maxLength={20} onChange={props.onChange} /> + Date: Thu, 19 May 2022 12:58:54 +0100 Subject: [PATCH 21/60] add more verification buttons --- app/src/api/config/dataFields.ts | 2 ++ .../building/data-containers/location.tsx | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 1f9d09d4..6e442f39 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -78,9 +78,11 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, location_latitude: { edit: true, + verify: true, }, location_longitude: { edit: true, + verify: true, }, date_year: { edit: true, diff --git a/app/src/frontend/building/data-containers/location.tsx b/app/src/frontend/building/data-containers/location.tsx index c908fc4a..d94011f9 100644 --- a/app/src/frontend/building/data-containers/location.tsx +++ b/app/src/frontend/building/data-containers/location.tsx @@ -147,6 +147,14 @@ const LocationView: React.FunctionComponent = (props) => ( placeholder="Latitude, e.g. 51.5467" onChange={props.onChange} /> + = (props) => ( placeholder="Longitude, e.g. -0.0586" onChange={props.onChange} /> + ); const LocationContainer = withCopyEdit(LocationView); From 3ba9d0b5efd563af676a6c5d18b8a14f7e7c3c23 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 13:04:53 +0100 Subject: [PATCH 22/60] add verification buttons construction --- app/src/api/config/dataFields.ts | 2 ++ .../building/data-containers/construction.tsx | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 6e442f39..ce17b80b 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -151,12 +151,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, construction_core_material: { edit: true, + verify: true, }, construction_secondary_materials: { edit: false, }, construction_roof_covering: { edit: true, + verify: true, }, planning_portal_link: { edit: true, diff --git a/app/src/frontend/building/data-containers/construction.tsx b/app/src/frontend/building/data-containers/construction.tsx index 0ece42f1..d399cc0d 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -45,6 +45,14 @@ const ConstructionView: React.FunctionComponent = (props) => copy={props.copy} onChange={props.onChange} /> + = (props) => copy={props.copy} onChange={props.onChange} /> + Date: Thu, 19 May 2022 13:06:15 +0100 Subject: [PATCH 23/60] import verification construction --- app/src/frontend/building/data-containers/construction.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/frontend/building/data-containers/construction.tsx b/app/src/frontend/building/data-containers/construction.tsx index d399cc0d..d105f1b1 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -4,6 +4,7 @@ import { dataFields } from '../../config/data-fields-config'; import DataEntry from '../data-components/data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; import withCopyEdit from '../data-container'; +import Verification from '../data-components/verification'; import { CategoryViewProps } from './category-view-props'; From df9766aebb3908c61829e6731ac311a8a4808d84 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 13:14:08 +0100 Subject: [PATCH 24/60] verify community_public_ownership_sources --- app/src/api/config/dataFields.ts | 2 +- app/src/frontend/building/data-containers/community.tsx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index ce17b80b..309db28f 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -316,7 +316,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, community_public_ownership_sources: { edit: true, - verify: false + verify: true } }); diff --git a/app/src/frontend/building/data-containers/community.tsx b/app/src/frontend/building/data-containers/community.tsx index 6669476c..d074da38 100644 --- a/app/src/frontend/building/data-containers/community.tsx +++ b/app/src/frontend/building/data-containers/community.tsx @@ -155,6 +155,14 @@ const CommunityView: React.FunctionComponent = (props) => { onChange={props.onChange} mode={props.mode} /> + }; const CommunityContainer = withCopyEdit(CommunityView); From f67c2b41499f82a5e2e9b1d787de2034ad647ba2 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 13:38:08 +0100 Subject: [PATCH 25/60] add console log --- app/src/frontend/building/data-container.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index cad60ff1..c537a0a7 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -246,6 +246,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } + console.log(slug + " verify button clicked") } render() { From d809f22573977d8f803ee6f6e16dd337bcddd6ac Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 14:13:12 +0100 Subject: [PATCH 26/60] doSubmit on handleVerify --- app/src/frontend/building/data-container.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index c537a0a7..58157711 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -246,6 +246,8 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } + const edits = {}; + this.doSubmit(edits); console.log(slug + " verify button clicked") } From b8d9c12a1be194fd6b864b32167ccdeecb297d9c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 15:38:32 +0100 Subject: [PATCH 27/60] handleVerify does same as handleSaveChange --- app/src/frontend/building/data-container.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 58157711..01cf8ef0 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -214,7 +214,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.doSubmit(edits); } - async handleVerify(slug: string, verify: boolean, x: number, y: number) { + async handleVerify(slug: string, verify: boolean, x: number, y: number, value: any) { const verifyPatch = {}; if (verify) { verifyPatch[slug] = this.props.building[slug]; @@ -246,7 +246,11 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } - const edits = {}; + + const edits = { + [slug]: value + }; + this.doSubmit(edits); console.log(slug + " verify button clicked") } From 62421d60d3fa37e937987a5bd526cde79d768b4e Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 15:43:45 +0100 Subject: [PATCH 28/60] update VerificationProps --- app/src/frontend/building/data-components/verification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-components/verification.tsx b/app/src/frontend/building/data-components/verification.tsx index 009a95f1..648b5bf5 100644 --- a/app/src/frontend/building/data-components/verification.tsx +++ b/app/src/frontend/building/data-components/verification.tsx @@ -5,7 +5,7 @@ import './verification.css'; interface VerificationProps { slug: string; - onVerify: (slug: string, verify: boolean, x: number, y: number) => void; + onVerify: (slug: string, verify: boolean, x: number, y: number, value: any) => void; user_verified: boolean; user_verified_as: string; verified_count: number; From 5c3d5a3741d2eb45ddf0e47454f658ae0c184acd Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 15:49:05 +0100 Subject: [PATCH 29/60] add null value as default to onVerify --- app/src/frontend/building/data-components/verification.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/frontend/building/data-components/verification.tsx b/app/src/frontend/building/data-components/verification.tsx index 648b5bf5..b367ebaa 100644 --- a/app/src/frontend/building/data-components/verification.tsx +++ b/app/src/frontend/building/data-components/verification.tsx @@ -24,6 +24,7 @@ class Verification extends Component { e.preventDefault(); const x = e.clientX / document.body.clientWidth; const y = e.clientY / document.body.clientHeight; + const value = null; this.props.onVerify(this.props.slug, verify, x, y); } } From ccc8bae992b2b3f7ebd817df8f8039738c87c705 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 15:52:46 +0100 Subject: [PATCH 30/60] finish prev commit --- app/src/frontend/building/data-components/verification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-components/verification.tsx b/app/src/frontend/building/data-components/verification.tsx index b367ebaa..f0591cce 100644 --- a/app/src/frontend/building/data-components/verification.tsx +++ b/app/src/frontend/building/data-components/verification.tsx @@ -25,7 +25,7 @@ class Verification extends Component { const x = e.clientX / document.body.clientWidth; const y = e.clientY / document.body.clientHeight; const value = null; - this.props.onVerify(this.props.slug, verify, x, y); + this.props.onVerify(this.props.slug, verify, x, y, value); } } From 3b3fc12e93c8c9e97c35094d1f0df6643c81244b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:05:55 +0100 Subject: [PATCH 31/60] update all calls to onVerify --- .../frontend/building/data-components/year-data-entry.tsx | 6 +++--- .../building/data-containers/category-view-props.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index aea54267..dfc93cb3 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -14,19 +14,19 @@ interface YearDataEntryProps { mode?: 'view' | 'edit' | 'multi-edit'; onChange?: (key: string, value: any) => void; - onVerify: (slug: string, verify: boolean, x: number, y: number) => void; + onVerify: (slug: string, verify: boolean, x: number, y: number, value: any) => void; user_verified: boolean; user_verified_as: string; verified_count: number; allow_verify: boolean; - onVerify_upper: (slug: string, verify: boolean, x: number, y: number) => void; + onVerify_upper: (slug: string, verify: boolean, x: number, y: number, value: any) => void; user_verified_upper: boolean; user_verified_as_upper: string; verified_count_upper: number; allow_verify_upper: boolean; - onVerify_lower: (slug: string, verify: boolean, x: number, y: number) => void; + onVerify_lower: (slug: string, verify: boolean, x: number, y: number, value: any) => void; user_verified_lower: boolean; user_verified_as_lower: string; verified_count_lower: number; diff --git a/app/src/frontend/building/data-containers/category-view-props.ts b/app/src/frontend/building/data-containers/category-view-props.ts index 27d510f6..d6188864 100644 --- a/app/src/frontend/building/data-containers/category-view-props.ts +++ b/app/src/frontend/building/data-containers/category-view-props.ts @@ -14,7 +14,7 @@ interface CategoryViewProps { edited: boolean; copy: CopyProps; onChange: (key: string, value: any) => void; - onVerify: (slug: string, verify: boolean, x: number, y: number) => void; + onVerify: (slug: string, verify: boolean, x: number, y: number, value: any) => void; /* Special handler for adding and immediately saving a new item of an array-like attribute */ onSaveAdd: (slug: string, newItem: any) => void; From 999c42dcd3e310ecf37f9c69301dcc5f832f502e Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:24:39 +0100 Subject: [PATCH 32/60] change slug value to null --- app/src/frontend/building/data-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 01cf8ef0..9479e15a 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -248,7 +248,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } const edits = { - [slug]: value + [slug]: null }; this.doSubmit(edits); From 39e7ac8b39b038bfa9009f05a48a19bc793781b1 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:26:06 +0100 Subject: [PATCH 33/60] Revert "change slug value to null" This reverts commit 999c42dcd3e310ecf37f9c69301dcc5f832f502e. --- app/src/frontend/building/data-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 9479e15a..01cf8ef0 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -248,7 +248,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } const edits = { - [slug]: null + [slug]: value }; this.doSubmit(edits); From 48673e3dbdcb658b6c10df5dc5233456ec04f281 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:33:50 +0100 Subject: [PATCH 34/60] special handleVerify for current_landuse_group verification --- app/src/frontend/building/data-container.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 01cf8ef0..d564beb9 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,9 +247,15 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - const edits = { - [slug]: value - }; + if (slug == 'current_landuse_group'){ + const edits = { + ['current_landuse_verified']: TRUE + }; + } else { + const edits = { + [slug]: value + }; + } this.doSubmit(edits); console.log(slug + " verify button clicked") From b512c58f90d0eabf9ed15f5cdae44e468884e713 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:35:52 +0100 Subject: [PATCH 35/60] fix bool --- app/src/frontend/building/data-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index d564beb9..b3726806 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -249,7 +249,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine if (slug == 'current_landuse_group'){ const edits = { - ['current_landuse_verified']: TRUE + ['current_landuse_verified']: true }; } else { const edits = { From bb9d1468cc8f7bdf80f17fc2ed54ada9c085b718 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 19 May 2022 16:54:24 +0100 Subject: [PATCH 36/60] refactor const edits --- app/src/frontend/building/data-container.tsx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index b3726806..6315cb91 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -246,16 +246,10 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } - - if (slug == 'current_landuse_group'){ - const edits = { - ['current_landuse_verified']: true - }; - } else { - const edits = { - [slug]: value - }; - } + + const edits = (slug == 'current_landuse_group') ? + {['current_landuse_verified']: true} : + {[slug]: value} this.doSubmit(edits); console.log(slug + " verify button clicked") From 28017821512f9deb3a809a2c18de436dd9960bd6 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 20 May 2022 11:42:14 +0100 Subject: [PATCH 37/60] restore original "edits" dict --- app/src/frontend/building/data-container.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 6315cb91..3e5b45f8 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,9 +247,9 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - const edits = (slug == 'current_landuse_group') ? - {['current_landuse_verified']: true} : - {[slug]: value} + const edits = { + [slug]: value + }; this.doSubmit(edits); console.log(slug + " verify button clicked") From 97219998b9ec9776d84d958874bdfdeeefa3402b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 09:43:25 +0100 Subject: [PATCH 38/60] try setting state to reload --- app/src/frontend/building/data-container.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 3e5b45f8..e935f00a 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,11 +247,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - const edits = { - [slug]: value - }; - - this.doSubmit(edits); + this.setState({reload: true}) console.log(slug + " verify button clicked") } From 6d38ce7d3fc790a8137a1b56fbe7638e924ac5c4 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 09:59:15 +0100 Subject: [PATCH 39/60] try setting state to buildingEdits: {} --- app/src/frontend/building/data-container.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index e935f00a..d021aa94 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,7 +247,9 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - this.setState({reload: true}) + this.setState({ + buildingEdits: {} + }); console.log(slug + " verify button clicked") } From f4ca5ccd6233a3e54ba320039790dd7c7d081603 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 10:17:34 +0100 Subject: [PATCH 40/60] restore original "edits" dict --- app/src/frontend/building/data-container.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index d021aa94..3e5b45f8 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,9 +247,11 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - this.setState({ - buildingEdits: {} - }); + const edits = { + [slug]: value + }; + + this.doSubmit(edits); console.log(slug + " verify button clicked") } From fb319cd2f15c02757f8dde3679d8da738c106f20 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 10:36:37 +0100 Subject: [PATCH 41/60] attempt ignoring error --- app/src/api/services/domainLogic/processBuildingUpdate.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/api/services/domainLogic/processBuildingUpdate.ts b/app/src/api/services/domainLogic/processBuildingUpdate.ts index 2169c793..d181f59f 100644 --- a/app/src/api/services/domainLogic/processBuildingUpdate.ts +++ b/app/src/api/services/domainLogic/processBuildingUpdate.ts @@ -36,7 +36,10 @@ async function processCurrentLandUseClassifications( if(error instanceof ArgumentError && error.argumentName === 'landUseUpdate') { error.argumentName = 'buildingUpdate'; } - throw error; + if(error instanceof TypeError && error.argumentName === 'landUseGroupUpdate') { + } else { + throw error; + } } } From b5804c1f1c1c28a3f576f52aa9729f37a94281c4 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 10:45:52 +0100 Subject: [PATCH 42/60] Revert "attempt ignoring error" This reverts commit fb319cd2f15c02757f8dde3679d8da738c106f20. --- app/src/api/services/domainLogic/processBuildingUpdate.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/src/api/services/domainLogic/processBuildingUpdate.ts b/app/src/api/services/domainLogic/processBuildingUpdate.ts index d181f59f..2169c793 100644 --- a/app/src/api/services/domainLogic/processBuildingUpdate.ts +++ b/app/src/api/services/domainLogic/processBuildingUpdate.ts @@ -36,10 +36,7 @@ async function processCurrentLandUseClassifications( if(error instanceof ArgumentError && error.argumentName === 'landUseUpdate') { error.argumentName = 'buildingUpdate'; } - if(error instanceof TypeError && error.argumentName === 'landUseGroupUpdate') { - } else { - throw error; - } + throw error; } } From a378f61a532e7e5cf3f91560cd88cba8b353d41c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 11:14:27 +0100 Subject: [PATCH 43/60] try swapping current_landuse_group for date_year hack --- app/src/frontend/building/data-container.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 3e5b45f8..911e9567 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -246,10 +246,10 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } - - const edits = { - [slug]: value - }; + + const edits = (slug == 'current_landuse_group') ? + {['date_year']: value} : + {[slug]: value} this.doSubmit(edits); console.log(slug + " verify button clicked") From 1763af155e15513127ea2982d37fdf4441d6b9fb Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 11:34:15 +0100 Subject: [PATCH 44/60] fake_slug hack --- app/src/frontend/building/data-container.tsx | 2 +- app/src/frontend/config/data-fields-config.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 911e9567..203890dd 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -248,7 +248,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } const edits = (slug == 'current_landuse_group') ? - {['date_year']: value} : + {['fake_slug']: value} : {[slug]: value} this.doSubmit(edits); diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index f808f000..ef01e74d 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -632,7 +632,8 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ year_demolished: { min: 1993, max: 1994 }, lifespan: "2-5", overlap_present: "50%", links: ["", ""]} ] - } + }, + fake_slug: {} }; export const allFieldsConfig = {...dataFields, ...buildingUserFields}; \ No newline at end of file From 9600669c5e6fbf6eac7d04c22aca12957759b97c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 11:46:37 +0100 Subject: [PATCH 45/60] Revert "fake_slug hack" This reverts commit 1763af155e15513127ea2982d37fdf4441d6b9fb. --- app/src/frontend/building/data-container.tsx | 2 +- app/src/frontend/config/data-fields-config.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 203890dd..911e9567 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -248,7 +248,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } const edits = (slug == 'current_landuse_group') ? - {['fake_slug']: value} : + {['date_year']: value} : {[slug]: value} this.doSubmit(edits); diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index ef01e74d..f808f000 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -632,8 +632,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ year_demolished: { min: 1993, max: 1994 }, lifespan: "2-5", overlap_present: "50%", links: ["", ""]} ] - }, - fake_slug: {} + } }; export const allFieldsConfig = {...dataFields, ...buildingUserFields}; \ No newline at end of file From f37ee00dac4268e66a4e672e2e4c5f9745add902 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 11:53:08 +0100 Subject: [PATCH 46/60] add current_landuse_verified to data-fields-config --- app/src/frontend/config/data-fields-config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index f808f000..95a46238 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -220,7 +220,11 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "URL for current land use reference", example: ["", "", ""], }, - + current_landuse_verified: { + category: Category.LandUse, + title: 'Has this land use been manually verified?', + example: true, + }, building_attachment_form: { category: Category.Type, title: "Adjacency/configuration", From 0d1d57eaa47bb1df9370d9e7ae8687a23f0c3ab2 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 11:57:07 +0100 Subject: [PATCH 47/60] attempt only refresh on current use verification button pressed --- app/src/frontend/building/data-container.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 911e9567..72b8f1c5 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -247,11 +247,13 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - const edits = (slug == 'current_landuse_group') ? - {['date_year']: value} : - {[slug]: value} - - this.doSubmit(edits); + if (slug == 'current_landuse_group'){ + const edits = { + ['current_landuse_verified'] = true + } + this.doSubmit(edits); + console.log('current_landuse_verified updated') + } console.log(slug + " verify button clicked") } From 06d10dc9ef8f90c138d0fd4aa42eb3c05186b8c9 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 15:50:18 +0100 Subject: [PATCH 48/60] hack --- app/src/frontend/building/data-container.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 72b8f1c5..6e0ddd92 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -1,4 +1,5 @@ import React, { Fragment } from 'react'; +import ReactDOM from 'react-dom'; import { NavLink, Redirect } from 'react-router-dom'; import Confetti from 'canvas-confetti'; import _ from 'lodash'; @@ -247,13 +248,15 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - if (slug == 'current_landuse_group'){ - const edits = { - ['current_landuse_verified'] = true - } - this.doSubmit(edits); - console.log('current_landuse_verified updated') - } + // Hack to get tiles to refresh + const div = document.createElement('div'); + ReactDOM.render( + + + , + div + ); + console.log(slug + " verify button clicked") } From ee2583bf1a56370388ffd6fd54f1637ce85894c0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 15:53:14 +0100 Subject: [PATCH 49/60] import App for hack --- app/src/frontend/building/data-container.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 6e0ddd92..6692eefe 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -17,6 +17,8 @@ import { CategoryViewProps, CopyProps } from './data-containers/category-view-pr import { CopyControl } from './header-buttons/copy-control'; import { ViewEditControl } from './header-buttons/view-edit-control'; +import { App } from '../../app'; + import './data-container.css'; interface DataContainerProps { From 912026711838a5d4f96547048d5dbb18a690bb7b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 15:54:12 +0100 Subject: [PATCH 50/60] import MemoryRouter for hack --- app/src/frontend/building/data-container.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 6692eefe..92a4e780 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -1,5 +1,6 @@ import React, { Fragment } from 'react'; import ReactDOM from 'react-dom'; +import { MemoryRouter } from 'react-router-dom'; import { NavLink, Redirect } from 'react-router-dom'; import Confetti from 'canvas-confetti'; import _ from 'lodash'; From 01ee3777ebde45f7d18fb44d42f5945e056de446 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 15:55:54 +0100 Subject: [PATCH 51/60] fix path to App for hack --- app/src/frontend/building/data-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 92a4e780..611d2d82 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -18,7 +18,7 @@ import { CategoryViewProps, CopyProps } from './data-containers/category-view-pr import { CopyControl } from './header-buttons/copy-control'; import { ViewEditControl } from './header-buttons/view-edit-control'; -import { App } from '../../app'; +import { App } from '../app'; import './data-container.css'; From ed966cea1e1b47ace2fef06bfe094d385f5ac620 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 23 May 2022 16:03:51 +0100 Subject: [PATCH 52/60] remove hack doesn't work --- app/src/frontend/building/data-container.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 611d2d82..2df3c222 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -1,6 +1,4 @@ import React, { Fragment } from 'react'; -import ReactDOM from 'react-dom'; -import { MemoryRouter } from 'react-router-dom'; import { NavLink, Redirect } from 'react-router-dom'; import Confetti from 'canvas-confetti'; import _ from 'lodash'; @@ -18,8 +16,6 @@ import { CategoryViewProps, CopyProps } from './data-containers/category-view-pr import { CopyControl } from './header-buttons/copy-control'; import { ViewEditControl } from './header-buttons/view-edit-control'; -import { App } from '../app'; - import './data-container.css'; interface DataContainerProps { @@ -251,15 +247,6 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.setState({error: err}); } - // Hack to get tiles to refresh - const div = document.createElement('div'); - ReactDOM.render( - - - , - div - ); - console.log(slug + " verify button clicked") } From ed5cd0b9fae1ecbc9ff0d47a69e51af650a9422d Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 14:35:24 +0100 Subject: [PATCH 53/60] remove changes related to Current Use verification button --- app/src/frontend/building/data-components/verification.tsx | 5 ++--- .../frontend/building/data-components/year-data-entry.tsx | 2 +- app/src/frontend/building/data-container.tsx | 2 +- .../building/data-containers/category-view-props.ts | 2 +- app/src/frontend/config/data-fields-config.ts | 6 +----- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/src/frontend/building/data-components/verification.tsx b/app/src/frontend/building/data-components/verification.tsx index f0591cce..009a95f1 100644 --- a/app/src/frontend/building/data-components/verification.tsx +++ b/app/src/frontend/building/data-components/verification.tsx @@ -5,7 +5,7 @@ import './verification.css'; interface VerificationProps { slug: string; - onVerify: (slug: string, verify: boolean, x: number, y: number, value: any) => void; + onVerify: (slug: string, verify: boolean, x: number, y: number) => void; user_verified: boolean; user_verified_as: string; verified_count: number; @@ -24,8 +24,7 @@ class Verification extends Component { e.preventDefault(); const x = e.clientX / document.body.clientWidth; const y = e.clientY / document.body.clientHeight; - const value = null; - this.props.onVerify(this.props.slug, verify, x, y, value); + this.props.onVerify(this.props.slug, verify, x, y); } } diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index dfc93cb3..af0d0749 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -14,7 +14,7 @@ interface YearDataEntryProps { mode?: 'view' | 'edit' | 'multi-edit'; onChange?: (key: string, value: any) => void; - onVerify: (slug: string, verify: boolean, x: number, y: number, value: any) => void; + onVerify: (slug: string, verify: boolean, x: number, y: number) => void; user_verified: boolean; user_verified_as: string; verified_count: number; diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index 2df3c222..fb886d7a 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -214,7 +214,7 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine this.doSubmit(edits); } - async handleVerify(slug: string, verify: boolean, x: number, y: number, value: any) { + async handleVerify(slug: string, verify: boolean, x: number, y: number) { const verifyPatch = {}; if (verify) { verifyPatch[slug] = this.props.building[slug]; diff --git a/app/src/frontend/building/data-containers/category-view-props.ts b/app/src/frontend/building/data-containers/category-view-props.ts index d6188864..27d510f6 100644 --- a/app/src/frontend/building/data-containers/category-view-props.ts +++ b/app/src/frontend/building/data-containers/category-view-props.ts @@ -14,7 +14,7 @@ interface CategoryViewProps { edited: boolean; copy: CopyProps; onChange: (key: string, value: any) => void; - onVerify: (slug: string, verify: boolean, x: number, y: number, value: any) => void; + onVerify: (slug: string, verify: boolean, x: number, y: number) => void; /* Special handler for adding and immediately saving a new item of an array-like attribute */ onSaveAdd: (slug: string, newItem: any) => void; diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 95a46238..f808f000 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -220,11 +220,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "URL for current land use reference", example: ["", "", ""], }, - current_landuse_verified: { - category: Category.LandUse, - title: 'Has this land use been manually verified?', - example: true, - }, + building_attachment_form: { category: Category.Type, title: "Adjacency/configuration", From 1bfcc0682b9acfac40b1a293c03554d6076afb44 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 14:37:58 +0100 Subject: [PATCH 54/60] finish removing current use verification changes --- app/src/frontend/building/data-components/year-data-entry.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index af0d0749..aea54267 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -20,13 +20,13 @@ interface YearDataEntryProps { verified_count: number; allow_verify: boolean; - onVerify_upper: (slug: string, verify: boolean, x: number, y: number, value: any) => void; + onVerify_upper: (slug: string, verify: boolean, x: number, y: number) => void; user_verified_upper: boolean; user_verified_as_upper: string; verified_count_upper: number; allow_verify_upper: boolean; - onVerify_lower: (slug: string, verify: boolean, x: number, y: number, value: any) => void; + onVerify_lower: (slug: string, verify: boolean, x: number, y: number) => void; user_verified_lower: boolean; user_verified_as_lower: string; verified_count_lower: number; From 89932d404b920850be29394c7abda3262f854403 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 14:45:22 +0100 Subject: [PATCH 55/60] add verification facade_year --- app/src/api/config/dataFields.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 309db28f..3d8d7d86 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -108,6 +108,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, facade_year: { edit: true, + verify: true, }, facade_upper: { edit: false, From ee6a7681a2f5ed13d41d78be49004ac7122c025b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 14:50:04 +0100 Subject: [PATCH 56/60] add verification for date_link --- app/src/api/config/dataFields.ts | 1 + app/src/frontend/building/data-containers/age.tsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 3d8d7d86..5e1f6474 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -105,6 +105,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, date_link: { edit: true, + verify: true, }, facade_year: { edit: true, diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 2f9d08e2..3dbea6cf 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -170,6 +170,14 @@ const AgeView: React.FunctionComponent = (props) => { placeholder="https://..." editableEntries={true} /> + ); }; From d1d02b7c73fb7b1449b704ac965c123e3a76e22c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 14:59:03 +0100 Subject: [PATCH 57/60] verify planning_live_application --- app/src/api/config/dataFields.ts | 4 ++++ app/src/frontend/building/data-containers/planning.tsx | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 5e1f6474..91bcec5d 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -166,6 +166,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, + planning_live_application: { + edit: true, + verify: true, + }, planning_in_conservation_area: { 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 a8f78494..a05f0c11 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -40,6 +40,14 @@ const PlanningView: React.FunctionComponent = (props) => ( value={null} disabled={true} /> + Date: Thu, 26 May 2022 15:02:15 +0100 Subject: [PATCH 58/60] verify planning_live_application --- app/src/frontend/config/data-fields-config.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index f808f000..84bbfbed 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -436,6 +436,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "", //tooltip: , }, + planning_live_application: { + category: Category.Planning, + title: "Planning live application", + example: "", + //tooltip: , + }, planning_in_conservation_area: { category: Category.Planning, title: "In a conservation area?", From ad7459749dfb6136b684ac83011515968b65f545 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 15:03:58 +0100 Subject: [PATCH 59/60] Revert "verify planning_live_application" This reverts commit f3f711fb7070aec19d024cff46995a069f7dfb98. --- app/src/frontend/config/data-fields-config.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 84bbfbed..f808f000 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -436,12 +436,6 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ example: "", //tooltip: , }, - planning_live_application: { - category: Category.Planning, - title: "Planning live application", - example: "", - //tooltip: , - }, planning_in_conservation_area: { category: Category.Planning, title: "In a conservation area?", From 31d2df911ef0ef0694895b9834779fbda8a6eea7 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 26 May 2022 15:04:26 +0100 Subject: [PATCH 60/60] Revert "verify planning_live_application" This reverts commit d1d02b7c73fb7b1449b704ac965c123e3a76e22c. --- app/src/api/config/dataFields.ts | 4 ---- app/src/frontend/building/data-containers/planning.tsx | 8 -------- 2 files changed, 12 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 91bcec5d..5e1f6474 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -166,10 +166,6 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, - planning_live_application: { - edit: true, - verify: true, - }, planning_in_conservation_area: { 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 a05f0c11..a8f78494 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -40,14 +40,6 @@ const PlanningView: React.FunctionComponent = (props) => ( value={null} disabled={true} /> -