From cea4bad4e42ad54d20101bd0a291ea0155c349a7 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Sat, 24 Sep 2022 12:37:58 +0200 Subject: [PATCH] proper input form for UNESCO WHS --- app/src/api/config/dataFields.ts | 2 +- .../building/data-containers/planning.tsx | 23 ++++++++++--------- app/src/frontend/config/data-fields-config.ts | 4 ++-- app/src/tiles/dataDefinition.ts | 4 ++-- maintenance/extract_data/README.md | 2 +- .../extract_data/export_attributes.sql | 2 +- ...3.redesign_protection_designation.down.sql | 3 --- ...033.redesign_protection_designation.up.sql | 3 --- 8 files changed, 19 insertions(+), 24 deletions(-) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 646183ec..553a736d 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -185,7 +185,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true, }, - planning_world_list_url: { + planning_world_list_id: { 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 f8621ffd..3ac66ae2 100644 --- a/app/src/frontend/building/data-containers/planning.tsx +++ b/app/src/frontend/building/data-containers/planning.tsx @@ -206,23 +206,24 @@ const PlanningView: React.FunctionComponent = (props) => ( user_verified_as={props.user_verified.planning_local_list_url} verified_count={props.building.verified.planning_local_list_url} /> - { return "https://whc.unesco.org/en/list/" + id } } + linkDescriptionFunction={(id: String) => { return "ID Link" } } /> World Heritage Site?", - example: "", + example: "488", //tooltip: , }, planning_glher_url: { diff --git a/app/src/tiles/dataDefinition.ts b/app/src/tiles/dataDefinition.ts index ea821e78..367a6fec 100644 --- a/app/src/tiles/dataDefinition.ts +++ b/app/src/tiles/dataDefinition.ts @@ -146,7 +146,7 @@ const LAYER_QUERIES = { WHEN planning_list_grade = 'II' THEN 'Grade II Listed' WHEN planning_local_list_url <> '' THEN 'Locally Listed' WHEN planning_heritage_at_risk_url <> '' THEN 'Heritage at Risk' - WHEN planning_world_list_url <> '' THEN 'In World Heritage Site' + WHEN planning_world_list_id IS NOT NULL THEN 'In World Heritage Site' WHEN planning_in_apa_url <> '' THEN 'In Archaeological Priority Area' ELSE 'None' END @@ -157,7 +157,7 @@ const LAYER_QUERIES = { planning_list_grade IS NOT NULL OR planning_in_conservation_area_url <> '' OR planning_local_list_url <> '' - OR planning_world_list_url <> '' + OR planning_world_list_id IS NOT NULL OR planning_heritage_at_risk_url <> '' OR planning_in_apa_url <> '' `, diff --git a/maintenance/extract_data/README.md b/maintenance/extract_data/README.md index 5cf53149..854025be 100644 --- a/maintenance/extract_data/README.md +++ b/maintenance/extract_data/README.md @@ -75,7 +75,7 @@ This is the main table, containing almost all data collected by Colouring London - `planning_in_conservation_area_url`: conservation area data source link - `planning_list_grade`: National Heritage List for England listing grade - `planning_heritage_at_risk_url`: Heritage at Risk link -- `planning_world_list_url`: UNESCO World Heritage list id +- `planning_world_list_id`: UNESCO World Heritage list id - `planning_glher_url`: Greater London Historic Environment Record link - `planning_in_apa_url`: an Archeological Priority Area (APA) link - `planning_local_list_url`: local list reference link diff --git a/maintenance/extract_data/export_attributes.sql b/maintenance/extract_data/export_attributes.sql index 8a597b3d..c62a5da9 100644 --- a/maintenance/extract_data/export_attributes.sql +++ b/maintenance/extract_data/export_attributes.sql @@ -48,7 +48,7 @@ COPY (SELECT planning_list_cat, planning_list_grade, planning_heritage_at_risk_url, - planning_world_list_url, + planning_world_list_id, planning_glher_url, planning_in_apa_url, planning_local_list_url, diff --git a/migrations/033.redesign_protection_designation.down.sql b/migrations/033.redesign_protection_designation.down.sql index d1364480..2dd1f1a4 100644 --- a/migrations/033.redesign_protection_designation.down.sql +++ b/migrations/033.redesign_protection_designation.down.sql @@ -5,9 +5,6 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_nhle_link text[]; ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_apa_url; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_apa boolean DEFAULT FALSE; -ALTER TABLE buildings DROP COLUMN IF EXISTS planning_world_list_url; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_world_list_id int DEFAULT NULL; - ALTER TABLE buildings DROP COLUMN IF EXISTS planning_heritage_at_risk_url; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_heritage_at_risk_id int DEFAULT NULL; diff --git a/migrations/033.redesign_protection_designation.up.sql b/migrations/033.redesign_protection_designation.up.sql index 28adb65b..f1e8c353 100644 --- a/migrations/033.redesign_protection_designation.up.sql +++ b/migrations/033.redesign_protection_designation.up.sql @@ -13,9 +13,6 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS planning_nhle_link; ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_apa; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_apa_url VARCHAR DEFAULT ''; -ALTER TABLE buildings DROP COLUMN IF EXISTS planning_world_list_id; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_world_list_url VARCHAR DEFAULT ''; - ALTER TABLE buildings DROP COLUMN IF EXISTS planning_heritage_at_risk_id; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_heritage_at_risk_url VARCHAR DEFAULT '';