diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index cb5a4f6f..674a5bf8 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -292,6 +292,10 @@ export const buildingAttributesConfig = valueType()({ /* eslint sqlCast: 'jsonb', }, + is_domestic: { + edit: true, + verify: true + }, likes_total: { edit: false, derivedEdit: true, diff --git a/app/src/frontend/building/data-containers/community.tsx b/app/src/frontend/building/data-containers/community.tsx index 0be53e79..95668fb1 100644 --- a/app/src/frontend/building/data-containers/community.tsx +++ b/app/src/frontend/building/data-containers/community.tsx @@ -43,6 +43,24 @@ const CommunityView: React.FunctionComponent = (props) => { Can you share your opinion on how well the building works? + + + {props.building.is_domestic === false ? = (props) => { copy={props.copy} /> + : <>} diff --git a/app/src/frontend/building/data-containers/use.tsx b/app/src/frontend/building/data-containers/use.tsx index 1b3b2f90..d4692d28 100644 --- a/app/src/frontend/building/data-containers/use.tsx +++ b/app/src/frontend/building/data-containers/use.tsx @@ -5,6 +5,7 @@ import { dataFields } from '../../config/data-fields-config'; import DataEntry from '../data-components/data-entry'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; +import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; import TextboxDataEntry from '../data-components/textbox-data-entry'; import withCopyEdit from '../data-container'; @@ -21,6 +22,23 @@ const UseView: React.FunctionComponent = (props) => { ){ return ( + + 0`, community_local_significance_total: ` SELECT diff --git a/maintenance/extract_data/export_attributes.sql b/maintenance/extract_data/export_attributes.sql index d0b9c4cc..78d087ac 100644 --- a/maintenance/extract_data/export_attributes.sql +++ b/maintenance/extract_data/export_attributes.sql @@ -54,6 +54,7 @@ COPY (SELECT planning_in_apa_url, planning_local_list_url, planning_historic_area_assessment_url, + is_domestic, likes_total FROM buildings) TO '/tmp/building_attributes.csv' diff --git a/migrations/037.is_domestic.down.sql b/migrations/037.is_domestic.down.sql new file mode 100644 index 00000000..68c44f64 --- /dev/null +++ b/migrations/037.is_domestic.down.sql @@ -0,0 +1 @@ +ALTER TABLE buildings DROP COLUMN IF EXISTS is_domestic; diff --git a/migrations/037.is_domestic.up.sql b/migrations/037.is_domestic.up.sql new file mode 100644 index 00000000..da8e360b --- /dev/null +++ b/migrations/037.is_domestic.up.sql @@ -0,0 +1 @@ +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic boolean null;