Add Building Name link

This commit is contained in:
Mike Simpson 2023-06-27 19:39:19 +01:00
parent e150b1b36f
commit 35611f87da
6 changed files with 29 additions and 6 deletions

View File

@ -59,6 +59,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true,
},
location_name_link: {
edit: true,
verify: true,
},
location_number: {
edit: true,
verify: true,

View File

@ -48,12 +48,22 @@ const LocationView: React.FunctionComponent<CategoryViewProps> = (props) => {
tooltip="Not yet activated.<br><br>For security reasons, we do not allow the use of free text boxes and are currently looking into alternative ways to collect this data."
/>
<DataEntry
title="Building name link"
slug=""
value=""
mode='view'
tooltip="Under Development.<br><br>Please enter a link to a webpage that confirms the name of this building."
title={dataFields.location_name_link.title}
slug="location_name_link"
value={props.building.location_name_link}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.location_name_link.tooltip}
placeholder={dataFields.location_name_link.example}
isUrl={true}
/>
{
(props.building.location_name_link == null) ? <></> :
<div className={`alert alert-dark`} role="alert" style={{ fontSize: 14, backgroundColor: "#f6f8f9" }}>
<i className="source-url">Source: <a href={props.building.location_name_link} target={"_blank"}>{props.building.location_name_link}</a></i>
</div>
}
<hr/>
<PatternDataEntry
title={dataFields.location_number.title}

View File

@ -145,7 +145,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
location_name: {
category: Category.Location,
title: "Building name (non-domestic)",
tooltip: "Link to a website with the name of the building.<br/><br/>(For security reasons, we currently only collect the names of non-residential buildings).",
tooltip: "The name of the building.<br/><br/>(For security reasons, we currently only collect the names of non-residential buildings).",
example: "Broadcasting House",
},
location_name_link: {
category: Category.Location,
title: "Building name link",
tooltip: "Link to a website with the name of the building.",
example: "https://en.wikipedia.org/wiki/Palace_of_Westminster",
},
location_number: {

View File

@ -4,6 +4,7 @@ COPY (SELECT
ref_osm_id,
revision_id,
location_name,
location_name_link,
location_number,
location_street,
location_line_two,

View File

@ -0,0 +1 @@
ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link;

View File

@ -0,0 +1 @@
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text;