Add Building Name link
This commit is contained in:
parent
e150b1b36f
commit
35611f87da
@ -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,
|
||||
|
@ -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}
|
||||
|
@ -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: {
|
||||
|
@ -4,6 +4,7 @@ COPY (SELECT
|
||||
ref_osm_id,
|
||||
revision_id,
|
||||
location_name,
|
||||
location_name_link,
|
||||
location_number,
|
||||
location_street,
|
||||
location_line_two,
|
||||
|
1
migrations/041.ui_revamp_tweaks.down.sql
Normal file
1
migrations/041.ui_revamp_tweaks.down.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE buildings DROP COLUMN IF EXISTS location_name_link;
|
1
migrations/041.ui_revamp_tweaks.up.sql
Normal file
1
migrations/041.ui_revamp_tweaks.up.sql
Normal file
@ -0,0 +1 @@
|
||||
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_name_link text;
|
Loading…
Reference in New Issue
Block a user