Add data entry groups to planning category

This commit is contained in:
Maciej Ziarkowski 2019-10-08 14:20:43 +01:00
parent 4320e20952
commit 354d8a6f96

View File

@ -4,6 +4,7 @@ import withCopyEdit from '../data-container';
import DataEntry from '../data-components/data-entry'; import DataEntry from '../data-components/data-entry';
import CheckboxDataEntry from '../data-components/checkbox-data-entry'; import CheckboxDataEntry from '../data-components/checkbox-data-entry';
import SelectDataEntry from '../data-components/select-data-entry'; import SelectDataEntry from '../data-components/select-data-entry';
import { DataEntryGroup } from '../data-components/data-entry-group';
/** /**
* Planning view/edit section * Planning view/edit section
@ -18,182 +19,186 @@ const PlanningView = (props) => (
copy={props.copy} copy={props.copy}
onChange={props.onChange} onChange={props.onChange}
/> />
<CheckboxDataEntry <DataEntryGroup name="Listing and protections" >
title="In a conservation area?" <CheckboxDataEntry
slug="planning_in_conservation_area" title="In a conservation area?"
value={props.building.planning_in_conservation_area} slug="planning_in_conservation_area"
mode={props.mode} value={props.building.planning_in_conservation_area}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="Conservation area name" <DataEntry
slug="planning_conservation_area_name" title="Conservation area name"
value={props.building.planning_conservation_area_name} slug="planning_conservation_area_name"
mode={props.mode} value={props.building.planning_conservation_area_name}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<CheckboxDataEntry />
title="Is listed on the National Heritage List for England?" <CheckboxDataEntry
slug="planning_in_list" title="Is listed on the National Heritage List for England?"
value={props.building.planning_in_list} slug="planning_in_list"
mode={props.mode} value={props.building.planning_in_list}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="National Heritage List for England list id" <DataEntry
slug="planning_list_id" title="National Heritage List for England list id"
value={props.building.planning_list_id} slug="planning_list_id"
mode={props.mode} value={props.building.planning_list_id}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<SelectDataEntry />
title="National Heritage List for England list type" <SelectDataEntry
slug="planning_list_cat" title="National Heritage List for England list type"
value={props.building.planning_list_cat} slug="planning_list_cat"
mode={props.mode} value={props.building.planning_list_cat}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
options={[ onChange={props.onChange}
"Listed Building", options={[
"Scheduled Monument", "Listed Building",
"World Heritage Site", "Scheduled Monument",
"Building Preservation Notice", "World Heritage Site",
"None" "Building Preservation Notice",
]} "None"
/> ]}
<SelectDataEntry />
title="Listing grade" <SelectDataEntry
slug="planning_list_grade" title="Listing grade"
value={props.building.planning_list_grade} slug="planning_list_grade"
mode={props.mode} value={props.building.planning_list_grade}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
options={[ onChange={props.onChange}
"I", options={[
"II*", "I",
"II", "II*",
"None" "II",
]} "None"
/> ]}
<DataEntry />
title="Heritage at risk list id" <DataEntry
slug="planning_heritage_at_risk_id" title="Heritage at risk list id"
value={props.building.planning_heritage_at_risk_id} slug="planning_heritage_at_risk_id"
mode={props.mode} value={props.building.planning_heritage_at_risk_id}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="World heritage list id" <DataEntry
slug="planning_world_list_id" title="World heritage list id"
value={props.building.planning_world_list_id} slug="planning_world_list_id"
mode={props.mode} value={props.building.planning_world_list_id}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<CheckboxDataEntry />
title="In the Greater London Historic Environment Record?" <CheckboxDataEntry
slug="planning_in_glher" title="In the Greater London Historic Environment Record?"
value={props.building.planning_in_glher} slug="planning_in_glher"
mode={props.mode} value={props.building.planning_in_glher}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="Greater London Historic Environment Record link" <DataEntry
slug="planning_glher_url" title="Greater London Historic Environment Record link"
value={props.building.planning_glher_url} slug="planning_glher_url"
mode={props.mode} value={props.building.planning_glher_url}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<CheckboxDataEntry />
title="In an Architectural Priority Area?" <CheckboxDataEntry
slug="planning_in_apa" title="In an Architectural Priority Area?"
value={props.building.planning_in_apa} slug="planning_in_apa"
mode={props.mode} value={props.building.planning_in_apa}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="Architectural Priority Area name" <DataEntry
slug="planning_apa_name" title="Architectural Priority Area name"
value={props.building.planning_apa_name} slug="planning_apa_name"
mode={props.mode} value={props.building.planning_apa_name}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="Architectural Priority Area tier" <DataEntry
slug="planning_apa_tier" title="Architectural Priority Area tier"
value={props.building.planning_apa_tier} slug="planning_apa_tier"
mode={props.mode} value={props.building.planning_apa_tier}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<CheckboxDataEntry />
title="Is locally listed?" <CheckboxDataEntry
slug="planning_in_local_list" title="Is locally listed?"
value={props.building.planning_in_local_list} slug="planning_in_local_list"
mode={props.mode} value={props.building.planning_in_local_list}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="Local list link" <DataEntry
slug="planning_local_list_url" title="Local list link"
value={props.building.planning_local_list_url} slug="planning_local_list_url"
mode={props.mode} value={props.building.planning_local_list_url}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<CheckboxDataEntry />
title="Within a historic area assessment?" <CheckboxDataEntry
slug="planning_in_historic_area_assessment" title="Within a historic area assessment?"
value={props.building.planning_in_historic_area_assessment} slug="planning_in_historic_area_assessment"
mode={props.mode} value={props.building.planning_in_historic_area_assessment}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<DataEntry />
title="Historic area assessment link" <DataEntry
slug="planning_historic_area_assessment_url" title="Historic area assessment link"
value={props.building.planning_historic_area_assessment_url} slug="planning_historic_area_assessment_url"
mode={props.mode} value={props.building.planning_historic_area_assessment_url}
copy={props.copy} mode={props.mode}
onChange={props.onChange} copy={props.copy}
/> onChange={props.onChange}
<CheckboxDataEntry />
title="Is the building proposed for demolition?" </DataEntryGroup>
slug="planning_demolition_proposed" <DataEntryGroup name="Demolition and demolition history">
value={props.building.planning_demolition_proposed} <CheckboxDataEntry
mode={props.mode} title="Is the building proposed for demolition?"
copy={props.copy} slug="planning_demolition_proposed"
onChange={props.onChange} value={props.building.planning_demolition_proposed}
disabled={true} mode={props.mode}
/> copy={props.copy}
<CheckboxDataEntry onChange={props.onChange}
title="Has the building been demolished?" disabled={true}
slug="planning_demolition_complete" />
value={props.building.planning_demolition_complete} <CheckboxDataEntry
mode={props.mode} title="Has the building been demolished?"
copy={props.copy} slug="planning_demolition_complete"
onChange={props.onChange} value={props.building.planning_demolition_complete}
disabled={true} mode={props.mode}
/> copy={props.copy}
<DataEntry onChange={props.onChange}
title="Dates of construction and demolition of previous buildings on site" disabled={true}
slug="planning_demolition_history" />
value={props.building.planning_demolition_history} <DataEntry
mode={props.mode} title="Dates of construction and demolition of previous buildings on site"
copy={props.copy} slug="planning_demolition_history"
onChange={props.onChange} value={props.building.planning_demolition_history}
disabled={true} mode={props.mode}
/> copy={props.copy}
onChange={props.onChange}
disabled={true}
/>
</DataEntryGroup>
</Fragment> </Fragment>
) )
const PlanningContainer = withCopyEdit(PlanningView); const PlanningContainer = withCopyEdit(PlanningView);