From 4e6d5898910dddd31298c858e73158942ea4c689 Mon Sep 17 00:00:00 2001 From: Tom Russell <tomalrussell@gmail.com> Date: Thu, 10 Jan 2019 09:30:40 +0000 Subject: [PATCH] Add planning fields to view/edit --- app/src/frontend/building-edit.js | 2 + app/src/frontend/fields-config.json | 134 ++++++++++++++++++++++++++-- 2 files changed, 127 insertions(+), 9 deletions(-) diff --git a/app/src/frontend/building-edit.js b/app/src/frontend/building-edit.js index 5a8c19f3..f6fc4e50 100644 --- a/app/src/frontend/building-edit.js +++ b/app/src/frontend/building-edit.js @@ -207,6 +207,8 @@ class EditForm extends Component { case "text_multi": return <MultiTextInput {...props} handleChange={this.handleUpdate} value={this.state[props.slug]} key={props.slug} /> + case "checkbox": + return null // TODO checkbox input case "like": return <LikeButton {...props} handleLike={this.handleLike} value={this.state[props.slug]} key={props.slug} /> diff --git a/app/src/frontend/fields-config.json b/app/src/frontend/fields-config.json index 61bafc68..b2ca7a3a 100644 --- a/app/src/frontend/fields-config.json +++ b/app/src/frontend/fields-config.json @@ -74,7 +74,9 @@ "help": "https://pages.colouring.london/age", "intro": "Building age data can support energy analysis and help predict long-term change.", "fields": [ - { "title": "Year built (best estimate)", "slug": "date_year", "type": "number", "step": 1 }, + { + "title": "Year built (best estimate)", "slug": "date_year", "type": "number", "step": 1 + }, { "title": "Latest possible start date", "slug": "date_upper", "type": "number", "step": 1, "tooltip": "This should be the latest date building could have started." }, @@ -129,10 +131,18 @@ "title": "Basement storeys", "slug": "size_storeys_basement", "type": "number", "step": 1, "tooltip": "How many storeys below pavement level?" }, - { "title": "Height to apex (m)", "slug": "size_height_apex", "type": "number", "step": 0.1 }, - { "title": "Ground floor area (m²)", "slug": "size_floor_area_ground", "type": "number", "step": 0.1 }, - { "title": "Total floor area (m²)", "slug": "size_floor_area_total", "type": "number", "step": 0.1 }, - { "title": "Frontage Width (m)", "slug": "size_width_frontage", "type": "number", "step": 0.1 } + { + "title": "Height to apex (m)", "slug": "size_height_apex", "type": "number", "step": 0.1 + }, + { + "title": "Ground floor area (m²)", "slug": "size_floor_area_ground", "type": "number", "step": 0.1 + }, + { + "title": "Total floor area (m²)", "slug": "size_floor_area_total", "type": "number", "step": 0.1 + }, + { + "title": "Frontage Width (m)", "slug": "size_width_frontage", "type": "number", "step": 0.1 + } ] }, { @@ -164,11 +174,114 @@ "fields": [] }, { - "inactive": true, "title": "Planning", "slug": "planning", - "intro": "Protection and reuse. Coming soon…", + "intro": "Planning controls relating to protection and reuse.", "help": "https://pages.colouring.london/controls", - "fields": [] + "fields": [ + { + "title": "Planning portal link", "slug": "planning_portal_link", + "type": "text", + "tooltip": "" + }, + { + "title": "In a conservation area?", "slug": "planning_in_conservation_area", + "type": "checkbox", + "tooltip": "" + }, + { + "title": "Conservation area name", "slug": "planning_conservation_area_name", + "type": "text", + "tooltip": "" + }, + { + "title": "Is listed on the National Heritage List for England?", "slug": "planning_in_list", + "type": "checkbox", + "tooltip": "" + }, + { + "title": "National Heritage List for England list id", "slug": "planning_list_id", + "type": "text", + "tooltip": "" + }, + { + "title": "National Heritage List for England list type", "slug": "planning_list_cat", + "type": "text_list", + "tooltip": "", + "options": [ + "Listed Building", + "Scheduled Monument", + "World Heritage Site", + "Building Preservation Notice", + "None" + ] + }, + { + "title": "Listing grade", "slug": "planning_list_grade", + "type": "text_list", + "tooltip": "", + "options": [ + "I", + "II*", + "II", + "None" + ] + }, + { + "title": "Heritage at risk list id", "slug": "planning_heritage_at_risk_id", + "type": "text", + "tooltip": "" + }, + { + "title": "World heritage list id", "slug": "planning_world_list_id", + "type": "text", + "tooltip": "" + }, + { + "title": "In the Greater London Historic Environment Record?", "slug": "planning_in_glher", + "type": "checkbox", + "tooltip": "" + }, + { + "title": "Greater London Historic Environment Record link", "slug": "planning_glher_url", + "type": "text", + "tooltip": "" + }, + { + "title": "In an Architectural Priority Area?", "slug": "planning_in_apa", + "type": "checkbox", + "tooltip": "" + }, + { + "title": "Architectural Priority Area name", "slug": "planning_apa_name", + "type": "text", + "tooltip": "" + }, + { + "title": "Architectural Priority Area tier", "slug": "planning_apa_tier", + "type": "text", + "tooltip": "" + }, + { + "title": "Is locally listed?", "slug": "planning_in_local_list", + "type": "checkbox", + "tooltip": "" + }, + { + "title": "Local list link", "slug": "planning_local_list_url", + "type": "text", + "tooltip": "" + }, + { + "title": "Within a historic area assessment?", "slug": "planning_in_historic_area_assessment", + "type": "checkbox", + "tooltip": "" + }, + { + "title": "Historic area assessment link", "slug": "planning_historic_area_assessment_url", + "type": "text", + "tooltip": "" + } + ] }, { "inactive": true, @@ -182,7 +295,10 @@ "intro": "Do you like the building and think it contributes to the city?", "help": "https://pages.colouring.london/likeme", "fields": [ - { "title": "Number of likes", "slug": "likes_total", "type": "like", "tooltip": "Do you like the building and think it contributes to the city?" } + { + "title": "Number of likes", "slug": "likes_total", "type": "like", + "tooltip": "Do you like the building and think it contributes to the city?" + } ] } ]