diff --git a/app/src/api/config/dataFields.ts b/app/src/api/config/dataFields.ts index 031aa840..8f150f47 100644 --- a/app/src/api/config/dataFields.ts +++ b/app/src/api/config/dataFields.ts @@ -646,7 +646,43 @@ export const buildingAttributesConfig = valueType()({ /* eslint edit: true, verify: true }, - ccontext_tree_distance_source_links : { + context_tree_distance_source_links : { + edit: true, + verify: true + }, + age_cladding_date : { + edit: true, + verify: true + }, + age_cladding_date_source_type : { + edit: true, + verify: true + }, + age_cladding_date_source_links : { + edit: true, + verify: true + }, + age_extension_date : { + edit: true, + verify: true + }, + age_extension_date_source_type : { + edit: true, + verify: true + }, + age_extension_date_source_links : { + edit: true, + verify: true + }, + age_retrofit_date : { + edit: true, + verify: true + }, + age_retrofit_date_source_type : { + edit: true, + verify: true + }, + age_retrofit_date_source_links : { edit: true, verify: true } diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index 0b491e85..e19e5807 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -123,29 +123,158 @@ const AgeView: React.FunctionComponent = (props) => { isUrl={true} /> - } + } + + + + + + {(props.building.age_cladding_date_source_type == dataFields.age_cladding_date_source_type.items[0] || + props.building.age_cladding_date_source_type == dataFields.age_cladding_date_source_type.items[1] || + props.building.age_cladding_date_source_type == null) ? <> : + <> + + + }
- - This section is under development. - - - - + + + + {(props.building.age_extension_date_source_type == dataFields.age_extension_date_source_type.items[0] || + props.building.age_extension_date_source_type == dataFields.age_extension_date_source_type.items[1] || + props.building.age_extension_date_source_type == null) ? <> : + <> + + + } +
+ + + + {(props.building.age_retrofit_date_source_type == dataFields.age_retrofit_date_source_type.items[0] || + props.building.age_retrofit_date_source_type == dataFields.age_retrofit_date_source_type.items[1] || + props.building.age_retrofit_date_source_type == null) ? <> : + <> + + + }
diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 79207253..388a8d0f 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -1234,6 +1234,63 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ tooltip: "Source link(s) for tree data", example: ["", "", ""], }, + age_cladding_date: { + category: Category.Age, + title: "Cladding date", + tooltip: "Width of the street in metres.", + example: 1970 + }, + age_cladding_date_source_type: { + category: Category.Age, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + age_cladding_date_source_links: { + category: Category.Age, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, + age_extension_date: { + category: Category.Age, + title: "Date of significant extensions", + tooltip: "Width of the street in metres.", + example: 1970 + }, + age_extension_date_source_type: { + category: Category.Age, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + age_extension_date_source_links: { + category: Category.Age, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, + age_retrofit_date: { + category: Category.Age, + title: "Date of significant retrofits", + tooltip: "Width of the street in metres.", + example: 1970 + }, + age_retrofit_date_source_type: { + category: Category.Age, + title: "Source type", + tooltip: "Source type for street width data", + example: "", + items: commonSourceTypes + }, + age_retrofit_date_source_links: { + category: Category.Age, + title: "Source link(s)", + tooltip: "Source link(s) for street width data", + example: ["", "", ""], + }, }; export const allFieldsConfig = { ...dataFields, ...buildingUserFields }; \ No newline at end of file diff --git a/maintenance/extract_data/export_attributes.sql b/maintenance/extract_data/export_attributes.sql index b874f26c..b87926f7 100644 --- a/maintenance/extract_data/export_attributes.sql +++ b/maintenance/extract_data/export_attributes.sql @@ -107,7 +107,16 @@ COPY (SELECT context_green_space_distance_source_links, context_tree_distance, context_tree_distance_source_type, - ccontext_tree_distance_source_links + context_tree_distance_source_links, + age_cladding_date, + age_cladding_date_source_type, + age_cladding_date_source_links, + age_extension_date, + age_extension_date_source_type, + age_extension_date_source_links, + age_retrofit_date, + age_retrofit_date_source_type, + age_retrofit_date_source_links, FROM buildings) TO '/tmp/building_attributes.csv' WITH CSV HEADER diff --git a/migrations/040.ui_revamp_sources.down.sql b/migrations/040.ui_revamp_sources.down.sql index 75c07ebe..41fe9be1 100644 --- a/migrations/040.ui_revamp_sources.down.sql +++ b/migrations/040.ui_revamp_sources.down.sql @@ -47,4 +47,13 @@ ALTER TABLE buildings DROP COLUMN IF EXISTS context_tree_distance_source_type; ALTER TABLE buildings DROP COLUMN IF EXISTS context_tree_distance_source_links; ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry; ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry_source_type; -ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry_source_links; \ No newline at end of file +ALTER TABLE buildings DROP COLUMN IF EXISTS context_street_geometry_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_cladding_date; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_cladding_date_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_cladding_date_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_extension_date; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_extension_date_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_extension_date_source_links; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_retrofit_date; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_retrofit_date_source_type; +ALTER TABLE buildings DROP COLUMN IF EXISTS age_retrofit_date_source_links; \ No newline at end of file diff --git a/migrations/040.ui_revamp_sources.up.sql b/migrations/040.ui_revamp_sources.up.sql index f27fdb1a..80856473 100644 --- a/migrations/040.ui_revamp_sources.up.sql +++ b/migrations/040.ui_revamp_sources.up.sql @@ -49,4 +49,13 @@ ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_tree_distance_source_type ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_tree_distance_source_links text[]; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry text; ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry_source_type text; -ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry_source_links text[]; \ No newline at end of file +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS context_street_geometry_source_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_cladding_date text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_cladding_date_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_cladding_date_source_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_extension_date text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_extension_date_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_extension_date_source_links text[]; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_retrofit_date text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_retrofit_date_source_type text; +ALTER TABLE buildings ADD COLUMN IF NOT EXISTS age_retrofit_date_source_links text[]; \ No newline at end of file