From 2476cc2c1e38939b81e12a27739b11c4b79afa6e Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 10:57:37 +0100 Subject: [PATCH 01/28] copy source fields from age to current use and update slugs --- .../frontend/building/data-containers/use.tsx | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 26ff6e11..388afb47 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -51,6 +51,52 @@ const UseView: React.FunctionComponent = (props) => ( copy={props.copy} onChange={props.onChange} /> + + + ); const UseContainer = withCopyEdit(UseView); From 146759b3415f12c419a72a8d7754d281c0fa7c92 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 11:00:56 +0100 Subject: [PATCH 02/28] add current_landuse_source data field --- app/src/frontend/building/data-containers/use.tsx | 4 ++-- app/src/frontend/config/data-fields-config.ts | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 388afb47..f6258145 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -52,13 +52,13 @@ const UseView: React.FunctionComponent = (props) => ( onChange={props.onChange} /> Date: Fri, 29 Apr 2022 11:09:25 +0100 Subject: [PATCH 03/28] correct import statements --- app/src/frontend/building/data-containers/use.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index f6258145..9df85271 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -4,6 +4,8 @@ import InfoBox from '../../components/info-box'; import { dataFields } from '../../config/data-fields-config'; import DataEntry from '../data-components/data-entry'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; +import SelectDataEntry from '../data-components/select-data-entry'; +import TextboxDataEntry from '../data-components/textbox-data-entry'; import withCopyEdit from '../data-container'; import { CategoryViewProps } from './category-view-props'; From fd2d0f08000de39f0596f0161b192581b723d603 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 11:13:29 +0100 Subject: [PATCH 04/28] change props values --- app/src/frontend/building/data-containers/use.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 9df85271..259e5ccd 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -56,7 +56,7 @@ const UseView: React.FunctionComponent = (props) => ( = (props) => ( = (props) => ( Date: Fri, 29 Apr 2022 11:19:08 +0100 Subject: [PATCH 05/28] fix props values --- app/src/frontend/building/data-containers/use.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 259e5ccd..39b53ea4 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -56,7 +56,7 @@ const UseView: React.FunctionComponent = (props) => ( = (props) => ( = (props) => ( Date: Fri, 29 Apr 2022 11:24:54 +0100 Subject: [PATCH 06/28] fix props values --- app/src/frontend/config/data-fields-config.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 2ceee0d5..342c5558 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -199,6 +199,18 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Source for the current land use", example: "", }, + current_landuse_source_detail: { + category: Category.LandUse, + title: "Source details", + tooltip: "References for current land use source (max 500 characters)", + example: "", + }, + current_landuse_link: { + category: Category.LandUse, + title: "Text and Image Links", + tooltip: "URL for current land use reference", + example: ["", "", ""], + }, building_attachment_form: { category: Category.Type, From 6fd0a313db38fb6b23f77f34a0a4f08fc8341ecb Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 11:34:32 +0100 Subject: [PATCH 07/28] change current_landuse_source source options --- .../frontend/building/data-containers/use.tsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 39b53ea4..b8747402 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -63,19 +63,12 @@ const UseView: React.FunctionComponent = (props) => ( tooltip={dataFields.current_landuse_source.tooltip} placeholder="" options={[ - "Expert knowledge of building", - "Expert estimate from image", - "Survey of London", - "Pevsner Guides", - "Victoria County History", - "Local history publication", - "Other publication", - "National Heritage List for England", - "Other database or gazetteer", - "Historical map", - "Other archive document", - "Film/Video", - "Other website", + "Expert/personal knowledge of building", + "Online streetview image", + "Open planning authority dataset", + "Open property tax dataset", + "Open housing dataset", + "Open address dataset", "Other" ]} /> From d0f9817d1eaa0b6dc34269d01062f0a1e2326905 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 11:49:46 +0100 Subject: [PATCH 08/28] fix tooltips --- app/src/frontend/building/data-containers/use.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index b8747402..87a4a53c 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -79,7 +79,7 @@ const UseView: React.FunctionComponent = (props) => ( mode={props.mode} copy={props.copy} onChange={props.onChange} - tooltip={dataFields.date_source_detail.tooltip} + tooltip={dataFields.current_landuse_source_detail.tooltip} /> = (props) => ( mode={props.mode} copy={props.copy} onChange={props.onChange} - tooltip={dataFields.date_link.tooltip} + tooltip={dataFields.current_landuse_link.tooltip} placeholder="https://..." editableEntries={true} /> From db4870208c11cd3be86e9612def0ae004306e06f Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 11:52:11 +0100 Subject: [PATCH 09/28] update slugs --- app/src/frontend/building/data-containers/use.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 87a4a53c..6413ad99 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -55,7 +55,7 @@ const UseView: React.FunctionComponent = (props) => ( /> = (props) => ( /> = (props) => ( /> Date: Fri, 29 Apr 2022 11:53:34 +0100 Subject: [PATCH 10/28] fix titles --- app/src/frontend/building/data-containers/use.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 6413ad99..c4644e82 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -73,7 +73,7 @@ const UseView: React.FunctionComponent = (props) => ( ]} /> = (props) => ( tooltip={dataFields.current_landuse_source_detail.tooltip} /> Date: Fri, 29 Apr 2022 14:05:36 +0100 Subject: [PATCH 11/28] add new db migration --- migrations/028.landuse-source.down.sql | 5 +++++ migrations/028.landuse-source.up.sql | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 migrations/028.landuse-source.down.sql create mode 100644 migrations/028.landuse-source.up.sql diff --git a/migrations/028.landuse-source.down.sql b/migrations/028.landuse-source.down.sql new file mode 100644 index 00000000..1c6f7c09 --- /dev/null +++ b/migrations/028.landuse-source.down.sql @@ -0,0 +1,5 @@ +ALTER TABLE buildings DROP COLUMN IF EXISTS current_landuse_source; + +ALTER TABLE buildings DROP COLUMN IF EXISTS current_landuse_source_detail; + +ALTER TABLE buildings DROP COLUMN IF EXISTS current_landuse_link; diff --git a/migrations/028.landuse-source.up.sql b/migrations/028.landuse-source.up.sql new file mode 100644 index 00000000..3dbd9557 --- /dev/null +++ b/migrations/028.landuse-source.up.sql @@ -0,0 +1,7 @@ +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_source varchar; +ALTER TABLE buildings ADD CONSTRAINT buildings_current_landuse_source_len CHECK (length(current_landuse_source) < 150); + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_source_detail varchar; +ALTER TABLE buildings ADD CONSTRAINT current_landuse_source_detail_len CHECK (length(current_landuse_source_detail) < 500); + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_link text[]; \ No newline at end of file From 5d5f4c71df251d349d9255f856e77951ea4842cb Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 14:34:11 +0100 Subject: [PATCH 12/28] update dataFields with new current use fields --- app/src/api/config/dataFields.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index e51cf8bf..daee34da 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -257,7 +257,15 @@ export const buildingAttributesConfig = valueType()({ /* eslint derivedEdit: true, verify: false, }, - + current_landuse_source: { + edit: true, + }, + current_landuse_source_detail: { + edit: true, + }, + current_landuse_link: { + edit: true, + }, dynamics_has_demolished_buildings: { edit: true, verify: true From 4c1d459cbaf23f469ad79744badf8fa30b79a945 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 15:09:10 +0100 Subject: [PATCH 13/28] add Residential (verified) category --- migrations/015.bulk_data_sources.up.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/migrations/015.bulk_data_sources.up.sql b/migrations/015.bulk_data_sources.up.sql index 6c757331..36e5550a 100644 --- a/migrations/015.bulk_data_sources.up.sql +++ b/migrations/015.bulk_data_sources.up.sql @@ -29,6 +29,7 @@ VALUES ('U030','Minerals','order',NULL,False), ('U040','Recreation And Leisure','order',NULL,True), ('U070','Residential','order',NULL,True), +('U070','Residential (verified)','order',NULL,True), ('U090','Retail','order',NULL,True), ('U050','Transport','order',NULL,True), ('U130','Unused Land','order',NULL,False), From 475a1460465607bdd2050b1c4801fb0f3bc29959 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 29 Apr 2022 15:45:46 +0100 Subject: [PATCH 14/28] remove duplicate landuse_id --- migrations/015.bulk_data_sources.up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/015.bulk_data_sources.up.sql b/migrations/015.bulk_data_sources.up.sql index 36e5550a..f5998f96 100644 --- a/migrations/015.bulk_data_sources.up.sql +++ b/migrations/015.bulk_data_sources.up.sql @@ -29,7 +29,7 @@ VALUES ('U030','Minerals','order',NULL,False), ('U040','Recreation And Leisure','order',NULL,True), ('U070','Residential','order',NULL,True), -('U070','Residential (verified)','order',NULL,True), +('U070v','Residential (verified)','order',NULL,True), ('U090','Retail','order',NULL,True), ('U050','Transport','order',NULL,True), ('U130','Unused Land','order',NULL,False), From 2025a286eda4f6d2979fc27061227f2dc6488330 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 11:59:36 +0100 Subject: [PATCH 15/28] update polygon colour for current use verified --- app/map_styles/polygon.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index 6da76f59..2a1043b9 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -534,9 +534,13 @@ - [current_landuse_order] = "Residential" and not ([current_landuse_group] = "Garden buildings") and not ([current_landuse_group] = "Hotels, boarding and guest houses") + [current_landuse_order] = "Residential" and not ([current_landuse_group] = "Garden buildings") and not ([current_landuse_group] = "Hotels, boarding and guest houses") and not ([current_landuse_verified]) + + [current_landuse_order] = "Residential" and not ([current_landuse_group] = "Garden buildings") and not ([current_landuse_group] = "Hotels, boarding and guest houses") and ([current_landuse_verified]) + + [current_landuse_order] = "Residential" and [current_landuse_group] = "Hotels, boarding and guest houses" From aa138198d83f6acf57d46a802d0feb682d126be6 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 12:00:08 +0100 Subject: [PATCH 16/28] update buildings table to have current_landuse_verified bool --- migrations/028.landuse-source.down.sql | 2 ++ migrations/028.landuse-source.up.sql | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/migrations/028.landuse-source.down.sql b/migrations/028.landuse-source.down.sql index 1c6f7c09..d9ededda 100644 --- a/migrations/028.landuse-source.down.sql +++ b/migrations/028.landuse-source.down.sql @@ -3,3 +3,5 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS current_landuse_source; ALTER TABLE buildings DROP COLUMN IF EXISTS current_landuse_source_detail; ALTER TABLE buildings DROP COLUMN IF EXISTS current_landuse_link; + +ALTER TABLE buildings DROP COLUMN IF NOT EXISTS current_landuse_verified; diff --git a/migrations/028.landuse-source.up.sql b/migrations/028.landuse-source.up.sql index 3dbd9557..4a295ff0 100644 --- a/migrations/028.landuse-source.up.sql +++ b/migrations/028.landuse-source.up.sql @@ -4,4 +4,6 @@ ALTER TABLE buildings ADD CONSTRAINT buildings_current_landuse_source_len CHECK ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_source_detail varchar; ALTER TABLE buildings ADD CONSTRAINT current_landuse_source_detail_len CHECK (length(current_landuse_source_detail) < 500); -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_link text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_link text[]; + +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_verified BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file From 63c190c981cdd6cf0943fb3669c67560b6e7cbdd Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 13:22:05 +0100 Subject: [PATCH 17/28] set buildings table to current_landuse_group = True when verify clicked --- app/src/api/dataAccess/verify.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/api/dataAccess/verify.ts b/app/src/api/dataAccess/verify.ts index 02e163d7..154a3cc8 100644 --- a/app/src/api/dataAccess/verify.ts +++ b/app/src/api/dataAccess/verify.ts @@ -74,6 +74,15 @@ export async function updateBuildingUserVerifiedAttribute(buildingId: number, us [buildingId, userId, attribute, value] ); } + if (attribute == 'current_landuse_group'){ + await (db).none( + `UPDATE buildings + SET current_landuse_verified = TRUE + WHERE buildings.building_id = $1;" + `, + [buildingId] + ); + } } catch(error) { console.error(error) if(error.detail?.includes('already exists')) { From 7a0228bed1cbd9bd323f84074873bbc8cf6ec481 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 13:23:49 +0100 Subject: [PATCH 18/28] un-verify in buildings table too --- app/src/api/dataAccess/verify.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/api/dataAccess/verify.ts b/app/src/api/dataAccess/verify.ts index 154a3cc8..8bcb3153 100644 --- a/app/src/api/dataAccess/verify.ts +++ b/app/src/api/dataAccess/verify.ts @@ -106,6 +106,15 @@ export async function removeBuildingUserVerifiedAttribute(buildingId: number, us `, [buildingId, userId, attribute] ); + if (attribute == 'current_landuse_group'){ + await (db).none( + `UPDATE buildings + SET current_landuse_verified = FALSE + WHERE buildings.building_id = $1;" + `, + [buildingId] + ); + } } catch(error) { throw new DatabaseError(error.detail); } From c8ab93ab9f12292f075fb846ff53015cf952ce8d Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 13:56:00 +0100 Subject: [PATCH 19/28] add current_landuse_verified to dataDefinition --- app/src/tiles/dataDefinition.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/tiles/dataDefinition.ts b/app/src/tiles/dataDefinition.ts index be20beba..d6d0d0b6 100644 --- a/app/src/tiles/dataDefinition.ts +++ b/app/src/tiles/dataDefinition.ts @@ -150,7 +150,8 @@ const LAYER_QUERIES = { SELECT geometry_id, current_landuse_order, - current_landuse_group[1] as current_landuse_group + current_landuse_group[1] as current_landuse_group, + current_landuse_verified FROM buildings WHERE From 66085bf67ee9ab082fc5804d8f7af24efadcb11b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 14:11:17 +0100 Subject: [PATCH 20/28] remove rogue quote --- app/src/api/dataAccess/verify.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/api/dataAccess/verify.ts b/app/src/api/dataAccess/verify.ts index 8bcb3153..0be4fbd2 100644 --- a/app/src/api/dataAccess/verify.ts +++ b/app/src/api/dataAccess/verify.ts @@ -78,7 +78,7 @@ export async function updateBuildingUserVerifiedAttribute(buildingId: number, us await (db).none( `UPDATE buildings SET current_landuse_verified = TRUE - WHERE buildings.building_id = $1;" + WHERE buildings.building_id = $1; `, [buildingId] ); @@ -110,7 +110,7 @@ export async function removeBuildingUserVerifiedAttribute(buildingId: number, us await (db).none( `UPDATE buildings SET current_landuse_verified = FALSE - WHERE buildings.building_id = $1;" + WHERE buildings.building_id = $1; `, [buildingId] ); From e923c249db322071dde41ae54c1f7ee04fe3830f Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 15:08:38 +0100 Subject: [PATCH 21/28] update legend --- app/src/frontend/config/category-maps-config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/frontend/config/category-maps-config.ts b/app/src/frontend/config/category-maps-config.ts index 6ccdfb15..9a79013c 100644 --- a/app/src/frontend/config/category-maps-config.ts +++ b/app/src/frontend/config/category-maps-config.ts @@ -193,7 +193,8 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} = elements: [ { color: '#e5050d', text: 'Mixed Use' }, { subtitle: 'Single use:'}, - { color: '#252aa6', text: 'Residential' }, + { color: '#252aa6', text: 'Residential (unverified)' }, + { color: '#7025a6', text: 'Residential (verified)' }, { color: '#ff8c00', text: 'Retail' }, { color: '#f5f58f', text: 'Industry & Business' }, { color: '#73ccd1', text: 'Community Services' }, From fb277309f1f5ded3b4812ef4fa5585bde5343ecb Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 15:10:05 +0100 Subject: [PATCH 22/28] remove changed to 015 migration not needed --- migrations/015.bulk_data_sources.up.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/migrations/015.bulk_data_sources.up.sql b/migrations/015.bulk_data_sources.up.sql index f5998f96..6c757331 100644 --- a/migrations/015.bulk_data_sources.up.sql +++ b/migrations/015.bulk_data_sources.up.sql @@ -29,7 +29,6 @@ VALUES ('U030','Minerals','order',NULL,False), ('U040','Recreation And Leisure','order',NULL,True), ('U070','Residential','order',NULL,True), -('U070v','Residential (verified)','order',NULL,True), ('U090','Retail','order',NULL,True), ('U050','Transport','order',NULL,True), ('U130','Unused Land','order',NULL,False), From adb4bfa9045a93a9f3dd64a54bc50567cd92bffd Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 15:29:48 +0100 Subject: [PATCH 23/28] update current_landuse_group before return in removeBuildingUserVerifiedAttribute --- app/src/api/dataAccess/verify.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/api/dataAccess/verify.ts b/app/src/api/dataAccess/verify.ts index 0be4fbd2..48bdd1c5 100644 --- a/app/src/api/dataAccess/verify.ts +++ b/app/src/api/dataAccess/verify.ts @@ -96,6 +96,15 @@ export async function updateBuildingUserVerifiedAttribute(buildingId: number, us export async function removeBuildingUserVerifiedAttribute(buildingId: number, userId: string, attribute: string) : Promise { try { + if (attribute == 'current_landuse_group'){ + await (db).none( + `UPDATE buildings + SET current_landuse_verified = FALSE + WHERE buildings.building_id = $1; + `, + [buildingId] + ); + } return await (db).none( `DELETE FROM building_verification @@ -106,15 +115,6 @@ export async function removeBuildingUserVerifiedAttribute(buildingId: number, us `, [buildingId, userId, attribute] ); - if (attribute == 'current_landuse_group'){ - await (db).none( - `UPDATE buildings - SET current_landuse_verified = FALSE - WHERE buildings.building_id = $1; - `, - [buildingId] - ); - } } catch(error) { throw new DatabaseError(error.detail); } From 8b761b8ddc10ef3e33072451b26797856d43be11 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 15:40:58 +0100 Subject: [PATCH 24/28] add current_landuse_verified update to buildings --- migrations/028.landuse-source.up.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/migrations/028.landuse-source.up.sql b/migrations/028.landuse-source.up.sql index 4a295ff0..01b47257 100644 --- a/migrations/028.landuse-source.up.sql +++ b/migrations/028.landuse-source.up.sql @@ -6,4 +6,9 @@ ALTER TABLE buildings ADD CONSTRAINT current_landuse_source_detail_len CHECK (le ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_link text[]; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_verified BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_verified BOOLEAN NOT NULL DEFAULT FALSE; + +UPDATE buildings as b +SET current_landuse_verified = TRUE +FROM building_verification as v +WHERE b.building_id = v.building_id; \ No newline at end of file From 0e58f0ccca43438fb59676896ddb24475ba3f48a Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 15:45:20 +0100 Subject: [PATCH 25/28] limit current_landuse_verified to the correct attribute --- migrations/028.landuse-source.up.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migrations/028.landuse-source.up.sql b/migrations/028.landuse-source.up.sql index 01b47257..bc6925e3 100644 --- a/migrations/028.landuse-source.up.sql +++ b/migrations/028.landuse-source.up.sql @@ -11,4 +11,5 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS current_landuse_verified BOOLEAN UPDATE buildings as b SET current_landuse_verified = TRUE FROM building_verification as v -WHERE b.building_id = v.building_id; \ No newline at end of file +WHERE b.building_id = v.building_id +AND v.attribute = 'current_landuse_group'; \ No newline at end of file From 251a01e4f3f78ad2d5d19cd395cf2c62c94a9849 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 16:33:57 +0100 Subject: [PATCH 26/28] remove current_landuse_source_detail text box not needed --- .../frontend/building/data-containers/use.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index c4644e82..66a92a47 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -72,15 +72,16 @@ const UseView: React.FunctionComponent = (props) => ( "Other" ]} /> - + // NOTE: This wasn't needed after all but will leave in case it becomes useful + // Date: Thu, 5 May 2022 16:37:41 +0100 Subject: [PATCH 27/28] rename --- app/src/frontend/config/data-fields-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 342c5558..828c8c5b 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -207,7 +207,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, current_landuse_link: { category: Category.LandUse, - title: "Text and Image Links", + title: "Source Links", tooltip: "URL for current land use reference", example: ["", "", ""], }, From e0f11299c61eb00b9901a40bc1bab8a736a4d01e Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 5 May 2022 16:40:08 +0100 Subject: [PATCH 28/28] remove comment --- app/src/frontend/building/data-containers/use.tsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 66a92a47..04090357 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -72,16 +72,6 @@ const UseView: React.FunctionComponent = (props) => ( "Other" ]} /> - // NOTE: This wasn't needed after all but will leave in case it becomes useful - //