From 089e2af6667e6ecb1a3214de72c561a2495c6617 Mon Sep 17 00:00:00 2001 From: Mike Simpson Date: Wed, 9 Aug 2023 14:47:41 +0100 Subject: [PATCH] Move Architectural style data - Now in Age/History - Tweaks to text, fix typos, dates, text layout - Also fix "click here to show historical maps" button on Age & History page --- app/map_styles/polygon.xml | 4 +- .../building/data-containers/age-history.tsx | 110 +++++++++++++++--- .../building/data-containers/typology.tsx | 12 +- .../frontend/config/category-maps-config.ts | 41 +++++-- app/src/frontend/config/data-fields-config.ts | 4 +- 5 files changed, 136 insertions(+), 35 deletions(-) diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index eae2b562..b886e461 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -1113,7 +1113,7 @@ - [typology_style_period] = "1603 -1714 (Stuart)" + [typology_style_period] = "1603-1714 (Stuart)" @@ -1129,7 +1129,7 @@ - [typology_style_period] = "1914-45 (WWI - WWII)" + [typology_style_period] = "1914-1945 (WWI-WWII)" diff --git a/app/src/frontend/building/data-containers/age-history.tsx b/app/src/frontend/building/data-containers/age-history.tsx index 47d2459e..3ee13b94 100644 --- a/app/src/frontend/building/data-containers/age-history.tsx +++ b/app/src/frontend/building/data-containers/age-history.tsx @@ -1,7 +1,7 @@ import React, { Fragment } from 'react'; import '../../map/map-button.css'; -import { dataFields } from '../../config/data-fields-config'; +import { commonSourceTypes, dataFields } from '../../config/data-fields-config'; import { MultiDataEntry } from '../data-components/multi-data-entry/multi-data-entry'; import { DataEntryGroup } from '../data-components/data-entry-group'; import { DynamicsBuildingPane, DynamicsDataEntry } from './dynamics/dynamics-data-entry'; @@ -43,20 +43,29 @@ const AgeView: React.FunctionComponent = (props) => { const switchToSurvivalMapStyle = (e) => { e.preventDefault(); + props.onMapColourScale('survival_status'); + historicDataSwitchOnClick(e); + } - if (props.mapColourScale == "survival_status") { - props.onMapColourScale('date_year'); - historicDataSwitchOnClick(e); - } - else { - props.onMapColourScale('survival_status'); + const switchToAgeMapStyle = (e) => { + e.preventDefault(); + + if (props.mapColourScale == "survival_status") + { historicDataSwitchOnClick(e); } + + props.onMapColourScale('date_year') + } + + const switchToStylePeriodMapStyle = (e) => { + e.preventDefault(); + props.onMapColourScale('typology_style_period') } return ( - + = (props) => { tooltip='Coming Soon' />*/} + + {(props.mapColourScale == "typology_style_period") ? + + : + + } + + +
+ For building age by year see Age & History. +
+ + {(props.building.typology_style_period_source_type == commonSourceTypes[0] || + props.building.typology_style_period_source_type == commonSourceTypes[1] || + props.building.typology_style_period_source_type == null) ? <> : + <> + + + } +
= (props) => { } - + {(props.mapColourScale == "survival_status") ? + + : + + } @@ -419,9 +495,15 @@ const AgeView: React.FunctionComponent = (props) => { Choose a colour to indicate whether the building has survived. - + {(props.mapColourScale == "survival_status") ? + + : + + } = (props) => { } - + {(props.mapColourScale == "typology_style_period") ? } - = (props) => { user_verified={props.user_verified.hasOwnProperty("typology_style_period")} user_verified_as={props.user_verified.typology_style_period} verified_count={props.building.verified.typology_style_period} - /> + /> */}
- For building age by year see Age & History. + For building age/architectural style data, see Age & History.
- = (props) => { isUrl={true} /> - } + } */}
{(props.mapColourScale == "typology_dynamic_classification") ? diff --git a/app/src/frontend/config/category-maps-config.ts b/app/src/frontend/config/category-maps-config.ts index 58d7a62c..911153c3 100644 --- a/app/src/frontend/config/category-maps-config.ts +++ b/app/src/frontend/config/category-maps-config.ts @@ -48,6 +48,25 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} = ] }, }, + { + mapStyle: 'typology_style_period', + legend: { + title: 'Architectural style', + elements: [ + { color: '#FFF739', text: '43AD-410 (Roman)' }, + { color: '#C5BD00', text: '410-1485 (Medieval)' }, + { color: '#FF9A39', text: '1485-1603 (Tudor)' }, + { color: '#C56000', text: '1603-1714 (Stuart)' }, + { color: '#EA8072', text: '1714-1837 (Georgian)' }, + { color: '#A71200', text: '1837-1901 (Victorian)' }, + { color: '#A272D4', text: '1901-1914 (Edwardian)' }, + { color: '#3988C5', text: '1914-1945 (WWI-WWII)' }, + { color: '#5ADFA2', text: '1945-1979 (Post war)' }, + { color: '#C2F47A', text: '1980-1999 (Late C20)' }, + { color: '#6FB40A', text: '2000-2025 (Early C21)' }, + ] + } + }, { mapStyle: 'survival_status', legend: { @@ -322,17 +341,17 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} = legend: { title: 'Architectural style', elements: [ - { color: '#FFF739', text: 'Roman (43AD-410)' }, - { color: '#C5BD00', text: 'Medieval (410-1485)' }, - { color: '#FF9A39', text: 'Tudor (1485-1603)' }, - { color: '#C56000', text: 'Stuart (1603 -1714)' }, - { color: '#EA8072', text: 'Georgian (1714-1837)' }, - { color: '#A71200', text: 'Victorian (1837-1901)' }, - { color: '#A272D4', text: 'Edwardian (1901-1914)' }, - { color: '#3988C5', text: 'WWI - WWII (1914-45)' }, - { color: '#5ADFA2', text: 'Post war (1945-1975)' }, - { color: '#C2F47A', text: 'Late C20th (1975-2000)' }, - { color: '#6FB40A', text: 'Early C21st (2000- )' }, + { color: '#FFF739', text: '43AD-410 (Roman)' }, + { color: '#C5BD00', text: '410-1485 (Medieval)' }, + { color: '#FF9A39', text: '1485-1603 (Tudor)' }, + { color: '#C56000', text: '1603-1714 (Stuart)' }, + { color: '#EA8072', text: '1714-1837 (Georgian)' }, + { color: '#A71200', text: '1837-1901 (Victorian)' }, + { color: '#A272D4', text: '1901-1914 (Edwardian)' }, + { color: '#3988C5', text: '1914-1945 (WWI-WWII)' }, + { color: '#5ADFA2', text: '1945-1979 (Post war)' }, + { color: '#C2F47A', text: '1980-1999 (Late C20)' }, + { color: '#6FB40A', text: '2000-2025 (Early C21)' }, ] } }, diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index e2a9d4d0..7933e368 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -1779,11 +1779,11 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ '43AD-410 (Roman)', '410-1485 (Medieval)', '1485-1603 (Tudor)', - '1603 -1714 (Stuart)', + '1603-1714 (Stuart)', '1714-1837 (Georgian)', '1837-1901 (Victorian)', '1901-1914 (Edwardian)', - '1914-45 (WWI - WWII)',, + '1914-1945 (WWI-WWII)',, '1945-1979 (Post war)', '1980-1999 (Late 20th Century)', '2000-2025 (Early 21st Century)',