This commit is contained in:
Mike Simpson 2023-05-31 21:05:02 +01:00
parent 79918c7b9f
commit 439e415c6e
13 changed files with 1175 additions and 462 deletions

View File

@ -214,6 +214,42 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true, edit: true,
verify: true, verify: true,
}, },
size_far_ratio: {
edit: true,
verify: true,
},
size_far_ratio_source_type: {
edit: true,
verify: true,
},
size_far_ratio_source_links: {
edit: true,
verify: true,
},
size_plot_area_total: {
edit: true,
verify: true,
},
size_plot_area_total_source_type: {
edit: true,
verify: true,
},
size_plot_area_total_source_links: {
edit: true,
verify: true,
},
size_parcel_geometry: {
edit: true,
verify: true,
},
size_parcel_geometry_source_type: {
edit: true,
verify: true,
},
size_parcel_geometry_source_links: {
edit: true,
verify: true,
},
construction_core_material: { construction_core_material: {
edit: true, edit: true,
verify: true, verify: true,
@ -533,6 +569,86 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
disaster_end_date : { disaster_end_date : {
edit: true, edit: true,
verify: true verify: true
},
context_front_garden : {
edit: true,
verify: true
},
context_back_garden : {
edit: true,
verify: true
},
context_flats_garden : {
edit: true,
verify: true
},
context_garden_source_type : {
edit: true,
verify: true
},
context_garden_source_links : {
edit: true,
verify: true
},
context_street_width : {
edit: true,
verify: true
},
context_street_width_source_type : {
edit: true,
verify: true
},
context_street_width_source_links : {
edit: true,
verify: true
},
context_pavement_width : {
edit: true,
verify: true
},
context_pavement_width_source_type : {
edit: true,
verify: true
},
context_pavement_width_source_links : {
edit: true,
verify: true
},
context_street_geometry : {
edit: true,
verify: true
},
context_street_geometry_source_type : {
edit: true,
verify: true
},
context_street_geometry_source_links : {
edit: true,
verify: true
},
context_green_space_distance : {
edit: true,
verify: true
},
context_green_space_distance_source_type : {
edit: true,
verify: true
},
context_green_space_distance_source_links : {
edit: true,
verify: true
},
context_tree_distance : {
edit: true,
verify: true
},
context_tree_distance_source_type : {
edit: true,
verify: true
},
ccontext_tree_distance_source_links : {
edit: true,
verify: true
} }
}); });

View File

@ -43,7 +43,7 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
<DataEntryGroup name="Community views on building types"> <DataEntryGroup name="Community views on building types">
<div className={`alert alert-dark`} role="alert" style={{ fontSize: 13, backgroundColor: "#f6f8f9" }}> <div className={`alert alert-dark`} role="alert" style={{ fontSize: 13, backgroundColor: "#f6f8f9" }}>
<i> <i>
Note: We are not currently collecting data on domestic/privately owned properties, only on public buildings. Note: We are currently only collecting data on non-residential buildings.
</i> </i>
</div> </div>
<div className='community-opinion-pane'> <div className='community-opinion-pane'>
@ -201,14 +201,7 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
slug='community_public_ownership' slug='community_public_ownership'
title={dataFields.community_public_ownership.title} title={dataFields.community_public_ownership.title}
value={props.building.community_public_ownership} value={props.building.community_public_ownership}
options={[ options={dataFields.community_public_ownership.items}
'Government-owned',
'Charity-owned',
'Community-owned/cooperative',
'Owned by other non-profit body',
'Not in public/community ownership',
]}
onChange={props.onChange} onChange={props.onChange}
mode={props.mode} mode={props.mode}
copy={props.copy} copy={props.copy}

View File

@ -25,10 +25,10 @@ const UseView: React.FunctionComponent<CategoryViewProps> = (props) => {
const { darkLightTheme } = useDisplayPreferences(); const { darkLightTheme } = useDisplayPreferences();
return ( return (
<Fragment> <Fragment>
<DataEntryGroup name="Domestic/non-domestic use data"> <DataEntryGroup name="Residential/non-residential land use data (general)">
<div className={`alert alert-dark`} role="alert" style={{ fontSize: 13, backgroundColor: "#f6f8f9" }}> <div className={`alert alert-dark`} role="alert" style={{ fontSize: 13, backgroundColor: "#f6f8f9" }}>
<i> <i>
93% of properties in UK are residential dwellings so we have set 'residential' as the default value. Can you help us identify non-residential and mixed use buildings (and verify residential buildings too)? The vast majority of properties are residential (93% in the UK), so we have set 'residential' as the default value. Can you help us identify non-residential and mixed use buildings (and verify residential buildings too)?
</i> </i>
</div> </div>
<button className={`map-switcher-inline ${props.mapColourScale == "is_domestic" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToIsDomesticMapStyle}> <button className={`map-switcher-inline ${props.mapColourScale == "is_domestic" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToIsDomesticMapStyle}>

View File

@ -13,262 +13,271 @@ import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-e
const locationNumberPattern = "[1-9]\\d*[a-z]?(-([1-9]\\d*))?"; ///[1-9]\d*[a-z]?(-([1-9]\d*))?/; const locationNumberPattern = "[1-9]\\d*[a-z]?(-([1-9]\\d*))?"; ///[1-9]\d*[a-z]?(-([1-9]\d*))?/;
const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => ( const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => {
<Fragment> const osm_url = "https://www.openstreetmap.org/way/"+props.building.ref_osm_id;
<DataEntryGroup name="Address data"> return (
<DataEntry <Fragment>
title={dataFields.location_name.title} <DataEntryGroup name="Address data">
slug="location_name" <DataEntry
value={props.building.location_name} title={dataFields.location_name.title}
mode={props.mode} slug="location_name"
copy={props.copy} value={props.building.location_name}
onChange={props.onChange} mode={props.mode}
tooltip={dataFields.location_name.tooltip} copy={props.copy}
placeholder="https://..." onChange={props.onChange}
isUrl={true} tooltip={dataFields.location_name.tooltip}
/> placeholder="https://..."
<Verification isUrl={true}
slug="location_name"
allow_verify={props.user !== undefined && props.building.location_name !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_name")}
user_verified_as={props.user_verified.location_name}
verified_count={props.building.verified.location_name}
/>
<DataEntry
title="Building name (domestic)"
slug=""
value=""
mode='view'
tooltip="Not yet activated.<br><br>For security reasons, we do not allow the use of free text boxes and are currently looking into alternative ways to collect this data."
/>
<hr/>
<PatternDataEntry
title={dataFields.location_number.title}
slug="location_number"
value={props.building.location_number}
pattern={locationNumberPattern}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_number.tooltip}
/> />
<Verification <Verification
slug="location_number" slug="location_name"
allow_verify={props.user !== undefined && props.building.location_number !== null && !props.edited} allow_verify={props.user !== undefined && props.building.location_name !== null && !props.edited}
onVerify={props.onVerify} onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_number")} user_verified={props.user_verified.hasOwnProperty("location_name")}
user_verified_as={props.user_verified.location_number} user_verified_as={props.user_verified.location_name}
verified_count={props.building.verified.location_number} verified_count={props.building.verified.location_name}
/> />
<DataEntry <DataEntry
title={dataFields.location_street.title} title="Building name (domestic)"
slug="location_street" slug=""
value={props.building.location_street} value=""
mode={props.mode} mode='view'
copy={props.copy} tooltip="Not yet activated.<br><br>For security reasons, we do not allow the use of free text boxes and are currently looking into alternative ways to collect this data."
onChange={props.onChange}
maxLength={30}
/> />
<Verification <hr/>
slug="location_street" <PatternDataEntry
allow_verify={props.user !== undefined && props.building.location_street !== null && !props.edited} title={dataFields.location_number.title}
onVerify={props.onVerify} slug="location_number"
user_verified={props.user_verified.hasOwnProperty("location_street")} value={props.building.location_number}
user_verified_as={props.user_verified.location_street} pattern={locationNumberPattern}
verified_count={props.building.verified.location_street} mode={props.mode}
/> copy={props.copy}
<DataEntry onChange={props.onChange}
title={dataFields.location_line_two.title} tooltip={dataFields.location_number.tooltip}
slug="location_line_two"
value={props.building.location_line_two}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
maxLength={30}
/>
<Verification
slug="location_line_two"
allow_verify={props.user !== undefined && props.building.location_line_two !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_line_two")}
user_verified_as={props.user_verified.location_line_two}
verified_count={props.building.verified.location_line_two}
/>
<DataEntry
title={dataFields.location_town.title}
slug="location_town"
value={props.building.location_town}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
<Verification
slug="location_town"
allow_verify={props.user !== undefined && props.building.location_town !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_town")}
user_verified_as={props.user_verified.location_town}
verified_count={props.building.verified.location_town}
/>
<DataEntry
title={dataFields.location_postcode.title}
slug="location_postcode"
value={props.building.location_postcode}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
maxLength={8}
valueTransform={x=>x.toUpperCase()}
/>
<Verification
slug="location_postcode"
allow_verify={props.user !== undefined && props.building.location_postcode !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_postcode")}
user_verified_as={props.user_verified.location_postcode}
verified_count={props.building.verified.location_postcode}
/>
<SelectDataEntry
title={dataFields.location_address_source.title}
slug="location_address_source"
value={props.building.location_address_source}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_address_source.tooltip}
placeholder={dataFields.location_address_source.example}
options={dataFields.location_address_source.items}
/>
{(props.building.location_address_source == commonSourceTypes[0] ||
props.building.location_address_source == commonSourceTypes[1] ||
props.building.location_address_source == null) ? <></> :
<>
<MultiDataEntry
title={dataFields.location_address_links.title}
slug="location_address_links"
value={props.building.location_address_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_address_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/> />
</> <Verification
} slug="location_number"
</DataEntryGroup> allow_verify={props.user !== undefined && props.building.location_number !== null && !props.edited}
<DataEntryGroup name="Property/footprint IDs and coordinate data"> onVerify={props.onVerify}
<DataEntry user_verified={props.user_verified.hasOwnProperty("location_number")}
title={dataFields.ref_toid.title} user_verified_as={props.user_verified.location_number}
slug="ref_toid" verified_count={props.building.verified.location_number}
value={props.building.ref_toid}
mode={props.mode}
copy={props.copy}
tooltip={dataFields.ref_toid.tooltip}
onChange={props.onChange}
disabled={true}
/>
<UPRNsDataEntry
title={dataFields.uprns.title}
slug="ref_uprns"
value={props.building.uprns}
tooltip={dataFields.uprns.tooltip}
/>
<DataEntry
title={dataFields.ref_osm_id.title}
slug="ref_osm_id"
value={props.building.ref_osm_id}
mode={props.mode}
copy={props.copy}
tooltip={dataFields.ref_osm_id.tooltip}
maxLength={20}
onChange={props.onChange}
/>
<Verification
slug="ref_osm_id"
allow_verify={props.user !== undefined && props.building.ref_osm_id !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("ref_osm_id")}
user_verified_as={props.user_verified.ref_osm_id}
verified_count={props.building.verified.ref_osm_id}
/>
<hr/>
<NumericDataEntry
title={dataFields.location_latitude.title}
slug="location_latitude"
value={props.building.location_latitude}
tooltip={dataFields.location_latitude.tooltip}
mode={props.mode}
copy={props.copy}
step={0.00001}
min={-90}
max={90}
placeholder="Latitude, e.g. 51.5467"
onChange={props.onChange}
/>
<Verification
slug="location_latitude"
allow_verify={props.user !== undefined && props.building.location_latitude !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_latitude")}
user_verified_as={props.user_verified.location_latitude}
verified_count={props.building.verified.location_latitude}
/>
<NumericDataEntry
title={dataFields.location_longitude.title}
slug="location_longitude"
value={props.building.location_longitude}
tooltip={dataFields.location_latitude.tooltip}
mode={props.mode}
copy={props.copy}
step={0.00001}
min={-180}
max={180}
placeholder="Longitude, e.g. -0.0586"
onChange={props.onChange}
/>
<Verification
slug="location_longitude"
allow_verify={props.user !== undefined && props.building.location_longitude !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_longitude")}
user_verified_as={props.user_verified.location_longitude}
verified_count={props.building.verified.location_longitude}
/>
<SelectDataEntry
title={dataFields.location_coordinates_source.title}
slug="location_coordinates_source"
value={props.building.location_coordinates_source}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_coordinates_source.tooltip}
placeholder={dataFields.location_coordinates_source.example}
options={dataFields.location_coordinates_source.items}
/>
{(props.building.location_coordinates_source == commonSourceTypes[0] ||
props.building.location_coordinates_source == commonSourceTypes[1] ||
props.building.location_coordinates_source == null) ? <></> :
<>
<MultiDataEntry
title={dataFields.location_coordinates_links.title}
slug="location_coordinates_links"
value={props.building.location_coordinates_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_coordinates_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/> />
</> <DataEntry
} title={dataFields.location_street.title}
</DataEntryGroup> slug="location_street"
</Fragment> value={props.building.location_street}
); mode={props.mode}
copy={props.copy}
onChange={props.onChange}
maxLength={30}
/>
<Verification
slug="location_street"
allow_verify={props.user !== undefined && props.building.location_street !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_street")}
user_verified_as={props.user_verified.location_street}
verified_count={props.building.verified.location_street}
/>
<DataEntry
title={dataFields.location_line_two.title}
slug="location_line_two"
value={props.building.location_line_two}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
maxLength={30}
/>
<Verification
slug="location_line_two"
allow_verify={props.user !== undefined && props.building.location_line_two !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_line_two")}
user_verified_as={props.user_verified.location_line_two}
verified_count={props.building.verified.location_line_two}
/>
<DataEntry
title={dataFields.location_town.title}
slug="location_town"
value={props.building.location_town}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
<Verification
slug="location_town"
allow_verify={props.user !== undefined && props.building.location_town !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_town")}
user_verified_as={props.user_verified.location_town}
verified_count={props.building.verified.location_town}
/>
<DataEntry
title={dataFields.location_postcode.title}
slug="location_postcode"
value={props.building.location_postcode}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
maxLength={8}
valueTransform={x=>x.toUpperCase()}
/>
<Verification
slug="location_postcode"
allow_verify={props.user !== undefined && props.building.location_postcode !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_postcode")}
user_verified_as={props.user_verified.location_postcode}
verified_count={props.building.verified.location_postcode}
/>
<SelectDataEntry
title={dataFields.location_address_source.title}
slug="location_address_source"
value={props.building.location_address_source}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_address_source.tooltip}
placeholder={dataFields.location_address_source.example}
options={dataFields.location_address_source.items}
/>
{(props.building.location_address_source == commonSourceTypes[0] ||
props.building.location_address_source == commonSourceTypes[1] ||
props.building.location_address_source == null) ? <></> :
<>
<MultiDataEntry
title={dataFields.location_address_links.title}
slug="location_address_links"
value={props.building.location_address_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_address_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
<DataEntryGroup name="Property/footprint IDs and coordinate data">
<DataEntry
title={dataFields.ref_toid.title}
slug="ref_toid"
value={props.building.ref_toid}
mode={props.mode}
copy={props.copy}
tooltip={dataFields.ref_toid.tooltip}
onChange={props.onChange}
disabled={true}
/>
<UPRNsDataEntry
title={dataFields.uprns.title}
slug="ref_uprns"
value={props.building.uprns}
tooltip={dataFields.uprns.tooltip}
/>
<DataEntry
title={dataFields.ref_osm_id.title}
slug="ref_osm_id"
value={props.building.ref_osm_id}
mode={props.mode}
copy={props.copy}
tooltip={dataFields.ref_osm_id.tooltip}
maxLength={20}
onChange={props.onChange}
/>
{
(props.building.ref_osm_id == null) ? <></> :
<div className={`alert alert-dark`} role="alert" style={{ fontSize: 14, backgroundColor: "#f6f8f9" }}>
<i className="source-url">Source: <a href={osm_url} target={"_blank"}>{osm_url}</a></i>
</div>
}
<Verification
slug="ref_osm_id"
allow_verify={props.user !== undefined && props.building.ref_osm_id !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("ref_osm_id")}
user_verified_as={props.user_verified.ref_osm_id}
verified_count={props.building.verified.ref_osm_id}
/>
<hr/>
<NumericDataEntry
title={dataFields.location_latitude.title}
slug="location_latitude"
value={props.building.location_latitude}
tooltip={dataFields.location_latitude.tooltip}
mode={props.mode}
copy={props.copy}
step={0.00001}
min={-90}
max={90}
placeholder="Latitude, e.g. 51.5467"
onChange={props.onChange}
/>
<Verification
slug="location_latitude"
allow_verify={props.user !== undefined && props.building.location_latitude !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_latitude")}
user_verified_as={props.user_verified.location_latitude}
verified_count={props.building.verified.location_latitude}
/>
<NumericDataEntry
title={dataFields.location_longitude.title}
slug="location_longitude"
value={props.building.location_longitude}
tooltip={dataFields.location_latitude.tooltip}
mode={props.mode}
copy={props.copy}
step={0.00001}
min={-180}
max={180}
placeholder="Longitude, e.g. -0.0586"
onChange={props.onChange}
/>
<Verification
slug="location_longitude"
allow_verify={props.user !== undefined && props.building.location_longitude !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("location_longitude")}
user_verified_as={props.user_verified.location_longitude}
verified_count={props.building.verified.location_longitude}
/>
<SelectDataEntry
title={dataFields.location_coordinates_source.title}
slug="location_coordinates_source"
value={props.building.location_coordinates_source}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_coordinates_source.tooltip}
placeholder={dataFields.location_coordinates_source.example}
options={dataFields.location_coordinates_source.items}
/>
{(props.building.location_coordinates_source == commonSourceTypes[0] ||
props.building.location_coordinates_source == commonSourceTypes[1] ||
props.building.location_coordinates_source == null) ? <></> :
<>
<MultiDataEntry
title={dataFields.location_coordinates_links.title}
slug="location_coordinates_links"
value={props.building.location_coordinates_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_coordinates_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
</Fragment>
);
}
const LocationContainer = withCopyEdit(LocationView); const LocationContainer = withCopyEdit(LocationView);
export default LocationContainer; export default LocationContainer;

View File

@ -23,20 +23,14 @@ const ResilienceView: React.FunctionComponent<CategoryViewProps> = (props) => {
const [ endDate, setEndDate ] = useState(null); const [ endDate, setEndDate ] = useState(null);
return (<> return (<>
<DataEntryGroup name="Building damage assessment tool" collapsed={true} > <DataEntryGroup name="Building damage assessment tool" collapsed={true}>
<InfoBox type='warning'>
This section is under development.
</InfoBox>
<div className={`alert alert-dark`} role="alert" style={{ fontSize: 13, backgroundColor: "#f6f8f9" }}> <div className={`alert alert-dark`} role="alert" style={{ fontSize: 13, backgroundColor: "#f6f8f9" }}>
<i> <i>
This feature is designed as an assessment tool to help communities capture data on the state of buildings following major disasters. This feature is designed as an assessment tool to help communities capture data on the state of buildings following major disasters.
It is intended to help support emergency services, to record damage, and to aid reconstruction programmes. It is intended to help support emergency services, to record damage, and to aid reconstruction programmes.
</i> </i>
</div> </div>
<button className={`map-switcher-inline ${historicData}-state btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={historicDataSwitchOnClick}> <label>Date of disaster</label>
{(historicData === 'enabled')?'Click here to hide disaster maps':'Click here to show disaster maps'}
</button>
<p>Date of disaster</p>
<div> <div>
<DatePicker <DatePicker
showIcon showIcon
@ -65,37 +59,37 @@ const ResilienceView: React.FunctionComponent<CategoryViewProps> = (props) => {
maxDate={new Date()} maxDate={new Date()}
/> />
</div> </div>
<Verification
slug="disaster_end_date"
allow_verify={props.user !== undefined && props.building.disaster_end_date !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("disaster_end_date")}
user_verified_as={props.user_verified.disaster_end_date}
verified_count={props.building.verified.disaster_end_date}
/>
<SelectDataEntry <SelectDataEntry
slug='disaster_type' slug='disaster_type'
title={dataFields.disaster_type.title} title={dataFields.disaster_type.title}
value={props.building.disaster_type} value={props.building.disaster_type}
options={[ options={dataFields.disaster_type.items}
'Flood',
'Earthquake',
'Hurricane',
'Fire',
'Extreme heat',
'Political/war damage',
'Other human (blast damage/spills etc.)',
'Other'
]}
tooltip={dataFields.disaster_type.tooltip} tooltip={dataFields.disaster_type.tooltip}
onChange={props.onChange} onChange={props.onChange}
mode={props.mode} mode={props.mode}
copy={props.copy} copy={props.copy}
/> />
<Verification
slug="disaster_type"
allow_verify={props.user !== undefined && props.building.disaster_type !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("disaster_type")}
user_verified_as={props.user_verified.disaster_type}
verified_count={props.building.verified.disaster_type}
/>
<SelectDataEntry <SelectDataEntry
slug='disaster_severity' slug='disaster_severity'
title={dataFields.disaster_severity.title} title={dataFields.disaster_severity.title}
value={props.building.disaster_severity} value={props.building.disaster_severity}
options={[ options={dataFields.disaster_severity.items}
'Building destroyed',
'Very severe',
'Severe',
'Moderate',
'Minimal',
'No damage visible',
]}
tooltip={dataFields.disaster_severity.tooltip} tooltip={dataFields.disaster_severity.tooltip}
onChange={props.onChange} onChange={props.onChange}
mode={props.mode} mode={props.mode}
@ -113,37 +107,30 @@ const ResilienceView: React.FunctionComponent<CategoryViewProps> = (props) => {
slug='disaster_assessment_method' slug='disaster_assessment_method'
title={dataFields.disaster_assessment_method.title} title={dataFields.disaster_assessment_method.title}
value={props.building.disaster_assessment_method} value={props.building.disaster_assessment_method}
options={[ options={dataFields.disaster_assessment_method.items}
'Citizen/Passerby by eye',
'Government assessor',
'Specialist emergency group/charity',
'Other',
]}
tooltip={dataFields.disaster_assessment_method.tooltip} tooltip={dataFields.disaster_assessment_method.tooltip}
onChange={props.onChange} onChange={props.onChange}
mode={props.mode} mode={props.mode}
copy={props.copy} copy={props.copy}
/> />
<Verification {(props.building.disaster_assessment_method == dataFields.disaster_assessment_method.items[0] ||
slug="disaster_assessment_method" props.building.disaster_assessment_method == dataFields.disaster_assessment_method.items[1] ||
allow_verify={props.user !== undefined && props.building.disaster_assessment_method !== null && !props.edited} props.building.disaster_assessment_method == null) ? <></> :
onVerify={props.onVerify} <>
user_verified={props.user_verified.hasOwnProperty("disaster_assessment_method")} <MultiDataEntry
user_verified_as={props.user_verified.disaster_assessment_method} title={dataFields.disaster_source_link.title}
verified_count={props.building.verified.disaster_assessment_method} slug="disaster_source_link"
/> value={props.building.disaster_source_link}
<MultiDataEntry mode={props.mode}
title={dataFields.disaster_source_link.title} copy={props.copy}
slug="disaster_source_link" onChange={props.onChange}
value={props.building.disaster_source_link} tooltip={dataFields.disaster_source_link.tooltip}
mode={props.mode} placeholder="https://..."
copy={props.copy} editableEntries={true}
onChange={props.onChange} isUrl={true}
tooltip={dataFields.disaster_source_link.tooltip} />
placeholder="https://..." </>
editableEntries={true} }
isUrl={true}
/>
</DataEntryGroup> </DataEntryGroup>
<DataEntryGroup name="Resilience indicators and risk assessment" collapsed={true} > <DataEntryGroup name="Resilience indicators and risk assessment" collapsed={true} >
<InfoBox type='warning'> <InfoBox type='warning'>

View File

@ -262,93 +262,6 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
} }
</DataEntryGroup> </DataEntryGroup>
<DataEntryGroup name="Plot size data"> <DataEntryGroup name="Plot size data">
<NumericDataEntry
title={dataFields.size_plot_area_total.title}
slug="size_plot_area_total"
mode='view'
step={0.1}
min={0}
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<hr/>
<NumericDataEntry
title={dataFields.size_far_ratio.title}
slug="size_far_ratio"
mode='view'
step={0.1}
min={0}
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<hr/>
<DataEntry
title="Plot dimensions"
slug=""
value=""
mode='view'
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<hr/>
<DataEntry
title="Land parcel geometry link"
slug=""
value=""
mode='view'
tooltip='INSPIRE Polygons'
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
/>
<hr/>
<NumericDataEntry <NumericDataEntry
title={dataFields.size_width_frontage.title} title={dataFields.size_width_frontage.title}
slug="size_width_frontage" slug="size_width_frontage"
@ -394,6 +307,146 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
/> />
</> </>
} }
<hr/>
<NumericDataEntry
title={dataFields.size_plot_area_total.title}
slug="size_plot_area_total"
tooltip={dataFields.size_plot_area_total.tooltip}
value={props.building.size_plot_area_total}
mode={props.mode}
onChange={props.onChange}
step={0.1}
min={0}
/>
<Verification
slug="size_plot_area_total"
allow_verify={props.user !== undefined && props.building.size_plot_area_total !== null}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("size_plot_area_total")}
user_verified_as={props.user_verified.size_plot_area_total}
verified_count={props.building.verified.size_plot_area_total}
/>
<SelectDataEntry
title={dataFields.size_plot_area_total_source_type.title}
slug="size_plot_area_total_source_type"
value={props.building.size_plot_area_total_source_type}
options={dataFields.size_plot_area_total_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_plot_area_total_source_type.tooltip}
/>
{(props.building.size_plot_area_total_source_type == commonSourceTypes[0] ||
props.building.size_plot_area_total_source_type == commonSourceTypes[1] ||
props.building.size_far_ratio_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_plot_area_total_source_links.title}
slug="size_plot_area_total_source_links"
value={props.building.size_plot_area_total_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_plot_area_total_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
<hr/>
<NumericDataEntry
title={dataFields.size_far_ratio.title}
value={props.building.size_far_ratio}
slug="size_far_ratio"
tooltip={dataFields.size_far_ratio.tooltip}
//placeholder={dataFields.size_far_ratio.example}
mode={props.mode}
onChange={props.onChange}
step={1}
min={0}
/>
<Verification
slug="size_far_ratio"
allow_verify={props.user !== undefined && props.building.size_far_ratio !== null}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("size_far_ratio")}
user_verified_as={props.user_verified.size_far_ratio}
verified_count={props.building.verified.size_far_ratio}
/>
<SelectDataEntry
title={dataFields.size_far_ratio_source_type.title}
slug="size_far_ratio_source_type"
value={props.building.size_far_ratio_source_type}
options={dataFields.size_far_ratio_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_far_ratio_source_type.tooltip}
/>
{(props.building.size_far_ratio_source_type == commonSourceTypes[0] ||
props.building.size_far_ratio_source_type == commonSourceTypes[1] ||
props.building.size_far_ratio_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_far_ratio_source_links.title}
slug="size_far_ratio_source_links"
value={props.building.size_far_ratio_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_far_ratio_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
<hr/>
<DataEntry
title={dataFields.size_parcel_geometry.title}
slug="size_parcel_geometry"
value={props.building.size_parcel_geometry}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_parcel_geometry.tooltip}
placeholder="https://..."
isUrl={true}
/>
<Verification
slug="size_parcel_geometry"
allow_verify={props.user !== undefined && props.building.size_parcel_geometry !== null}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("size_parcel_geometry")}
user_verified_as={props.user_verified.size_parcel_geometry}
verified_count={props.building.verified.size_parcel_geometry}
/>
<SelectDataEntry
title={dataFields.size_parcel_geometry_source_type.title}
slug="size_parcel_geometry_source_type"
value={props.building.size_parcel_geometry_source_type}
options={dataFields.size_parcel_geometry_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_parcel_geometry_source_type.tooltip}
/>
{(props.building.size_parcel_geometry_source_type == commonSourceTypes[0] ||
props.building.size_parcel_geometry_source_type == commonSourceTypes[1] ||
props.building.size_parcel_geometry_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_parcel_geometry_source_links.title}
slug="size_parcel_geometry_source_links"
value={props.building.size_parcel_geometry_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_parcel_geometry_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup> </DataEntryGroup>
</Fragment> </Fragment>
); );

View File

@ -1,6 +1,6 @@
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import InfoBox from '../../components/info-box'; import InfoBox from '../../components/info-box';
import { dataFields } from '../../config/data-fields-config'; import { commonSourceTypes, dataFields } from '../../config/data-fields-config';
import DataEntry from '../data-components/data-entry'; import DataEntry from '../data-components/data-entry';
import NumericDataEntry from '../data-components/numeric-data-entry'; import NumericDataEntry from '../data-components/numeric-data-entry';
@ -8,59 +8,339 @@ import withCopyEdit from '../data-container';
import { CategoryViewProps } from './category-view-props'; import { CategoryViewProps } from './category-view-props';
import { DataEntryGroup } from '../data-components/data-entry-group'; import { DataEntryGroup } from '../data-components/data-entry-group';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
import SelectDataEntry from '../data-components/select-data-entry';
import Verification from '../data-components/verification';
/** /**
* Streetscape view/edit section * Streetscape view/edit section
*/ */
const StreetscapeView: React.FunctionComponent<CategoryViewProps> = (props) => ( const StreetscapeView: React.FunctionComponent<CategoryViewProps> = (props) => (
<Fragment> <Fragment>
<DataEntryGroup name="Does the building have a garden(s)?"> <DataEntryGroup name="Does the building have a garden?">
<DataEntry <SelectDataEntry
title="Does the building have a front garden?" title={dataFields.context_front_garden.title}
slug="" slug="context_front_garden"
value="" value={props.building.context_front_garden}
mode='view' options={dataFields.context_front_garden.items}
/> mode={props.mode}
<DataEntry copy={props.copy}
title="Does the building have a back garden?" onChange={props.onChange}
slug="" tooltip={dataFields.context_front_garden.tooltip}
value="" />
mode='view' <Verification
/> slug="context_front_garden"
allow_verify={props.user !== undefined && props.building.context_front_garden !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("context_front_garden")}
user_verified_as={props.user_verified.context_front_garden}
verified_count={props.building.verified.context_front_garden}
/>
<SelectDataEntry
title={dataFields.context_back_garden.title}
slug="context_back_garden"
value={props.building.context_back_garden}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_back_garden.tooltip}
//placeholder={dataFields.context_back_garden.example}
options={dataFields.context_back_garden.items}
/>
<Verification
slug="context_back_garden"
allow_verify={props.user !== undefined && props.building.context_back_garden !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("context_back_garden")}
user_verified_as={props.user_verified.context_back_garden}
verified_count={props.building.verified.context_back_garden}
/>
<SelectDataEntry
title={dataFields.context_flats_garden.title}
slug="context_flats_garden"
value={props.building.context_flats_garden}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_flats_garden.tooltip}
//placeholder={dataFields.context_flats_garden.example}
options={dataFields.context_flats_garden.items}
/>
<Verification
slug="context_flats_garden"
allow_verify={props.user !== undefined && props.building.context_flats_garden !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("context_flats_garden")}
user_verified_as={props.user_verified.context_flats_garden}
verified_count={props.building.verified.context_flats_garden}
/>
<hr/>
<SelectDataEntry
title={dataFields.context_garden_source_type.title}
slug="context_garden_source_type"
value={props.building.context_garden_source_type}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_garden_source_type.tooltip}
placeholder={dataFields.context_garden_source_type.example}
options={dataFields.context_garden_source_type.items}
/>
{(props.building.context_garden_source_type == commonSourceTypes[0] ||
props.building.context_garden_source_type == commonSourceTypes[1] ||
props.building.context_garden_source_type == null) ? <></> :
<>
<MultiDataEntry
title={dataFields.context_garden_source_links.title}
slug="context_garden_source_links"
value={props.building.context_garden_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_garden_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup> </DataEntryGroup>
<DataEntryGroup name="Street/pavement properties"> <DataEntryGroup name="Street/pavement properties">
<DataEntry <NumericDataEntry
title="Street width" title={dataFields.context_street_width.title}
slug="" value={props.building.context_street_width}
value="" slug="context_street_width"
mode='view' tooltip={dataFields.context_street_width.tooltip}
//placeholder={dataFields.context_street_width.example}
mode={props.mode}
onChange={props.onChange}
step={1}
min={0}
/> />
<DataEntry <Verification
title="Pavement width" slug="context_street_width"
slug="" allow_verify={props.user !== undefined && props.building.context_street_width !== null}
value="" onVerify={props.onVerify}
mode='view' user_verified={props.user_verified.hasOwnProperty("context_street_width")}
user_verified_as={props.user_verified.context_street_width}
verified_count={props.building.verified.context_street_width}
/>
<SelectDataEntry
title={dataFields.context_street_width_source_type.title}
slug="context_street_width_source_type"
value={props.building.context_street_width_source_type}
options={dataFields.context_street_width_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_street_width_source_type.tooltip}
/> />
<DataEntry {(props.building.context_street_width_source_type == commonSourceTypes[0] ||
title="Street network geometry link" props.building.context_street_width_source_type == commonSourceTypes[1] ||
slug="" props.building.context_street_width_source_type == null) ? <></> :
value="" <><MultiDataEntry
mode='view' title={dataFields.context_street_width_source_links.title}
slug="context_street_width_source_links"
value={props.building.context_street_width_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_street_width_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
<hr/>
<NumericDataEntry
title={dataFields.context_pavement_width.title}
value={props.building.context_pavement_width}
slug="context_pavement_width"
tooltip={dataFields.context_pavement_width.tooltip}
//placeholder={dataFields.context_pavement_width.example}
mode={props.mode}
onChange={props.onChange}
step={1}
min={0}
/> />
<Verification
slug="context_pavement_width"
allow_verify={props.user !== undefined && props.building.context_pavement_width !== null}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("context_pavement_width")}
user_verified_as={props.user_verified.context_pavement_width}
verified_count={props.building.verified.context_pavement_width}
/>
<SelectDataEntry
title={dataFields.context_pavement_width_source_type.title}
slug="context_pavement_width_source_type"
value={props.building.context_pavement_width_source_type}
options={dataFields.context_pavement_width_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_pavement_width_source_type.tooltip}
/>
{(props.building.context_pavement_width_source_type == commonSourceTypes[0] ||
props.building.context_pavement_width_source_type == commonSourceTypes[1] ||
props.building.context_pavement_width_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.context_pavement_width_source_links.title}
slug="context_pavement_width_source_links"
value={props.building.context_pavement_width_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_pavement_width_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
<hr/>
<DataEntry
title={dataFields.context_street_geometry.title}
slug="context_street_geometry"
value={props.building.context_street_geometry}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_street_geometry.tooltip}
placeholder="https://..."
isUrl={true}
/>
<Verification
slug="context_street_geometry"
allow_verify={props.user !== undefined && props.building.context_street_geometry !== null}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("context_street_geometry")}
user_verified_as={props.user_verified.context_street_geometry}
verified_count={props.building.verified.context_street_geometry}
/>
<SelectDataEntry
title={dataFields.context_street_geometry_source_type.title}
slug="context_street_geometry_source_type"
value={props.building.context_street_geometry_source_type}
options={dataFields.context_street_geometry_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_street_geometry_source_type.tooltip}
/>
{(props.building.context_street_geometry_source_type == commonSourceTypes[0] ||
props.building.context_street_geometry_source_type == commonSourceTypes[1] ||
props.building.context_street_geometry_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.context_street_geometry_source_links.title}
slug="context_street_geometry_source_links"
value={props.building.context_street_geometry_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_street_geometry_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup> </DataEntryGroup>
<DataEntryGroup name="Access to green space"> <DataEntryGroup name="Access to green space">
<DataEntry <NumericDataEntry
title="Distance from public green space" title={dataFields.context_green_space_distance.title}
slug="" value={props.building.context_green_space_distance}
value="" slug="context_green_space_distance"
mode='view' tooltip={dataFields.context_green_space_distance.tooltip}
//placeholder={dataFields.context_green_space_distance.example}
mode={props.mode}
onChange={props.onChange}
step={1}
min={0}
/> />
<DataEntry <Verification
title="Distance from front door to nearest tree" slug="context_green_space_distance"
slug="" allow_verify={props.user !== undefined && props.building.context_green_space_distance !== null}
value="" onVerify={props.onVerify}
mode='view' user_verified={props.user_verified.hasOwnProperty("context_green_space_distance")}
user_verified_as={props.user_verified.context_green_space_distance}
verified_count={props.building.verified.context_green_space_distance}
/>
<SelectDataEntry
title={dataFields.context_green_space_distance_source_type.title}
slug="context_green_space_distance_source_type"
value={props.building.context_green_space_distance_source_type}
options={dataFields.context_green_space_distance_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_green_space_distance_source_type.tooltip}
/> />
{(props.building.context_green_space_distance_source_type == commonSourceTypes[0] ||
props.building.context_green_space_distance_source_type == commonSourceTypes[1] ||
props.building.context_green_space_distance_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.context_green_space_distance_source_links.title}
slug="context_green_space_distance_source_links"
value={props.building.context_green_space_distance_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_green_space_distance_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
<hr/>
<NumericDataEntry
title={dataFields.context_tree_distance.title}
value={props.building.context_tree_distance}
slug="context_tree_distance"
tooltip={dataFields.context_tree_distance.tooltip}
//placeholder={dataFields.context_tree_distance.example}
mode={props.mode}
onChange={props.onChange}
step={1}
min={0}
/>
<Verification
slug="context_tree_distance"
allow_verify={props.user !== undefined && props.building.context_tree_distance !== null}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("context_tree_distance")}
user_verified_as={props.user_verified.context_tree_distance}
verified_count={props.building.verified.context_tree_distance}
/>
<SelectDataEntry
title={dataFields.context_tree_distance_source_type.title}
slug="context_tree_distance_source_type"
value={props.building.context_tree_distance_source_type}
options={dataFields.context_tree_distance_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_tree_distance_source_type.tooltip}
/>
{(props.building.context_tree_distance_source_type == commonSourceTypes[0] ||
props.building.context_tree_distance_source_type == commonSourceTypes[1] ||
props.building.context_tree_distance_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.context_tree_distance_source_links.title}
slug="context_tree_distance_source_links"
value={props.building.context_tree_distance_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.context_tree_distance_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup> </DataEntryGroup>
</Fragment> </Fragment>
); );

View File

@ -21,7 +21,7 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
const currentBuildingConstructionYear = building.date_year || undefined; const currentBuildingConstructionYear = building.date_year || undefined;
return ( return (
<form> <form>
<DataEntryGroup name="Dates of construction/extension"> <DataEntryGroup name="Dates of construction and extension(s)">
<NumericDataEntry <NumericDataEntry
slug='date_year' slug='date_year'
title={dataFields.date_year.title} title={dataFields.date_year.title}

View File

@ -179,3 +179,8 @@
.data-entry-list-button { .data-entry-list-button {
width: 2.5em; width: 2.5em;
} }
.source-url {
padding-top: 0px;
padding-bottom: 5px;
}

View File

@ -107,7 +107,6 @@ export const categoriesConfig: {[key in Category]: CategoryDefinition} = {
intro: 'How are buildings used, and how does use change over time?', intro: 'How are buildings used, and how does use change over time?',
}, },
[Category.StreetContext]: { [Category.StreetContext]: {
inactive: true,
slug: 'street-context', slug: 'street-context',
name: 'Street Context', name: 'Street Context',
aboutUrl: 'https://pages.colouring.london/greenery', aboutUrl: 'https://pages.colouring.london/greenery',

View File

@ -6,12 +6,15 @@ let ccconfig: CCConfig = require('../../cc-config.json')
* Common list of Source Types, used in multiple menus * Common list of Source Types, used in multiple menus
*/ */
export const commonSourceTypes = [ export const commonSourceTypes = [
"Expert knowledge", "Assessed by eye",
"Observed from the street", "Assessed using expert knowledge of building or building type",
"Google or other photograph/satellite imagery", "Assessed using streetview photographs or satellite imagery",
"Government/public record/database", "Assessed by specialist emergency group",
"Independently managed record/database", "Live streamed from a government source",
"Other type of record/database" "Current government record/dataset",
"Independently managed public database",
"Commercial database",
"Inferred computationally using existing open attribute data",
]; ];
/** /**
@ -142,7 +145,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
location_name: { location_name: {
category: Category.Location, category: Category.Location,
title: "Building name (non-domestic)", title: "Building name (non-domestic)",
tooltip: "Link to a website with the name of the building.<br/><br/>(For security reasons, we currently only collect the names of well-known public buildings.)", tooltip: "Link to a website with the name of the building.<br/><br/>(For security reasons, we currently only collect the names of non-residential buildings).",
example: "https://en.wikipedia.org/wiki/Palace_of_Westminster", example: "https://en.wikipedia.org/wiki/Palace_of_Westminster",
}, },
location_number: { location_number: {
@ -165,13 +168,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
}, },
location_town: { location_town: {
category: Category.Location, category: Category.Location,
title: "Town/city", title: "Town/City",
example: "London", example: "London",
//tooltip: , //tooltip: ,
}, },
location_postcode: { location_postcode: {
category: Category.Location, category: Category.Location,
title: ccconfig.postcode, title: "Area code/"+ccconfig.postcode,
example: "W1W 6TR", example: "W1W 6TR",
//tooltip: , //tooltip: ,
}, },
@ -503,13 +506,58 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
category: Category.StreetContext, category: Category.StreetContext,
title: "Total area of plot (m²)", title: "Total area of plot (m²)",
example: 123.02, example: 123.02,
//tooltip: , tooltip: "Total area of plot (m²)",
},
size_plot_area_total_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of plot area data",
example: "",
items: commonSourceTypes
},
size_plot_area_total_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for plot area data source(s)",
example: ["", "", ""],
}, },
size_far_ratio: { size_far_ratio: {
category: Category.StreetContext, category: Category.StreetContext,
title: "FAR ratio (percentage of plot covered by building)", title: "FAR ratio (percentage of plot covered by building)",
example: 0.1, example: 1.0,
//tooltip: , tooltip: "boobs",
},
size_far_ratio_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of FAR ratio data",
example: "",
items: commonSourceTypes
},
size_far_ratio_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for FAR ratio data source(s)",
example: ["", "", ""],
},
size_parcel_geometry: {
category: Category.StreetContext,
title: "Land parcel geometry link",
example: "https://",
tooltip: "INSPIRE Polygons",
},
size_parcel_geometry_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of parcel geometry data",
example: "",
items: commonSourceTypes
},
size_parcel_geometry_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for parcel geometry data source(s)",
example: ["", "", ""],
}, },
construction_core_material: { construction_core_material: {
@ -784,13 +832,20 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
// title: "When was this building used for community activities?" // title: "When was this building used for community activities?"
// }, // },
community_public_ownership: { community_public_ownership: {
category: Category.Community, category: Category.Community,
title: "Is the building in public/community ownership?", title: "Is the building in public/community ownership?",
example: "Not in public/community ownership" example: "Privately owned (non-corporate)",
items: [
'State-owned',
'Charity-owned',
'Community-owned',
'Owned by other non-profit body',
'Privately owned (non-corporate)',
'Privately owned (corporate)',
'Other'
]
}, },
community_public_ownership_sources: { community_public_ownership_sources: {
category: Category.Community, category: Category.Community,
title: "Community ownership source link", title: "Community ownership source link",
@ -991,19 +1046,38 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
category: Category.Resilience, category: Category.Resilience,
title: "Disaster type", title: "Disaster type",
tooltip: "What type of disaster management do you wish to collect data for?", tooltip: "What type of disaster management do you wish to collect data for?",
example: "Flood" example: "Flood",
items: [
'Flood',
'Earthquake',
'Hurricane',
'Fire',
'Extreme heat',
'Political/war damage',
'Other human (blast damage/spills etc.)',
'Other'
]
}, },
disaster_severity: { disaster_severity: {
category: Category.Resilience, category: Category.Resilience,
title: "How severe do you assess the damage to be?", title: "How severe do you assess the damage to be?",
tooltip: "Best estimate for the severity of damage to the building", tooltip: "Best estimate for the severity of damage to the building",
example: "Building destroyed" example: "Building destroyed",
items: [
'Building destroyed',
'Very severe',
'Severe',
'Moderate',
'Minimal',
'No damage visible',
]
}, },
disaster_assessment_method: { disaster_assessment_method: {
category: Category.Resilience, category: Category.Resilience,
title: "Method of assessment", title: "Source Type",
tooltip: "Please add a Best estimate for the severity of damage to the building", tooltip: "Please add a Best estimate for the severity of damage to the building",
example: "Citizen/Passerby by eye" example: "Citizen/Passerby by eye",
items: commonSourceTypes
}, },
disaster_source_link: { disaster_source_link: {
category: Category.Resilience, category: Category.Resilience,
@ -1021,6 +1095,145 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
title: "What was the end date of the disaster? (if applicable)", title: "What was the end date of the disaster? (if applicable)",
example: "03/04/2023" example: "03/04/2023"
}, },
context_front_garden: {
category: Category.StreetContext,
title: "Does the building have a front garden?",
tooltip: "Is the front garden mainly green/planted?",
example: "",
items: [
"Yes",
"No"
]
},
context_back_garden: {
category: Category.StreetContext,
title: "Does the building have a back garden?",
tooltip: "Is the back garden mainly green/planted?",
example: "",
items: [
"Yes",
"No"
]
},
context_flats_garden: {
category: Category.StreetContext,
title: "Is the building flats with a dedicated green space?",
tooltip: "If the building is a block of flats, does it have a dedicated garden area/green space?",
example: "",
items: [
"Yes",
"No"
]
},
context_garden_source_type: {
category: Category.StreetContext,
title: "Source type",
tooltip: "Source type for garden data",
example: "",
items: commonSourceTypes
},
context_garden_source_links: {
category: Category.StreetContext,
title: "Source link(s)",
tooltip: "Source link(s) for garden data source(s)",
example: ["", "", ""],
},
context_street_width: {
category: Category.Team,
title: "Street width (m)",
tooltip: "Width of the street in metres.",
example: 10
},
context_street_width_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source type for street width data",
example: "",
items: commonSourceTypes
},
context_street_width_source_links: {
category: Category.Team,
title: "Source link(s)",
tooltip: "Source link(s) for street width data",
example: ["", "", ""],
},
context_pavement_width: {
category: Category.Team,
title: "Pavement width (m)",
tooltip: "Width of the pavement in metres.",
example: 10
},
context_pavement_width_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source type for pavement width data",
example: "",
items: commonSourceTypes
},
context_pavement_width_source_links: {
category: Category.Team,
title: "Source link(s)",
tooltip: "Source link(s) for pavement width data",
example: ["", "", ""],
},
context_green_space_distance: {
category: Category.Team,
title: "Distance to nearest green space (m)",
tooltip: "Approximate distance from the front door of the building to the nearest public green space.",
example: 10
},
context_green_space_distance_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source type for green space data",
example: "",
items: commonSourceTypes
},
context_green_space_distance_source_links: {
category: Category.Team,
title: "Source link(s)",
tooltip: "Source link(s) for green space data",
example: ["", "", ""],
},
context_tree_distance: {
category: Category.Team,
title: "Distance to nearest tree (m)",
tooltip: "Approximate distance from the front door of the building to the nearest tree.",
example: 10
},
context_tree_distance_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source type for tree data",
example: "",
items: commonSourceTypes
},
context_tree_distance_source_links: {
category: Category.Team,
title: "Source link(s)",
tooltip: "Source link(s) for tree data",
example: ["", "", ""],
},
context_street_geometry: {
category: Category.Team,
title: "Street network geometry link",
tooltip: "Link to a website with the name of the building..",
example: "https://en.wikipedia.org/",
},
context_street_geometry_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source type for tree data",
example: "",
items: commonSourceTypes
},
context_street_geometry_source_links: {
category: Category.Team,
title: "Source link(s)",
tooltip: "Source link(s) for tree data",
example: ["", "", ""],
},
}; };
export const allFieldsConfig = { ...dataFields, ...buildingUserFields }; export const allFieldsConfig = { ...dataFields, ...buildingUserFields };

View File

@ -19,3 +19,32 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS designers_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS builder_source_type; ALTER TABLE buildings DROP COLUMN IF EXISTS builder_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS extension_source_type; ALTER TABLE buildings DROP COLUMN IF EXISTS extension_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS extension_source_links; ALTER TABLE buildings DROP COLUMN IF EXISTS extension_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_far_ratio;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_far_ratio_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_far_ratio_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_plot_area_total;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_plot_area_total_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_plot_area_total_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_parcel_geometry;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_parcel_geometry_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_parcel_geometry_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_front_garden;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_back_garden;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_flats_garden;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_garden_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_garden_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_width;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_width_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_width_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_pavement_width;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_pavement_width_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_pavement_width_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_green_space_distance;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_green_space_distance_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_green_space_distance_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_tree_distance;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_tree_distance_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_tree_distance_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry_source_links;

View File

@ -21,3 +21,32 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_source_type text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_source_type text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_source_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_far_ratio text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_far_ratio_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_far_ratio_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_plot_area_total text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_plot_area_total_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_plot_area_total_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_parcel_geometry text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_parcel_geometry_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_parcel_geometry_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_front_garden text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_back_garden text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_flats_garden text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_garden_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_garden_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_width text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_width_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_width_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_pavement_width text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_pavement_width_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_pavement_width_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_green_space_distance text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_green_space_distance_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_green_space_distance_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_tree_distance text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_tree_distance_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_tree_distance_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry_source_links text[];