forked from colouring-cities/colouring-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesign interface listing protection
Per @polly64 checkbox fields were removed and switch was made to using links as both as input method and for providing source. It is no longer possible to just claim that something is listed/featured, entering data will now be also faster
- Loading branch information
1 parent
cbd99f4
commit 20f99e9
Showing
10 changed files
with
167 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
246 changes: 58 additions & 188 deletions
246
app/src/frontend/building/data-containers/planning.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--into a single link from array of links | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_nhle_link; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_nhle_link text[]; | ||
|
||
--changed into URL | ||
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; | ||
|
||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_conservation_area_url; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_conservation_area boolean DEFAULT FALSE; | ||
|
||
-- URL column exists already | ||
ALTER TABLE ADD COLUMN IF NOT EXISTS planning_list_id int DEFAULT NULL; | ||
|
||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_glher boolean DEFAULT FALSE; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_apa_name VARCHAR DEFAULT ''; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_apa_tier smallint DEFAULT NULL; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_local_list boolean DEFAULT FALSE; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_historic_area_assessment boolean DEFAULT FALSE; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
-- this type of links is expected: | ||
-- 'https://historicengland.org.uk/listing/the-list/list-entry/1080446?section=official-list-entry' | ||
|
||
UPDATE buildings | ||
SET planning_nhle_link = CONCAT('https://historicengland.org.uk/listing/the-list/list-entry/', planning_list_id, | ||
'?section=official-list-entry') | ||
WHERE planning_nhle_link = '' | ||
AND planning_list_id IS NOT NULL; | ||
|
||
|
||
UPDATE buildings | ||
SET planning_local_list_url = 'identified as listed: please replace with link' | ||
WHERE planning_local_list_url = '' | ||
AND planning_in_local_list; | ||
|
||
--into a single link from array of links | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_nhle_link; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_nhle_link VARCHAR DEFAULT ''; | ||
|
||
--changed into URL | ||
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 ''; | ||
|
||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_conservation_area; | ||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_in_conservation_area_url VARCHAR DEFAULT ''; | ||
|
||
-- URL column exists already | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_list_id; | ||
|
||
--fully removed | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_glher; | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_apa_name; | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_apa_tier; | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_local_list; | ||
ALTER TABLE buildings DROP COLUMN IF EXISTS planning_in_historic_area_assessment; | ||
|
||
rg "planning_in_apa|planning_world_list_id|planning_heritage_at_risk_id|planning_in_conservation_area|planning_in_glher|planning_apa_name|planning_apa_tier|planning_in_local_list|planning_in_historic_area_assessment" |