add verification

This commit is contained in:
Ed Chalstrey 2022-07-05 16:32:00 +01:00
parent c3323d9531
commit a17a1820e5
2 changed files with 28 additions and 0 deletions

View File

@ -69,12 +69,15 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
},
location_line_two: {
edit: true,
verify: true
},
location_town: {
edit: true,
verify: true
},
location_postcode: {
edit: true,
verify: true
},
location_latitude: {
edit: true,

View File

@ -79,6 +79,15 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
/>
<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
@ -89,6 +98,14 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
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}
@ -100,6 +117,14 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => (
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}
/>
<DataEntry
title={dataFields.ref_toid.title}