Add question whether building is domestic.
This commit is contained in:
parent
5bde854045
commit
ae0e0bb2b6
@ -292,6 +292,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
|
|||||||
sqlCast: 'jsonb',
|
sqlCast: 'jsonb',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
is_domestic: {
|
||||||
|
edit: true,
|
||||||
|
verify: true
|
||||||
|
},
|
||||||
likes_total: {
|
likes_total: {
|
||||||
edit: false,
|
edit: false,
|
||||||
derivedEdit: true,
|
derivedEdit: true,
|
||||||
|
@ -43,6 +43,24 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
<InfoBox>
|
<InfoBox>
|
||||||
Can you share your opinion on how well the building works?
|
Can you share your opinion on how well the building works?
|
||||||
</InfoBox>
|
</InfoBox>
|
||||||
|
<LogicalDataEntry
|
||||||
|
title={dataFields.is_domestic.title}
|
||||||
|
slug="is_domestic"
|
||||||
|
value={props.building.is_domestic}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
tooltip={dataFields.is_domestic.tooltip}
|
||||||
|
/>
|
||||||
|
<Verification
|
||||||
|
slug="is_domestic"
|
||||||
|
allow_verify={props.user !== undefined && props.building.is_domestic !== null && !props.edited}
|
||||||
|
onVerify={props.onVerify}
|
||||||
|
user_verified={props.user_verified.hasOwnProperty("is_domestic")}
|
||||||
|
user_verified_as={props.user_verified.is_domestic}
|
||||||
|
verified_count={props.building.verified.is_domestic}
|
||||||
|
/>
|
||||||
|
{props.building.is_domestic === false ?
|
||||||
<UserOpinionEntry
|
<UserOpinionEntry
|
||||||
slug='community_like'
|
slug='community_like'
|
||||||
title={buildingUserFields.community_like.title}
|
title={buildingUserFields.community_like.title}
|
||||||
@ -54,6 +72,7 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
copy={props.copy}
|
copy={props.copy}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
: <></>}
|
||||||
<button className={`map-switcher-inline ${props.mapColourScale == "likes" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToLikesMapStyle}>
|
<button className={`map-switcher-inline ${props.mapColourScale == "likes" ? "enabled-state" : "disabled-state"} btn btn-outline btn-outline-dark ${darkLightTheme}`} onClick={switchToLikesMapStyle}>
|
||||||
{'Click here to switch map key to this info'}
|
{'Click here to switch map key to this info'}
|
||||||
</button>
|
</button>
|
||||||
|
@ -5,6 +5,7 @@ import { dataFields } from '../../config/data-fields-config';
|
|||||||
import DataEntry from '../data-components/data-entry';
|
import DataEntry from '../data-components/data-entry';
|
||||||
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
|
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
|
||||||
import SelectDataEntry from '../data-components/select-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 TextboxDataEntry from '../data-components/textbox-data-entry';
|
||||||
import withCopyEdit from '../data-container';
|
import withCopyEdit from '../data-container';
|
||||||
|
|
||||||
@ -21,6 +22,23 @@ const UseView: React.FunctionComponent<CategoryViewProps> = (props) => {
|
|||||||
){
|
){
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
<LogicalDataEntry
|
||||||
|
title={dataFields.is_domestic.title}
|
||||||
|
slug="is_domestic"
|
||||||
|
value={props.building.is_domestic}
|
||||||
|
mode={props.mode}
|
||||||
|
copy={props.copy}
|
||||||
|
onChange={props.onChange}
|
||||||
|
tooltip={dataFields.is_domestic.tooltip}
|
||||||
|
/>
|
||||||
|
<Verification
|
||||||
|
slug="is_domestic"
|
||||||
|
allow_verify={props.user !== undefined && props.building.is_domestic !== null && !props.edited}
|
||||||
|
onVerify={props.onVerify}
|
||||||
|
user_verified={props.user_verified.hasOwnProperty("is_domestic")}
|
||||||
|
user_verified_as={props.user_verified.is_domestic}
|
||||||
|
verified_count={props.building.verified.is_domestic}
|
||||||
|
/>
|
||||||
<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>
|
<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
|
<MultiDataEntry
|
||||||
title={dataFields.current_landuse_group.title}
|
title={dataFields.current_landuse_group.title}
|
||||||
|
@ -563,6 +563,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
|
|||||||
//tooltip: ,
|
//tooltip: ,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
is_domestic: {
|
||||||
|
category: Category.Team,
|
||||||
|
title: "Is the building a home/domestic building?",
|
||||||
|
tooltip: "",
|
||||||
|
example: false
|
||||||
|
},
|
||||||
likes_total: {
|
likes_total: {
|
||||||
category: Category.Community,
|
category: Category.Community,
|
||||||
title: "Total number of likes",
|
title: "Total number of likes",
|
||||||
|
@ -116,6 +116,8 @@ const LAYER_QUERIES = {
|
|||||||
FROM
|
FROM
|
||||||
buildings
|
buildings
|
||||||
WHERE
|
WHERE
|
||||||
|
is_domestic = FALSE
|
||||||
|
AND
|
||||||
likes_total > 0`,
|
likes_total > 0`,
|
||||||
community_local_significance_total: `
|
community_local_significance_total: `
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -54,6 +54,7 @@ COPY (SELECT
|
|||||||
planning_in_apa_url,
|
planning_in_apa_url,
|
||||||
planning_local_list_url,
|
planning_local_list_url,
|
||||||
planning_historic_area_assessment_url,
|
planning_historic_area_assessment_url,
|
||||||
|
is_domestic,
|
||||||
likes_total
|
likes_total
|
||||||
FROM buildings)
|
FROM buildings)
|
||||||
TO '/tmp/building_attributes.csv'
|
TO '/tmp/building_attributes.csv'
|
||||||
|
1
migrations/037.is_domestic.down.sql
Normal file
1
migrations/037.is_domestic.down.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE buildings DROP COLUMN IF EXISTS is_domestic;
|
1
migrations/037.is_domestic.up.sql
Normal file
1
migrations/037.is_domestic.up.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic boolean null;
|
Loading…
Reference in New Issue
Block a user