Merge pull request #866 from colouring-cities/activate-address-fields

Activate address fields
This commit is contained in:
Ed Chalstrey 2022-07-05 16:40:04 +01:00 committed by GitHub
commit 1caa5d2fd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 12 deletions

View File

@ -56,7 +56,7 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
verify: true,
},
location_name: {
edit: false,
edit: true,
verify: true,
},
location_number: {
@ -64,17 +64,20 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
verify: true,
},
location_street: {
edit: false,
edit: true,
verify: true,
},
location_line_two: {
edit: false,
edit: true,
verify: true
},
location_town: {
edit: false,
edit: true,
verify: true
},
location_postcode: {
edit: false,
edit: true,
verify: true
},
location_latitude: {
edit: true,

View File

@ -15,7 +15,6 @@ const locationNumberPattern = "[1-9]\\d*[a-z]?(-([1-9]\\d*))?"; ///[1-9]\d*[a-z]
const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
<Fragment>
<InfoBox msg="Text-based address fields are disabled at the moment. We're looking into how best to collect this data." />
<DataEntry
title={dataFields.location_name.title}
slug="location_name"
@ -25,7 +24,7 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
onChange={props.onChange}
tooltip={dataFields.location_name.tooltip}
placeholder="Building name (if any)"
disabled={true}
/>
<Verification
slug="location_name"
@ -62,7 +61,7 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
disabled={true}
/>
<Verification
slug="location_street"
@ -80,7 +79,14 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
disabled={true}
/>
<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}
@ -89,7 +95,15 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
disabled={true}
/>
<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}
@ -100,7 +114,15 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
onChange={props.onChange}
maxLength={8}
valueTransform={x=>x.toUpperCase()}
disabled={true}
/>
<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}
/>
<DataEntry
title={dataFields.ref_toid.title}
@ -110,7 +132,7 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
copy={props.copy}
tooltip={dataFields.ref_toid.tooltip}
onChange={props.onChange}
disabled={true}
/>
<UPRNsDataEntry
title={dataFields.uprns.title}