add work_carried_out field

This commit is contained in:
Ed Chalstrey 2022-06-01 11:12:49 +01:00
parent 3b42d1b8ef
commit 8923213f7c
2 changed files with 30 additions and 15 deletions

View File

@ -10,22 +10,32 @@ import { CategoryViewProps } from './category-view-props';
/** /**
* Team view/edit section * Team view/edit section
*/ */
const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => ( const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
<Fragment> const building = props.building;
<InfoBox msg="Can you help us capture information on who built the current building?"></InfoBox> const currentBuildingConstructionYear = building.date_year || undefined;
<SelectDataEntry return (
title={dataFields.is_extension.title} <Fragment>
slug="is_extension" <InfoBox msg="Can you help us capture information on who built the current building?"></InfoBox>
value={props.building.is_extension} <SelectDataEntry
mode={props.mode} title={dataFields.is_extension.title}
copy={props.copy} slug="is_extension"
onChange={props.onChange} value={props.building.is_extension}
tooltip={dataFields.is_extension.tooltip} mode={props.mode}
placeholder={dataFields.is_extension.example} copy={props.copy}
options={dataFields.is_extension.items} onChange={props.onChange}
tooltip={dataFields.is_extension.tooltip}
placeholder={dataFields.is_extension.example}
options={dataFields.is_extension.items}
/>
<NumericDataEntry
slug='work_carried_out'
title={dataFields.work_carried_out.title}
value={currentBuildingConstructionYear}
/> />
</Fragment> </Fragment>
); );
};
const TeamContainer = withCopyEdit(TeamView); const TeamContainer = withCopyEdit(TeamView);
export default TeamContainer; export default TeamContainer;

View File

@ -645,6 +645,11 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
items: [ items: [
"A major extension" "A major extension"
], ],
},
work_carried_out: {
category: Category.Team,
title: "When was the work carried out?",
tooltip: "Best estimate"
} }
}; };