Add planning fields to view/edit

This commit is contained in:
Tom Russell 2019-01-10 09:30:40 +00:00
parent 7d97424ca0
commit 4e6d589891
2 changed files with 127 additions and 9 deletions

View File

@ -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} />

View File

@ -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?"
}
]
}
]