From e30e984541c9c0902d62d859bbb7d5f93477ed29 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 22 Jul 2022 15:57:05 +0100 Subject: [PATCH 1/6] change "Private company" to "Commercial" --- app/src/frontend/config/data-fields-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 34b10d60..200de85d 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -672,7 +672,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ "Community/Cooperative", "Other non-profit body", "Private (individual)", - "Private (company/estate)", + "Commercial (company/estate)", "Religious body", "Other" ] From 813e7440e82b0a38c27070b1e92ca27270d53942 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 22 Jul 2022 15:58:04 +0100 Subject: [PATCH 2/6] "Engineer/ Engineering firm" --- app/src/frontend/config/data-fields-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 200de85d..b4c3ad77 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -710,7 +710,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ "Speculative builder", "Government architecture department", "Architect/ architectural firm", - "Engineering firm", + "Engineer/ Engineering firm", "Other" ] }, From e00621df41069f5a36dbe208503429ae54040595 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 22 Jul 2022 16:06:59 +0100 Subject: [PATCH 3/6] add LogicalDataEntryYesOnly --- .../logical-data-entry/logical-data-entry.tsx | 38 +++++++++++++++++++ .../building/data-containers/team.tsx | 4 +- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-components/logical-data-entry/logical-data-entry.tsx b/app/src/frontend/building/data-components/logical-data-entry/logical-data-entry.tsx index 78cbee8f..596d2c7a 100644 --- a/app/src/frontend/building/data-components/logical-data-entry/logical-data-entry.tsx +++ b/app/src/frontend/building/data-components/logical-data-entry/logical-data-entry.tsx @@ -107,3 +107,41 @@ export const LogicalDataEntry: React.FC = (props) => { ); }; + +export const LogicalDataEntryYesOnly: React.FC = (props) => { + function handleValueChange(e: React.ChangeEvent) { + props.onChange?.(props.slug, e.target.value === 'true'); + } + + function handleClear(e: React.MouseEvent) { + props.onChange?.(props.slug, null); + } + + const isDisabled = props.mode === 'view' || props.disabled; + + return ( + <> + +
+ Yes +
+ { + !isDisabled && props.value != null && + + } + + ); +}; diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index 04e2648f..0f975825 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -5,7 +5,7 @@ import SelectDataEntry from '../data-components/select-data-entry'; import NumericDataEntry from '../data-components/numeric-data-entry'; import Verification from '../data-components/verification'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; -import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; +import { LogicalDataEntry, LogicalDataEntryYesOnly } from '../data-components/logical-data-entry/logical-data-entry'; import { DataEntryGroup } from '../data-components/data-entry-group'; import withCopyEdit from '../data-container'; @@ -187,7 +187,7 @@ const TeamView: React.FunctionComponent = (props) => { user_verified_as={props.user_verified.lead_designer_type} verified_count={props.building.verified.lead_designer_type} /> - Date: Fri, 22 Jul 2022 16:16:53 +0100 Subject: [PATCH 4/6] add landowner and landowner_source_link --- app/src/api/config/dataFields.ts | 8 ++++ .../building/data-containers/team.tsx | 39 +++++++++++++++++++ app/src/frontend/config/data-fields-config.ts | 12 ++++++ 3 files changed, 59 insertions(+) diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index a17f0fa8..b7f739df 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -351,6 +351,14 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, + landowner: { + edit: true, + verify: true + }, + landowner_source_link: { + edit: true, + verify: true + }, designers: { edit: true, verify: true diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index 0f975825..812f03a7 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -22,6 +22,45 @@ const TeamView: React.FunctionComponent = (props) => { return (
+ + + + Date: Fri, 22 Jul 2022 16:21:14 +0100 Subject: [PATCH 5/6] add landowner db migration --- migrations/031.landowner.down.sql | 2 ++ migrations/031.landowner.up.sql | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 migrations/031.landowner.down.sql create mode 100644 migrations/031.landowner.up.sql diff --git a/migrations/031.landowner.down.sql b/migrations/031.landowner.down.sql new file mode 100644 index 00000000..161fdad3 --- /dev/null +++ b/migrations/031.landowner.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE buildings DROP COLUMN IF EXISTS landowner; +ALTER TABLE buildings DROP COLUMN IF EXISTS landowner_source_link; \ No newline at end of file diff --git a/migrations/031.landowner.up.sql b/migrations/031.landowner.up.sql new file mode 100644 index 00000000..30014d28 --- /dev/null +++ b/migrations/031.landowner.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS landowner text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS landowner_source_link text[]; From c1313abb3b8eab22d6ce17d112681fac9da8daac Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 22 Jul 2022 16:24:00 +0100 Subject: [PATCH 6/6] fix mistake --- app/src/frontend/building/data-containers/team.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/frontend/building/data-containers/team.tsx b/app/src/frontend/building/data-containers/team.tsx index 812f03a7..02236175 100644 --- a/app/src/frontend/building/data-containers/team.tsx +++ b/app/src/frontend/building/data-containers/team.tsx @@ -34,10 +34,10 @@ const TeamView: React.FunctionComponent = (props) => { editableEntries={true} />