Size / Age & History Sources

Adding source link(s) field to activated data sources in the Size category and the Age & History category
This commit is contained in:
Mike Simpson 2023-05-23 21:27:45 +01:00
parent 4c32710358
commit 19c906fcc5
8 changed files with 333 additions and 94 deletions

View File

@ -154,10 +154,38 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true,
},
size_storeys_source_type: {
edit: true,
verify: true,
},
size_storeys_source_links: {
edit: true,
verify: true,
},
size_height_apex: {
edit: true,
verify: true,
},
size_height_apex_source_type: {
edit: true,
verify: true,
},
size_height_apex_source_links: {
edit: true,
verify: true,
},
size_height_eaves: {
edit: true,
verify: true,
},
size_height_eaves_source_type: {
edit: true,
verify: true,
},
size_height_eaves_source_links: {
edit: true,
verify: true,
},
size_floor_area_ground: {
edit: true,
verify: true,
@ -166,10 +194,26 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true,
},
size_floor_area_source_type: {
edit: true,
verify: true,
},
size_floor_area_source_links: {
edit: true,
verify: true,
},
size_width_frontage: {
edit: true,
verify: true,
},
size_width_frontage_source_type: {
edit: true,
verify: true,
},
size_width_frontage_source_links: {
edit: true,
verify: true,
},
construction_core_material: {
edit: true,
verify: true,
@ -326,6 +370,10 @@ export const buildingAttributesConfig = valueType<DataFieldConfig>()({ /* eslint
edit: true,
verify: true
},
survival_source_links: {
edit: true,
verify: true
},
likes_total: {
edit: false,
derivedEdit: true,

View File

@ -106,14 +106,6 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
placeholder={dataFields.date_source.example}
options={dataFields.date_source.items}
/>
<Verification
slug="date_source"
allow_verify={props.user !== undefined && props.building.date_source !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_source")}
user_verified_as={props.user_verified.date_source}
verified_count={props.building.verified.date_source}
/>
<hr/>
<InfoBox type='warning'>
This section is under development.
@ -258,6 +250,23 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
placeholder={dataFields.survival_source.example}
options={dataFields.survival_source.items}
/>
{(props.building.survival_source == dataFields.survival_source_links[0] ||
props.building.survival_source == dataFields.survival_source_links[1] ||
props.building.survival_source == null) ? <></> :
<><MultiDataEntry
title={dataFields.survival_source_links.title}
slug="survival_source_links"
value={props.building.survival_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.survival_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
</Fragment>
);
@ -322,14 +331,6 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
options={dataFields.date_source.items}
placeholder={dataFields.date_source.example}
/>
<Verification
slug="date_source"
allow_verify={props.user !== undefined && props.building.date_source !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_source")}
user_verified_as={props.user_verified.date_source}
verified_count={props.building.verified.date_source}
/>
<MultiDataEntry
title={dataFields.date_link.title}
slug="date_link"
@ -342,14 +343,6 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
editableEntries={true}
isUrl={true}
/>
<Verification
slug="date_link"
allow_verify={props.user !== undefined && props.building.date_link !== null && !props.edited}
onVerify={props.onVerify}
user_verified={props.user_verified.hasOwnProperty("date_link")}
user_verified_as={props.user_verified.date_link}
verified_count={props.building.verified.date_link}
/>
<hr/>
<InfoBox type='warning'>
This section is under development.
@ -536,6 +529,23 @@ const AgeView: React.FunctionComponent<CategoryViewProps> = (props) => {
placeholder={dataFields.survival_source.example}
options={dataFields.survival_source.items}
/>
{(props.building.survival_source == dataFields.survival_source.items[0] ||
props.building.survival_source == dataFields.survival_source.items[1] ||
props.building.survival_source == null) ? <></> :
<><MultiDataEntry
title={dataFields.survival_source_links.title}
slug="survival_source_links"
value={props.building.survival_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.survival_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
</Fragment>
);

View File

@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import { dataFields } from '../../config/data-fields-config';
import { commonSourceTypes, dataFields } from '../../config/data-fields-config';
import DataEntry from '../data-components/data-entry';
import { DataEntryGroup } from '../data-components/data-entry-group';
import NumericDataEntry from '../data-components/numeric-data-entry';
@ -10,6 +10,7 @@ import withCopyEdit from '../data-container';
import { CategoryViewProps } from './category-view-props';
import InfoBox from '../../components/info-box';
import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry';
/**
* Size view/edit section
@ -74,20 +75,33 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
user_verified_as={props.user_verified.size_storeys_basement}
verified_count={props.building.verified.size_storeys_basement}
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
<SelectDataEntry
title={dataFields.size_storeys_source_type.title}
slug="size_storeys_source_type"
value={props.building.size_storeys_source_type}
options={dataFields.size_storeys_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_storeys_source_type.tooltip}
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
{(props.building.size_storeys_source_type == commonSourceTypes[0] ||
props.building.size_storeys_source_type == commonSourceTypes[1] ||
props.building.size_storeys_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_storeys_source_links.title}
slug="size_storeys_source_links"
value={props.building.size_storeys_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_storeys_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
<DataEntryGroup name="Building height data">
<NumericDataEntry
@ -108,25 +122,37 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
user_verified_as={props.user_verified.size_height_apex}
verified_count={props.building.verified.size_height_apex}
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
<SelectDataEntry
title={dataFields.size_height_apex_source_type.title}
slug="size_height_apex_source_type"
value={props.building.size_height_apex_source_type}
options={dataFields.size_height_apex_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_height_apex_source_type.tooltip}
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
{(props.building.size_height_apex_source_type == commonSourceTypes[0] ||
props.building.size_height_apex_source_type == commonSourceTypes[1] ||
props.building.size_height_apex_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_height_apex_source_links.title}
slug="size_height_apex_source_links"
value={props.building.size_height_apex_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_height_apex_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
<hr/>
<NumericDataEntry
title={dataFields.size_height_eaves.title}
slug="size_height_eaves"
disabled={true}
value={props.building.size_height_eaves}
mode={props.mode}
copy={props.copy}
@ -134,20 +160,33 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
step={0.1}
min={0}
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
<SelectDataEntry
title={dataFields.size_height_eaves_source_type.title}
slug="size_height_eaves_source_type"
value={props.building.size_height_eaves_source_type}
options={dataFields.size_height_eaves_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_height_eaves_source_type.tooltip}
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
{(props.building.size_height_eaves_source_type == commonSourceTypes[0] ||
props.building.size_height_eaves_source_type == commonSourceTypes[1] ||
props.building.size_height_eaves_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_height_eaves_source_links.title}
slug="size_height_eaves_source_links"
value={props.building.size_height_eaves_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_height_eaves_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
<DataEntryGroup name="Floor area data">
<NumericDataEntry
@ -186,13 +225,33 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
user_verified_as={props.user_verified.size_floor_area_total}
verified_count={props.building.verified.size_floor_area_total}
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
<SelectDataEntry
title={dataFields.size_floor_area_source_type.title}
slug="size_floor_area_source_type"
value={props.building.size_floor_area_source_type}
options={dataFields.size_floor_area_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_floor_area_source_type.tooltip}
/>
{(props.building.size_floor_area_source_type == commonSourceTypes[0] ||
props.building.size_floor_area_source_type == commonSourceTypes[1] ||
props.building.size_floor_area_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_floor_area_source_links.title}
slug="size_floor_area_source_links"
value={props.building.size_floor_area_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_floor_area_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
<DataEntryGroup name="Plot size data">
<NumericDataEntry
@ -300,20 +359,33 @@ const SizeView: React.FunctionComponent<CategoryViewProps> = (props) => (
user_verified_as={props.user_verified.size_width_frontage}
verified_count={props.building.verified.size_width_frontage}
/>
<DataEntry
title="Source type"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
<SelectDataEntry
title={dataFields.size_width_frontage_source_type.title}
slug="size_width_frontage_source_type"
value={props.building.size_width_frontage_source_type}
options={dataFields.size_width_frontage_source_type.items}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_width_frontage_source_type.tooltip}
/>
<DataEntry
title="Source link"
slug=""
value=""
mode='view'
tooltip="Coming Soon"
{(props.building.size_width_frontage_source_type == commonSourceTypes[0] ||
props.building.size_width_frontage_source_type == commonSourceTypes[1] ||
props.building.size_width_frontage_source_type == null) ? <></> :
<><MultiDataEntry
title={dataFields.size_width_frontage_source_links.title}
slug="size_width_frontage_source_links"
value={props.building.size_width_frontage_source_links}
mode={props.mode}
copy={props.copy}
onChange={props.onChange}
tooltip={dataFields.size_width_frontage_source_links.tooltip}
placeholder="https://..."
editableEntries={true}
isUrl={true}
/>
</>
}
</DataEntryGroup>
</Fragment>
);

View File

@ -373,7 +373,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
},
date_link: {
category: Category.Age,
title: "Text and Image Links",
title: "Source link(s)",
tooltip: "URL for age and date reference",
example: ["", "", ""],
},
@ -396,18 +396,57 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
tooltip: "How many floors below pavement level?",
example: 1,
},
size_storeys_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of building floors data",
example: "",
items: commonSourceTypes
},
size_storeys_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for building floors data source(s)",
example: ["", "", ""],
},
size_height_apex: {
category: Category.Size,
title: "Height to apex (m)",
example: 100.5,
tooltip: "i.e. the highest part of the roof.",
},
size_height_apex_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of building height (apex) data",
example: "",
items: commonSourceTypes
},
size_height_apex_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for building height (apex) source(s)",
example: ["", "", ""],
},
size_height_eaves: {
category: Category.Size,
title: "Height to eaves (m)",
example: 20.33,
tooltip: "i.e. to where the top of the wall meets the roof",
},
size_height_eaves_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of building height (eaves) data",
example: "",
items: commonSourceTypes
},
size_height_eaves_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for building height (eaves) source(s)",
example: ["", "", ""],
},
size_floor_area_ground: {
category: Category.Size,
title: "Ground floor area (m²)",
@ -420,12 +459,38 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
example: 2001.7,
//tooltip: ,
},
size_floor_area_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of floor area data",
example: "",
items: commonSourceTypes
},
size_floor_area_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for floor area data source(s)",
example: ["", "", ""],
},
size_width_frontage: {
category: Category.Size,
title: "Frontage width (m)",
example: 12.2,
//tooltip: ,
},
size_width_frontage_source_type: {
category: Category.Team,
title: "Source type",
tooltip: "Source of building frontage data",
example: "",
items: commonSourceTypes
},
size_width_frontage_source_links: {
category: Category.Team,
title: "Source links",
tooltip: "URL(s) for building frontage source(s)",
example: ["", "", ""],
},
size_configuration: {
category: Category.Size,
@ -514,7 +579,7 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
survival_source: {
category: Category.Age,
title: "Source of survival information",
title: "Source type",
tooltip: "Source for the survival status",
items: [
"Matched by comparing maps",
@ -525,10 +590,10 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */
example: "",
},
survival_link: {
survival_source_links: {
category: Category.Age,
title: "Please add any additional text or image links providing historical information on this building",
tooltip: "URL for age and date reference",
title: "Source link(s)",
tooltip: "Links to sources of survival/historical information on this building",
example: ["", "", ""],
},

View File

@ -63,9 +63,18 @@ This is the main table, containing almost all data collected by Colouring London
- `size_storeys_attic`: number of attic storeys
- `size_storeys_core`: number of core storeys
- `size_storeys_basement`: number of basement storeys
- `size_storeys_source_type`: source type for number of storeys
- `size_storeys_source_links`: source links for number of storeys
- `size_height_apex`: height in metres to the building apex
- `size_height_apex_source_type`: source of apex height data
- `size_height_apex_source_links`: links to apex height data
- `size_height_eaves`: height in metres to the building eaves
- `size_height_eaves_source_type`: source of eaves height data
- `size_height_eaves_source_links`: links to eaves height data
- `size_floor_area_ground`: ground floor floor area in square metres
- `size_floor_area_total`: total floor area in square metres
- `size_floor_area_source_type`: source of floor area data
- `size_floor_area_source_links`: link(s) to floor area data
- `size_width_frontage`: width of frontage in metres
- `construction_core_material`: main structural material
- `construction_secondary_materials`: other structural materials
@ -91,7 +100,10 @@ This is the main table, containing almost all data collected by Colouring London
- `likes_total`: number of times the building has been liked by Colouring London users
- `is_domestic`: is the building domestic/non-domestic/mixed
- `is_domestic_source`: domestic data source type,
-`is_domestic_links`: domestic data source links,
- `is_domestic_links`: domestic data source links,
- `survival_status`: survival status compared to historical maps,
- `survival_source`: source of survival data,
- `survival_links`: link(s) to survival data source,
## Building UPRNs

View File

@ -31,9 +31,18 @@ COPY (SELECT
size_storeys_attic,
size_storeys_core,
size_storeys_basement,
size_storeys_source_type,
size_storeys_source_links,
size_height_apex,
size_height_apex_source_type,
size_height_apex_source_links,
size_height_eaves,
size_height_eaves_source_type,
size_height_eaves_source_links,
size_floor_area_ground,
size_floor_area_total,
size_floor_area_source_type,
size_floor_area_source_links,
size_width_frontage,
sust_breeam_rating,
sust_dec,
@ -63,6 +72,7 @@ COPY (SELECT
likes_total,
survival_status,
survival_source,
survival_source_links,
disaster_type,
disaster_severity,
disaster_assessment_method,

View File

@ -4,3 +4,13 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS location_coordinates_source;
ALTER TABLE buildings DROP COLUMN IF EXISTS location_coordinates_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS is_domestic_source;
ALTER TABLE buildings DROP COLUMN IF EXISTS is_domestic_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_storeys_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_storeys_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_height_apex_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_height_apex_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_height_eaves_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_height_eaves_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_height_eaves;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_width_frontage_source_type;
ALTER TABLE buildings DROP COLUMN IF EXISTS size_width_frontage_source_links;
ALTER TABLE buildings DROP COLUMN IF EXISTS survival_source_links;

View File

@ -4,3 +4,15 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_coordinates_source text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS location_coordinates_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic_source text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS is_domestic_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_storeys_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_storeys_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_height_apex_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_height_apex_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_height_eaves_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_height_eaves_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_height_eaves text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_floor_area_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_floor_area_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_width_frontage_source_type text;
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS size_width_frontage_source_links text[];
ALTER TABLE buildings ADD COLUMN IF NOT EXISTS survival_source_links text[];