Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface/UI tweaks #1276

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/src/frontend/building/data-containers/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,10 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
<a href={"/"+props.mode+"/age/"+props.building.building_id+"?sc=1"}>Age & History</a>.</i>
</div>
<DataEntryGroup name="Client" collapsed={subcat==null || subcat!="3"}>
<SelectDataEntry
<MultiDataEntry
slug='building_client'
title={dataFields.building_client.title}
value={props.building.building_client}
options={dataFields.building_client.items}
tooltip={dataFields.building_client.tooltip}
onChange={props.onChange}
mode={props.mode}
Expand Down Expand Up @@ -394,11 +393,10 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
<a href={"/"+props.mode+"/age/"+props.building.building_id+"?sc=3"}>Age & History</a>.</i>
</div>
<DataEntryGroup name="Client" collapsed={subcat==null || subcat!="8"}>
<SelectDataEntry
<MultiDataEntry
slug='extension_client'
title={dataFields.extension_client.title}
value={props.building.extension_client}
options={dataFields.extension_client.items}
tooltip={dataFields.extension_client.tooltip}
onChange={props.onChange}
mode={props.mode}
Expand Down
30 changes: 7 additions & 23 deletions app/src/frontend/config/data-fields-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const commonSourceTypes = [
];

const freeTextDisclaimer : string =
"<br/><br/>(For security reasons, we currently only collect the names of non-residential buildings).";
"<br/><br/>(For security reasons, we are not currently allowing free-text input and are looking into other ways of collecting this data).";

/**
* This interface is used only in code which uses dataFields, not in the dataFields definition itself
Expand Down Expand Up @@ -1665,17 +1665,9 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
},
building_client: {
category: Category.Team,
title: "Original building client",
tooltip: "Who was the client who commissioned the original building?<br/><br/>For info on current land ownership, see 'Planning Controls'." + freeTextDisclaimer,
example: "Landowner",
items: [
"Landowner",
"Speculative builder",
"Government architecture department",
"Architect/ architectural firm",
"Engineer/ Engineering firm",
"Other"
]
title: "Original building client link(s)",
tooltip: "Link(s) describing the client who commissioned the original building?" + freeTextDisclaimer,
example: ["", "", ""]
},
building_client_source_type: {
category: Category.Team,
Expand All @@ -1692,17 +1684,9 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
},
extension_client: {
category: Category.Team,
title: "Extension client",
tooltip: "Who was the client who commissioned the most significant extension to the building?<br/><br/>For info on current land ownership, see 'Planning Controls'." + freeTextDisclaimer,
example: "Landowner",
items: [
"Landowner",
"Speculative builder",
"Government architecture department",
"Architect/ architectural firm",
"Engineer/ Engineering firm",
"Other"
]
title: "Extension client link(s)",
tooltip: "Link(s) describing the client who commissioned the most significant extension to the building?" + freeTextDisclaimer,
example: ["", "", ""]
},
extension_client_source_type: {
category: Category.Team,
Expand Down
8 changes: 6 additions & 2 deletions migrations/050.ui_tweaks.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS sust_energy_rating_source_type te
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS sust_energy_rating_source_link text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS planning_listed boolean;

ALTER TABLE buildings ADD COLUMN IF NOT EXISTS building_client text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS building_client text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS building_client_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS building_client_source_link text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_client text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_client text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_client_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS extension_client_source_link text[];

UPDATE buildings
SET planning_listed = True
WHERE planning_list_grade != 'None';
Loading