diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index daee34da..5e1f6474 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -53,6 +53,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, ref_osm_id: { edit: true, + verify: true, }, location_name: { edit: false, @@ -77,9 +78,11 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, location_latitude: { edit: true, + verify: true, }, location_longitude: { edit: true, + verify: true, }, date_year: { edit: true, @@ -87,21 +90,26 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, date_lower: { edit: true, + verify: true, }, date_upper: { edit: true, + verify: true, }, date_source: { edit: true, + verify: true, }, date_source_detail: { edit: true, }, date_link: { edit: true, + verify: true, }, facade_year: { edit: true, + verify: true, }, facade_upper: { edit: false, @@ -145,12 +153,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, construction_core_material: { edit: true, + verify: true, }, construction_secondary_materials: { edit: false, }, construction_roof_covering: { edit: true, + verify: true, }, planning_portal_link: { edit: true, @@ -259,12 +269,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, current_landuse_source: { edit: true, + verify: true, }, current_landuse_source_detail: { edit: true, }, current_landuse_link: { edit: true, + verify: true, }, dynamics_has_demolished_buildings: { edit: true, @@ -306,7 +318,7 @@ export const buildingAttributesConfig = valueType()({ /* eslint }, community_public_ownership_sources: { edit: true, - verify: false + verify: true } }); diff --git a/app/src/frontend/building/data-components/year-data-entry.tsx b/app/src/frontend/building/data-components/year-data-entry.tsx index 472a72d8..aea54267 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -19,6 +19,19 @@ interface YearDataEntryProps { user_verified_as: string; verified_count: number; allow_verify: boolean; + + onVerify_upper: (slug: string, verify: boolean, x: number, y: number) => void; + user_verified_upper: boolean; + user_verified_as_upper: string; + verified_count_upper: number; + allow_verify_upper: boolean; + + onVerify_lower: (slug: string, verify: boolean, x: number, y: number) => void; + user_verified_lower: boolean; + user_verified_as_lower: string; + verified_count_lower: number; + allow_verify_lower: boolean; + } class YearDataEntry extends Component { @@ -73,6 +86,14 @@ class YearDataEntry extends Component { max={currentYear} tooltip={dataFields.date_lower.tooltip} /> + { min={1} max={currentYear} tooltip={dataFields.date_upper.tooltip} + /> + ); diff --git a/app/src/frontend/building/data-container.tsx b/app/src/frontend/building/data-container.tsx index cad60ff1..fb886d7a 100644 --- a/app/src/frontend/building/data-container.tsx +++ b/app/src/frontend/building/data-container.tsx @@ -246,6 +246,8 @@ const withCopyEdit: (wc: React.ComponentType) => DataContaine } catch(err) { this.setState({error: err}); } + + console.log(slug + " verify button clicked") } render() { diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 15ff3c70..3dbea6cf 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -35,6 +35,18 @@ const AgeView: React.FunctionComponent = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} + + allow_verify_upper={props.user !== undefined && props.building.date_upper !== null && !props.edited} + onVerify_upper={props.onVerify} + user_verified_upper={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as_upper={props.user_verified.date_upper} + verified_count_upper={props.building.verified.date_upper} + + allow_verify_lower={props.user !== undefined && props.building.date_lower !== null && !props.edited} + onVerify_lower={props.onVerify} + user_verified_lower={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as_lower={props.user_verified.date_lower} + verified_count_lower={props.building.verified.date_lower} /> = (props) => { placeholder={dataFields.date_source.example} options={dataFields.date_source.items} /> + ); }; @@ -86,6 +106,18 @@ const AgeView: React.FunctionComponent = (props) => { user_verified={props.user_verified.hasOwnProperty("date_year")} user_verified_as={props.user_verified.date_year} verified_count={props.building.verified.date_year} + + allow_verify_upper={props.user !== undefined && props.building.date_upper !== null && !props.edited} + onVerify_upper={props.onVerify} + user_verified_upper={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as_upper={props.user_verified.date_upper} + verified_count_upper={props.building.verified.date_upper} + + allow_verify_lower={props.user !== undefined && props.building.date_lower !== null && !props.edited} + onVerify_lower={props.onVerify} + user_verified_lower={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as_lower={props.user_verified.date_lower} + verified_count_lower={props.building.verified.date_lower} /> = (props) => { options={dataFields.date_source.items} placeholder={dataFields.date_source.example} /> + = (props) => { placeholder="https://..." editableEntries={true} /> + ); }; diff --git a/app/src/frontend/building/data-containers/community.tsx b/app/src/frontend/building/data-containers/community.tsx index 6669476c..d074da38 100644 --- a/app/src/frontend/building/data-containers/community.tsx +++ b/app/src/frontend/building/data-containers/community.tsx @@ -155,6 +155,14 @@ const CommunityView: React.FunctionComponent = (props) => { onChange={props.onChange} mode={props.mode} /> + }; const CommunityContainer = withCopyEdit(CommunityView); diff --git a/app/src/frontend/building/data-containers/construction.tsx b/app/src/frontend/building/data-containers/construction.tsx index 0ece42f1..d105f1b1 100644 --- a/app/src/frontend/building/data-containers/construction.tsx +++ b/app/src/frontend/building/data-containers/construction.tsx @@ -4,6 +4,7 @@ import { dataFields } from '../../config/data-fields-config'; import DataEntry from '../data-components/data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; import withCopyEdit from '../data-container'; +import Verification from '../data-components/verification'; import { CategoryViewProps } from './category-view-props'; @@ -45,6 +46,14 @@ const ConstructionView: React.FunctionComponent = (props) => copy={props.copy} onChange={props.onChange} /> + = (props) => copy={props.copy} onChange={props.onChange} /> + = (props) => ( maxLength={20} onChange={props.onChange} /> + = (props) => ( placeholder="Latitude, e.g. 51.5467" onChange={props.onChange} /> + = (props) => ( placeholder="Longitude, e.g. -0.0586" onChange={props.onChange} /> + ); const LocationContainer = withCopyEdit(LocationView); diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 64ba958c..d7588231 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -69,6 +69,14 @@ const UseView: React.FunctionComponent = (props) => { placeholder={dataFields.date_source.example} options={dataFields.current_landuse_source.items} /> + ); }; @@ -122,6 +130,14 @@ const UseView: React.FunctionComponent = (props) => { placeholder={dataFields.date_source.example} options={dataFields.current_landuse_source.items} /> + = (props) => { placeholder="https://..." editableEntries={true} /> + ); };