Merge pull request #823 from colouring-cities/source-details-edits-3
Age and Current Use text box changes
This commit is contained in:
commit
7343c71d16
@ -16,7 +16,61 @@ import { CategoryViewProps } from './category-view-props';
|
|||||||
*/
|
*/
|
||||||
const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
||||||
const currentYear = new Date().getFullYear();
|
const currentYear = new Date().getFullYear();
|
||||||
|
if (props.building.date_source == "Expert knowledge of building" ||
|
||||||
|
props.building.date_source == "Expert estimate from image" ||
|
||||||
|
props.building.date_source == null
|
||||||
|
){
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<YearDataEntry
|
||||||
|
year={props.building.date_year}
|
||||||
|
upper={props.building.date_upper}
|
||||||
|
lower={props.building.date_lower}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
|
||||||
|
allow_verify={props.user !== undefined && props.building.date_year !== null && !props.edited}
|
||||||
|
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}
|
||||||
|
/>
|
||||||
|
<NumericDataEntry
|
||||||
|
title={dataFields.facade_year.title}
|
||||||
|
slug="facade_year"
|
||||||
|
value={props.building.facade_year}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
step={1}
|
||||||
|
min={1}
|
||||||
|
max={currentYear}
|
||||||
|
tooltip={dataFields.facade_year.tooltip}
|
||||||
|
/>
|
||||||
|
<Verification
|
||||||
|
slug="facade_year"
|
||||||
|
allow_verify={props.user !== undefined && props.building.facade_year !== null && !props.edited}
|
||||||
|
onVerify={props.onVerify}
|
||||||
|
user_verified={props.user_verified.hasOwnProperty("facade_year")}
|
||||||
|
user_verified_as={props.user_verified.facade_year}
|
||||||
|
verified_count={props.building.verified.facade_year}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SelectDataEntry
|
||||||
|
title={dataFields.date_source.title}
|
||||||
|
slug="date_source"
|
||||||
|
value={props.building.date_source}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
tooltip={dataFields.date_source.tooltip}
|
||||||
|
placeholder={dataFields.date_source.example}
|
||||||
|
options={dataFields.date_source.items}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<YearDataEntry
|
<YearDataEntry
|
||||||
@ -62,32 +116,8 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
copy={props.copy}
|
copy={props.copy}
|
||||||
onChange={props.onChange}
|
onChange={props.onChange}
|
||||||
tooltip={dataFields.date_source.tooltip}
|
tooltip={dataFields.date_source.tooltip}
|
||||||
placeholder=""
|
options={dataFields.date_source.items}
|
||||||
options={[
|
placeholder={dataFields.date_source.example}
|
||||||
"Expert knowledge of building",
|
|
||||||
"Expert estimate from image",
|
|
||||||
"Survey of London",
|
|
||||||
"Pevsner Guides",
|
|
||||||
"Victoria County History",
|
|
||||||
"Local history publication",
|
|
||||||
"Other publication",
|
|
||||||
"National Heritage List for England",
|
|
||||||
"Other database or gazetteer",
|
|
||||||
"Historical map",
|
|
||||||
"Other archive document",
|
|
||||||
"Film/Video",
|
|
||||||
"Other website",
|
|
||||||
"Other"
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
<TextboxDataEntry
|
|
||||||
title={dataFields.date_source_detail.title}
|
|
||||||
slug="date_source_detail"
|
|
||||||
value={props.building.date_source_detail}
|
|
||||||
mode={props.mode}
|
|
||||||
copy={props.copy}
|
|
||||||
onChange={props.onChange}
|
|
||||||
tooltip={dataFields.date_source_detail.tooltip}
|
|
||||||
/>
|
/>
|
||||||
<MultiDataEntry
|
<MultiDataEntry
|
||||||
title={dataFields.date_link.title}
|
title={dataFields.date_link.title}
|
||||||
|
@ -14,77 +14,128 @@ import Verification from '../data-components/verification';
|
|||||||
/**
|
/**
|
||||||
* Use view/edit section
|
* Use view/edit section
|
||||||
*/
|
*/
|
||||||
const UseView: React.FunctionComponent<CategoryViewProps> = (props) => (
|
const UseView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
||||||
<Fragment>
|
if (props.building.current_landuse_source == "Expert/personal knowledge of building" ||
|
||||||
<InfoBox msg="93% of properties in UK are dwellings so we have set this as the default colour. Can you help us colour-in all non-residential and mixed use buildings, and verify residential buildings too?"></InfoBox>
|
props.building.current_landuse_source == "Online streetview image" ||
|
||||||
<MultiDataEntry
|
props.building.current_landuse_source == null
|
||||||
title={dataFields.current_landuse_group.title}
|
){
|
||||||
slug="current_landuse_group"
|
return (
|
||||||
value={props.building.current_landuse_group}
|
<Fragment>
|
||||||
mode={props.mode}
|
<InfoBox msg="93% of properties in UK are dwellings so we have set this as the default colour. Can you help us colour-in all non-residential and mixed use buildings, and verify residential buildings too?"></InfoBox>
|
||||||
copy={props.copy}
|
<MultiDataEntry
|
||||||
onChange={props.onChange}
|
title={dataFields.current_landuse_group.title}
|
||||||
confirmOnEnter={true}
|
slug="current_landuse_group"
|
||||||
tooltip={dataFields.current_landuse_group.tooltip}
|
value={props.building.current_landuse_group}
|
||||||
placeholder="Type new land use group here"
|
mode={props.mode}
|
||||||
copyable={true}
|
copy={props.copy}
|
||||||
autofill={true}
|
onChange={props.onChange}
|
||||||
showAllOptionsOnEmpty={true}
|
confirmOnEnter={true}
|
||||||
/>
|
tooltip={dataFields.current_landuse_group.tooltip}
|
||||||
<Verification
|
placeholder="Type new land use group here"
|
||||||
slug="current_landuse_group"
|
copyable={true}
|
||||||
allow_verify={props.user !== undefined && props.building.current_landuse_group !== null && !props.edited}
|
autofill={true}
|
||||||
onVerify={props.onVerify}
|
showAllOptionsOnEmpty={true}
|
||||||
user_verified={props.user_verified.hasOwnProperty("current_landuse_group")}
|
/>
|
||||||
user_verified_as={props.user_verified.current_landuse_group && props.user_verified.current_landuse_group.join(", ")}
|
<Verification
|
||||||
verified_count={props.building.verified.current_landuse_group}
|
slug="current_landuse_group"
|
||||||
|
allow_verify={props.user !== undefined && props.building.current_landuse_group !== null && !props.edited}
|
||||||
|
onVerify={props.onVerify}
|
||||||
|
user_verified={props.user_verified.hasOwnProperty("current_landuse_group")}
|
||||||
|
user_verified_as={props.user_verified.current_landuse_group && props.user_verified.current_landuse_group.join(", ")}
|
||||||
|
verified_count={props.building.verified.current_landuse_group}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
props.mode != 'view' &&
|
||||||
|
<InfoBox msg="Land use order, shown below, is automatically derived from the land use groups"></InfoBox>
|
||||||
|
}
|
||||||
|
<DataEntry
|
||||||
|
title={dataFields.current_landuse_order.title}
|
||||||
|
tooltip={dataFields.current_landuse_order.tooltip}
|
||||||
|
slug="current_landuse_order"
|
||||||
|
value={props.building.current_landuse_order}
|
||||||
|
mode={props.mode}
|
||||||
|
disabled={true}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
/>
|
||||||
|
<SelectDataEntry
|
||||||
|
title={dataFields.current_landuse_source.title}
|
||||||
|
slug="current_landuse_source"
|
||||||
|
value={props.building.current_landuse_source}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
tooltip={dataFields.current_landuse_source.tooltip}
|
||||||
|
placeholder={dataFields.date_source.example}
|
||||||
|
options={dataFields.current_landuse_source.items}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Fragment>
|
||||||
|
<InfoBox msg="93% of properties in UK are dwellings so we have set this as the default colour. Can you help us colour-in all non-residential and mixed use buildings, and verify residential buildings too?"></InfoBox>
|
||||||
|
<MultiDataEntry
|
||||||
|
title={dataFields.current_landuse_group.title}
|
||||||
|
slug="current_landuse_group"
|
||||||
|
value={props.building.current_landuse_group}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
confirmOnEnter={true}
|
||||||
|
tooltip={dataFields.current_landuse_group.tooltip}
|
||||||
|
placeholder="Type new land use group here"
|
||||||
|
copyable={true}
|
||||||
|
autofill={true}
|
||||||
|
showAllOptionsOnEmpty={true}
|
||||||
/>
|
/>
|
||||||
{
|
<Verification
|
||||||
props.mode != 'view' &&
|
slug="current_landuse_group"
|
||||||
<InfoBox msg="Land use order, shown below, is automatically derived from the land use groups"></InfoBox>
|
allow_verify={props.user !== undefined && props.building.current_landuse_group !== null && !props.edited}
|
||||||
}
|
onVerify={props.onVerify}
|
||||||
<DataEntry
|
user_verified={props.user_verified.hasOwnProperty("current_landuse_group")}
|
||||||
title={dataFields.current_landuse_order.title}
|
user_verified_as={props.user_verified.current_landuse_group && props.user_verified.current_landuse_group.join(", ")}
|
||||||
tooltip={dataFields.current_landuse_order.tooltip}
|
verified_count={props.building.verified.current_landuse_group}
|
||||||
slug="current_landuse_order"
|
/>
|
||||||
value={props.building.current_landuse_order}
|
{
|
||||||
mode={props.mode}
|
props.mode != 'view' &&
|
||||||
disabled={true}
|
<InfoBox msg="Land use order, shown below, is automatically derived from the land use groups"></InfoBox>
|
||||||
copy={props.copy}
|
}
|
||||||
onChange={props.onChange}
|
<DataEntry
|
||||||
/>
|
title={dataFields.current_landuse_order.title}
|
||||||
<SelectDataEntry
|
tooltip={dataFields.current_landuse_order.tooltip}
|
||||||
title={dataFields.current_landuse_source.title}
|
slug="current_landuse_order"
|
||||||
slug="current_landuse_source"
|
value={props.building.current_landuse_order}
|
||||||
value={props.building.current_landuse_source}
|
mode={props.mode}
|
||||||
mode={props.mode}
|
disabled={true}
|
||||||
copy={props.copy}
|
copy={props.copy}
|
||||||
onChange={props.onChange}
|
onChange={props.onChange}
|
||||||
tooltip={dataFields.current_landuse_source.tooltip}
|
|
||||||
placeholder=""
|
|
||||||
options={[
|
|
||||||
"Expert/personal knowledge of building",
|
|
||||||
"Online streetview image",
|
|
||||||
"Open planning authority dataset",
|
|
||||||
"Open property tax dataset",
|
|
||||||
"Open housing dataset",
|
|
||||||
"Open address dataset",
|
|
||||||
"Other"
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
<MultiDataEntry
|
<SelectDataEntry
|
||||||
title={dataFields.current_landuse_link.title}
|
title={dataFields.current_landuse_source.title}
|
||||||
slug="current_landuse_link"
|
slug="current_landuse_source"
|
||||||
value={props.building.current_landuse_link}
|
value={props.building.current_landuse_source}
|
||||||
mode={props.mode}
|
mode={props.mode}
|
||||||
copy={props.copy}
|
copy={props.copy}
|
||||||
onChange={props.onChange}
|
onChange={props.onChange}
|
||||||
tooltip={dataFields.current_landuse_link.tooltip}
|
tooltip={dataFields.current_landuse_source.tooltip}
|
||||||
placeholder="https://..."
|
placeholder={dataFields.date_source.example}
|
||||||
editableEntries={true}
|
options={dataFields.current_landuse_source.items}
|
||||||
/>
|
/>
|
||||||
</Fragment>
|
<MultiDataEntry
|
||||||
);
|
title={dataFields.current_landuse_link.title}
|
||||||
|
slug="current_landuse_link"
|
||||||
|
value={props.building.current_landuse_link}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
tooltip={dataFields.current_landuse_link.tooltip}
|
||||||
|
placeholder="https://..."
|
||||||
|
editableEntries={true}
|
||||||
|
/>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
};
|
||||||
const UseContainer = withCopyEdit(UseView);
|
const UseContainer = withCopyEdit(UseView);
|
||||||
|
|
||||||
export default UseContainer;
|
export default UseContainer;
|
||||||
|
@ -198,6 +198,15 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
|
|||||||
title: "Source of information",
|
title: "Source of information",
|
||||||
tooltip: "Source for the current land use",
|
tooltip: "Source for the current land use",
|
||||||
example: "",
|
example: "",
|
||||||
|
items: [
|
||||||
|
"Expert/personal knowledge of building",
|
||||||
|
"Online streetview image",
|
||||||
|
"Open planning authority dataset",
|
||||||
|
"Open property tax dataset",
|
||||||
|
"Open housing dataset",
|
||||||
|
"Open address dataset",
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
},
|
},
|
||||||
current_landuse_source_detail: {
|
current_landuse_source_detail: {
|
||||||
category: Category.LandUse,
|
category: Category.LandUse,
|
||||||
@ -269,6 +278,22 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
|
|||||||
category: Category.Age,
|
category: Category.Age,
|
||||||
title: "Source of information",
|
title: "Source of information",
|
||||||
tooltip: "Source for the main start date",
|
tooltip: "Source for the main start date",
|
||||||
|
items: [
|
||||||
|
"Expert knowledge of building",
|
||||||
|
"Expert estimate from image",
|
||||||
|
"Survey of London",
|
||||||
|
"Pevsner Guides",
|
||||||
|
"Victoria County History",
|
||||||
|
"Local history publication",
|
||||||
|
"Other publication",
|
||||||
|
"National Heritage List for England",
|
||||||
|
"Other database or gazetteer",
|
||||||
|
"Historical map",
|
||||||
|
"Other archive document",
|
||||||
|
"Film/Video",
|
||||||
|
"Other website",
|
||||||
|
"Other"
|
||||||
|
],
|
||||||
example: "",
|
example: "",
|
||||||
},
|
},
|
||||||
date_source_detail: {
|
date_source_detail: {
|
||||||
|
Loading…
Reference in New Issue
Block a user