Add links as an alternative to free-text names (Team)

This commit is contained in:
Mike Simpson 2023-06-28 17:14:27 +01:00
parent fd1429e2da
commit 392e9ced3d
5 changed files with 99 additions and 3 deletions

View File

@ -490,6 +490,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true, edit: true,
verify: true verify: true
}, },
developer_links: {
edit: true,
verify: true
},
developer_source_type: { developer_source_type: {
edit: true, edit: true,
verify: true verify: true
@ -502,6 +506,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true, edit: true,
verify: true verify: true
}, },
landowner_links: {
edit: true,
verify: true
},
landowner_source_type: { landowner_source_type: {
edit: true, edit: true,
verify: true verify: true
@ -514,6 +522,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true, edit: true,
verify: true verify: true
}, },
designers_links: {
edit: true,
verify: true
},
designers_source_type: { designers_source_type: {
edit: true, edit: true,
verify: true verify: true
@ -538,6 +550,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true, edit: true,
verify: true verify: true
}, },
builder_links: {
edit: true,
verify: true
},
builder_source_type: { builder_source_type: {
edit: true, edit: true,
verify: true verify: true

View File

@ -4,9 +4,9 @@ import { commonSourceTypes, dataFields } from '../../config/data-fields-config';
import SelectDataEntry from '../data-components/select-data-entry'; import SelectDataEntry from '../data-components/select-data-entry';
import NumericDataEntry from '../data-components/numeric-data-entry'; import NumericDataEntry from '../data-components/numeric-data-entry';
import Verification from '../data-components/verification'; import Verification from '../data-components/verification';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
import { LogicalDataEntry, LogicalDataEntryYesOnly } 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 { DataEntryGroup } from '../data-components/data-entry-group';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
import withCopyEdit from '../data-container'; import withCopyEdit from '../data-container';
@ -156,6 +156,18 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.landowner} user_verified_as={props.user_verified.landowner}
verified_count={props.building.verified.landowner} verified_count={props.building.verified.landowner}
/> />
<MultiDataEntry
title={dataFields.landowner_links.title}
slug="landowner_links"
value={props.building.landowner_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.landowner_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
<SelectDataEntry <SelectDataEntry
title={dataFields.landowner_source_type.title} title={dataFields.landowner_source_type.title}
slug="landowner_source_type" slug="landowner_source_type"
@ -224,6 +236,18 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.developer_name} user_verified_as={props.user_verified.developer_name}
verified_count={props.building.verified.developer_name} verified_count={props.building.verified.developer_name}
/> />
<MultiDataEntry
title={dataFields.developer_links.title}
slug="developer_links"
value={props.building.developer_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.developer_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
<SelectDataEntry <SelectDataEntry
title={dataFields.developer_source_type.title} title={dataFields.developer_source_type.title}
slug="developer_source_type" slug="developer_source_type"
@ -275,6 +299,18 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.designers} user_verified_as={props.user_verified.designers}
verified_count={props.building.verified.designers} verified_count={props.building.verified.designers}
/> />
<MultiDataEntry
title={dataFields.designers_links.title}
slug="designers_links"
value={props.building.designers_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.designers_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
<SelectDataEntry <SelectDataEntry
slug='lead_designer_type' slug='lead_designer_type'
title={dataFields.lead_designer_type.title} title={dataFields.lead_designer_type.title}
@ -342,6 +378,18 @@ const TeamView: React.FunctionComponent<CategoryViewProps> = (props) => {
user_verified_as={props.user_verified.builder} user_verified_as={props.user_verified.builder}
verified_count={props.building.verified.builder} verified_count={props.building.verified.builder}
/> />
<MultiDataEntry
title={dataFields.builder_links.title}
slug="builder_links"
value={props.building.builder_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.builder_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
<SelectDataEntry <SelectDataEntry
title={dataFields.builder_source_type.title} title={dataFields.builder_source_type.title}
slug="builder_source_type" slug="builder_source_type"

View File

@ -953,6 +953,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
tooltip: "Free text. First name, space, then Last name", tooltip: "Free text. First name, space, then Last name",
example: ["", "", ""], example: ["", "", ""],
}, },
developer_links: {
category: Category.Team,
title: "Developer link(s)",
tooltip: "A link to a webpage explaining who the developer of the building was.",
example: ["", "", ""],
},
developer_source_type: { developer_source_type: {
category: Category.Team, category: Category.Team,
title: "Source type", title: "Source type",
@ -972,6 +978,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
tooltip: "Land owner when the building was constructed.<br/><br/>Free-text entry disabled for security reasons.<br/><br/>For info on current land ownership, see 'Planning Controls'.", tooltip: "Land owner when the building was constructed.<br/><br/>Free-text entry disabled for security reasons.<br/><br/>For info on current land ownership, see 'Planning Controls'.",
example: ["", "", ""], example: ["", "", ""],
}, },
landowner_links: {
category: Category.Team,
title: "Landowner link(s)",
tooltip: "A link to a webpage explaining who the land owner was when the building was built.",
example: ["", "", ""],
},
landowner_source_type: { landowner_source_type: {
category: Category.Team, category: Category.Team,
title: "Source type", title: "Source type",
@ -991,6 +1003,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
tooltip: "First name, space, then Last name.<br/><br/>Free-text entry disabled for security reasons.", tooltip: "First name, space, then Last name.<br/><br/>Free-text entry disabled for security reasons.",
example: ["", "", ""], example: ["", "", ""],
}, },
designers_links: {
category: Category.Team,
title: "Designer link(s)",
tooltip: "A link to webpage(s) explaining who the designer of the building was.",
example: ["", "", ""],
},
designers_source_type: { designers_source_type: {
category: Category.Team, category: Category.Team,
title: "Source type", title: "Source type",
@ -1034,6 +1052,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
title: "Name of builder/construction team.<br/><br/>Free-text entry disabled for security reasons.", title: "Name of builder/construction team.<br/><br/>Free-text entry disabled for security reasons.",
example: ["", "", ""], example: ["", "", ""],
}, },
builder_links: {
category: Category.Team,
title: "Builder link(s)",
tooltip: "A link to webpage(s) explaining who built the building was.",
example: ["", "", ""],
},
builder_source_type: { builder_source_type: {
category: Category.Team, category: Category.Team,
title: "Source type", title: "Source type",

View File

@ -1,4 +1,8 @@
ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link; ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link;
ALTER TABLE buildings DROP COLUMN IF EXISTS location_alternative_footprint_links; ALTER TABLE buildings DROP COLUMN IF EXISTS location_alternative_footprint_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_raster_map_links; ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_raster_map_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_vectorised_footprint_links; ALTER TABLE buildings DROP COLUMN IF EXISTS age_historical_vectorised_footprint_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS landowner_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS designers_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS builder_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS developer_links;

View File

@ -1,4 +1,8 @@
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_alternative_footprint_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_alternative_footprint_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_raster_map_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_raster_map_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_vectorised_footprint_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_historical_vectorised_footprint_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS landowner_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS designers_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS builder_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS developer_links text[];