change to has_extension bool

This commit is contained in:
Ed Chalstrey 2022-06-06 14:20:27 +01:00
parent a01a5673af
commit b59e811412
4 changed files with 13 additions and 15 deletions

View File

@ -325,7 +325,7 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
}, },
is_extension: { is_extension: {
edit: true, edit: true,
verify: false verify: true
}, },
extension_year: { extension_year: {
edit: true, edit: true,

View File

@ -6,6 +6,7 @@ import NumericDataEntry from '../data-components/numeric-data-entry';
import Verification from '../data-components/verification'; import Verification from '../data-components/verification';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry';
import { DataEntryGroup } from '../data-components/data-entry-group';
import withCopyEdit from '../data-container'; import withCopyEdit from '../data-container';
@ -22,17 +23,17 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
<form> <form>
<InfoBox msg="Can you help us capture information on who built the current building?"></InfoBox> <InfoBox msg="Can you help us capture information on who built the current building?"></InfoBox>
<SelectDataEntry <SelectDataEntry
title={dataFields.is_extension.title} title={dataFields.has_extension.title}
slug="is_extension" slug="has_extension"
value={props.building.is_extension} value={props.building.has_extension}
mode={props.mode} mode={props.mode}
copy={props.copy} copy={props.copy}
onChange={props.onChange} onChange={props.onChange}
tooltip={dataFields.is_extension.tooltip} tooltip={dataFields.has_extension.tooltip}
placeholder={dataFields.is_extension.example} placeholder={dataFields.has_extension.example}
options={dataFields.is_extension.items} options={dataFields.has_extension.items}
/> />
{props.building.is_extension == "The main building" ? ( {props.building.has_extension == "The main building" ? (
<> <>
<NumericDataEntry <NumericDataEntry
slug='date_year' slug='date_year'

View File

@ -637,15 +637,11 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
lifespan: "2-5", overlap_present: "50%", links: ["", ""]} lifespan: "2-5", overlap_present: "50%", links: ["", ""]}
] ]
}, },
is_extension: { has_extension: {
category: Category.Team, category: Category.Team,
title: "Do you wish to add information on:", title: "Is there an extension?",
tooltip: "", tooltip: "",
example: "", example: false
items: [
"The main building",
"A major extension"
],
}, },
extension_year: { extension_year: {
category: Category.Team, category: Category.Team,

View File

@ -1,3 +1,4 @@
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS has_extension smallint;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_year smallint; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_year smallint;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS developer_type varchar; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS developer_type varchar;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers varchar; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers varchar;