allow mixed answer for domestic use

This commit is contained in:
Mateusz Konieczny 2023-02-07 09:57:54 +01:00
parent 621a5b67db
commit e3e9e83632
5 changed files with 8 additions and 6 deletions

View File

@ -43,10 +43,11 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
<InfoBox>
Can you share your opinion on how well the building works?
</InfoBox>
<LogicalDataEntry
<SelectDataEntry
title={dataFields.is_domestic.title}
slug="is_domestic"
value={props.building.is_domestic}
options={["yes", "no", "mixed"]}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
@ -60,7 +61,7 @@ const CommunityView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.is_domestic}
verified_count={props.building.verified.is_domestic}
/>
{props.building.is_domestic === false ?
{(props.building.is_domestic === "no" || props.building.is_domestic === "mixed") ?
<UserOpinionEntry
slug='community_like'
title={buildingUserFields.community_like.title}

View File

@ -22,10 +22,11 @@ const UseView: React.FunctionComponent<CategoryViewProps> = (props) => {
){
return (
<Fragment>
<LogicalDataEntry
<SelectDataEntry
title={dataFields.is_domestic.title}
slug="is_domestic"
value={props.building.is_domestic}
options={["yes", "no", "mixed"]}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}

View File

@ -575,7 +575,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
category: Category.Team,
title: "Is the building a home/domestic building?",
tooltip: "",
example: false
example: "mixed"
},
likes_total: {
category: Category.Community,

View File

@ -116,7 +116,7 @@ const LAYER_QUERIES = {
FROM
buildings
WHERE
is_domestic = FALSE
is_domestic <> 'yes'
AND
likes_total > 0`,
community_local_significance_total: `

View File

@ -1 +1 @@
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic boolean null;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic text null;