From 8f56f96779351a28c61363b7c6d79761c713b813 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Tue, 4 Aug 2020 17:01:20 +0100 Subject: [PATCH] Verify date_year --- .../building/data-components/year-data-entry.tsx | 16 ++++++++++++++++ .../frontend/building/data-containers/age.tsx | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) 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 3a9c2996..6795c26a 100644 --- a/app/src/frontend/building/data-components/year-data-entry.tsx +++ b/app/src/frontend/building/data-components/year-data-entry.tsx @@ -1,5 +1,6 @@ import React, { Component, Fragment } from 'react'; +import Verification from './verification'; import { dataFields } from '../../data_fields'; import { CopyProps } from '../data-containers/category-view-props'; @@ -12,6 +13,12 @@ interface YearDataEntryProps { copy?: CopyProps; mode?: 'view' | 'edit' | 'multi-edit'; onChange?: (key: string, value: any) => void; + + onVerify: (slug: string, verify: boolean) => void; + user_verified: boolean; + user_verified_as: string; + verified_count: number; + allow_verify: boolean; } class YearDataEntry extends Component { @@ -45,6 +52,15 @@ class YearDataEntry extends Component { max={currentYear} // "type": "year_estimator" /> + + = (props) => { mode={props.mode} copy={props.copy} onChange={props.onChange} + + allow_verify={props.user !== undefined && props.building.date_year !== null} + onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_year")} + user_verified_as={props.user_verified.date_year} + verified_count={props.building.verified.date_year} /> = (props) => { tooltip={dataFields.facade_year.tooltip} />