diff --git a/app/src/frontend/building/data-containers/age.tsx b/app/src/frontend/building/data-containers/age.tsx index 18804e51..f50cd77f 100644 --- a/app/src/frontend/building/data-containers/age.tsx +++ b/app/src/frontend/building/data-containers/age.tsx @@ -2,183 +2,540 @@ import React, { Fragment } from 'react'; import { 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'; +import { FieldRow } from '../data-components/field-row'; +import { Link } from 'react-router-dom'; +import { Category } from '../../config/categories-config'; import NumericDataEntry from '../data-components/numeric-data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; -import TextboxDataEntry from '../data-components/textbox-data-entry'; import Verification from '../data-components/verification'; import YearDataEntry from '../data-components/year-data-entry'; import withCopyEdit from '../data-container'; +import DataEntry from '../data-components/data-entry'; +import InfoBox from '../../components/info-box'; import { CategoryViewProps } from './category-view-props'; +import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; + +const HistoricalStatusOptions = [ + 'The current footprint matches/almost exactly matches the historical map beneath, and/or is known to have been built before the map was made', + 'The building core is the same as the historical map but has had multiple additions/changes', + 'The building no longer exists', +]; /** * Age view/edit section */ const AgeView: React.FunctionComponent = (props) => { const currentYear = new Date().getFullYear(); + + const building = props.building; + const thisYear = (new Date()).getFullYear(); + const currentBuildingConstructionYear = building.date_year || undefined; + + const ageLinkUrl = `/${props.mode}/${Category.Age}/${props.building.building_id}`; + if (props.building.date_source == "Expert knowledge of building" || props.building.date_source == "Expert estimate from image" || props.building.date_source == null ){ return ( - + - - + allow_verify={props.user !== undefined && props.building.date_year !== null && !props.edited} + onVerify={props.onVerify} + user_verified={props.user_verified.hasOwnProperty("date_year")} + user_verified_as={props.user_verified.date_year} + verified_count={props.building.verified.date_year} + + allow_verify_upper={props.user !== undefined && props.building.date_upper !== null && !props.edited} + onVerify_upper={props.onVerify} + user_verified_upper={props.user_verified.hasOwnProperty("date_upper")} + user_verified_as_upper={props.user_verified.date_upper} + verified_count_upper={props.building.verified.date_upper} + + allow_verify_lower={props.user !== undefined && props.building.date_lower !== null && !props.edited} + onVerify_lower={props.onVerify} + user_verified_lower={props.user_verified.hasOwnProperty("date_lower")} + user_verified_as_lower={props.user_verified.date_lower} + verified_count_lower={props.building.verified.date_lower} + /> + + - - + + + + This section is under development. + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+
+ { + currentBuildingConstructionYear == undefined ? + To add historical records, fill in the Age data first. : + + <> + 0} + disallowNull={(building.demolished_buildings?.length ?? 0) > 0} + + onChange={props.onSaveChange} + mode={props.mode} + copy={props.copy} + /> + { + building.dynamics_has_demolished_buildings && + <> + + { + props.mode === 'view' && + Switch to edit mode to add/edit past building records + } + + } + + } +
+ + + + + + + This section is under development in collaboration with the historic environment sector. + Please let us know your suggestions on the discussion forum! (external link - save your edits first) + +
+ + + This section is under development. + + + +
); }; return ( - + + + + + + + + + This section is under development. + + - + - + + + + + + + + + + + +
+ +
+
+ +
+
+ +
+
+
+ { + currentBuildingConstructionYear == undefined ? + To add historical records, fill in the Age data first. : + + <> + 0} + disallowNull={(building.demolished_buildings?.length ?? 0) > 0} - - - - + { + building.dynamics_has_demolished_buildings && + <> + + { + props.mode === 'view' && + Switch to edit mode to add/edit past building records + } + + } + + } +
+ + + + + + + This section is under development in collaboration with the historic environment sector. + Please let us know your suggestions on the discussion forum! (external link - save your edits first) + +
+ + + This section is under development. + + + +
); }; diff --git a/app/src/frontend/building/data-containers/dynamics/dynamics.tsx b/app/src/frontend/building/data-containers/dynamics/dynamics.tsx deleted file mode 100644 index a91f6f71..00000000 --- a/app/src/frontend/building/data-containers/dynamics/dynamics.tsx +++ /dev/null @@ -1,140 +0,0 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; -import InfoBox from '../../../components/info-box'; - -import { Category } from '../../../config/categories-config'; -import { dataFields } from '../../../config/data-fields-config'; - -import DataEntry from '../../data-components/data-entry'; -import { DataEntryGroup } from '../../data-components/data-entry-group'; -import { DynamicsBuildingPane, DynamicsDataEntry } from './dynamics-data-entry'; -import { FieldRow } from '../../data-components/field-row'; -import NumericDataEntry from '../../data-components/numeric-data-entry'; -import withCopyEdit from '../../data-container'; - -import { CategoryViewProps } from '../category-view-props'; -import { LogicalDataEntry } from '../../data-components/logical-data-entry/logical-data-entry'; - -/** -* Dynamics view/edit section -*/ -const DynamicsView: React.FunctionComponent = (props) => { - const building = props.building; - const thisYear = (new Date()).getFullYear(); - const currentBuildingConstructionYear = building.date_year || undefined; - - const ageLinkUrl = `/${props.mode}/${Category.Age}/${props.building.building_id}`; - - return (<> - - - - -
- -
-
- -
-
- -
-
-
- { - currentBuildingConstructionYear == undefined ? - To add historical records, fill in the Age data first. : - - <> - 0} - disallowNull={(building.demolished_buildings?.length ?? 0) > 0} - - onChange={props.onSaveChange} - mode={props.mode} - copy={props.copy} - /> - { - building.dynamics_has_demolished_buildings && - <> - - { - props.mode === 'view' && - Switch to edit mode to add/edit past building records - } - - } - - } -
- - - - - - - - This section is under development in collaboration with the historic environment sector. - Please let us know your suggestions on the discussion forum! (external link - save your edits first) - - ) -}; - -const DynamicsContainer = withCopyEdit(DynamicsView); - -export default DynamicsContainer; diff --git a/app/src/frontend/building/data-containers/resilience.tsx b/app/src/frontend/building/data-containers/resilience.tsx new file mode 100644 index 00000000..73f67d6a --- /dev/null +++ b/app/src/frontend/building/data-containers/resilience.tsx @@ -0,0 +1,105 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import InfoBox from '../../components/info-box'; + +import { Category } from '../../config/categories-config'; +import { dataFields } from '../../config/data-fields-config'; + +import DataEntry from '../data-components/data-entry'; +import { DataEntryGroup } from '../data-components/data-entry-group'; +import { DynamicsBuildingPane, DynamicsDataEntry } from './dynamics/dynamics-data-entry'; +import { FieldRow } from '../data-components/field-row'; +import NumericDataEntry from '../data-components/numeric-data-entry'; +import withCopyEdit from '../data-container'; + +import { CategoryViewProps } from './category-view-props'; +import { LogicalDataEntry } from '../data-components/logical-data-entry/logical-data-entry'; + +/** +* Dynamics view/edit section +*/ +const ResilienceView: React.FunctionComponent = (props) => { + + + return (<> + + This section is under development. + + + + + + + + + + + + + + ) +}; + +const ResilienceContainer = withCopyEdit(ResilienceView); + +export default ResilienceContainer; diff --git a/app/src/frontend/building/data-containers/sustainability.tsx b/app/src/frontend/building/data-containers/sustainability.tsx index 2da6f379..93f6420e 100644 --- a/app/src/frontend/building/data-containers/sustainability.tsx +++ b/app/src/frontend/building/data-containers/sustainability.tsx @@ -6,6 +6,7 @@ import NumericDataEntry from '../data-components/numeric-data-entry'; import SelectDataEntry from '../data-components/select-data-entry'; import Verification from '../data-components/verification'; import withCopyEdit from '../data-container'; +import InfoBox from '../../components/info-box'; import { CategoryViewProps } from './category-view-props'; @@ -94,26 +95,25 @@ const SustainabilityView: React.FunctionComponent = (props) = user_verified_as={props.user_verified.sust_retrofit_date} verified_count={props.building.verified.sust_retrofit_date} /> - - + + This section is under development. + + (
-
+
diff --git a/app/src/frontend/config/categories-config.ts b/app/src/frontend/config/categories-config.ts index ae60665b..268fb657 100644 --- a/app/src/frontend/config/categories-config.ts +++ b/app/src/frontend/config/categories-config.ts @@ -13,7 +13,7 @@ export enum Category { Team = 'team', Planning = 'planning', Sustainability = 'sustainability', - Dynamics = 'dynamics', + Resilience = 'resilience', Community = 'community', } @@ -26,14 +26,14 @@ export const categoriesOrder: Category[] = [ Category.Location, Category.LandUse, Category.Type, - Category.Age, Category.Size, Category.Construction, + Category.Age, Category.Streetscape, Category.Team, Category.Planning, Category.Sustainability, - Category.Dynamics, + Category.Resilience, Category.Community, ]; @@ -48,13 +48,13 @@ interface CategoryDefinition { export const categoriesConfig: {[key in Category]: CategoryDefinition} = { [Category.Age]: { slug: 'age', - name: 'Age', + name: 'Age & History', aboutUrl: 'https://pages.colouring.london/age', intro: 'Building age data can support energy analysis and help predict long-term change.', }, [Category.Size]: { slug: 'size', - name: 'Size', + name: 'Size & Form', aboutUrl: 'https://pages.colouring.london/shapeandsize', intro: 'How big are buildings?', }, @@ -84,19 +84,19 @@ export const categoriesConfig: {[key in Category]: CategoryDefinition} = { }, [Category.Planning]: { slug: 'planning', - name: 'Planning', + name: 'Planning Controls', aboutUrl: 'https://pages.colouring.london/planning', intro: 'Planning controls relating to protection and reuse.', }, [Category.Sustainability]: { slug: 'sustainability', - name: 'Sustainability', + name: 'Energy Performance', aboutUrl: 'https://pages.colouring.london/sustainability', intro: 'Are buildings energy efficient?', }, [Category.Type]: { slug: 'type', - name: 'Type', + name: 'Typology', aboutUrl: 'https://pages.colouring.london/buildingtypology', intro: 'How were buildings previously used?', }, @@ -113,9 +113,9 @@ export const categoriesConfig: {[key in Category]: CategoryDefinition} = { aboutUrl: 'https://pages.colouring.london/greenery', intro: "What's the building's context? Coming soon…", }, - [Category.Dynamics]: { - slug: 'dynamics', - name: 'Dynamics', + [Category.Resilience]: { + slug: 'resilience', + name: 'Resilience', aboutUrl: 'https://pages.colouring.london/dynamics', intro: 'How has the site of this building changed over time?' }, diff --git a/app/src/frontend/config/category-maps-config.ts b/app/src/frontend/config/category-maps-config.ts index 2c267ace..9ce6ced7 100644 --- a/app/src/frontend/config/category-maps-config.ts +++ b/app/src/frontend/config/category-maps-config.ts @@ -317,10 +317,10 @@ export const categoryMapsConfig: {[key in Category]: CategoryMapDefinition[]} = elements: [] }, }], - [Category.Dynamics]: [{ + [Category.Resilience]: [{ mapStyle: 'dynamics_demolished_count', legend: { - title: 'Dynamics', + title: 'Resilience', description: 'Demolished buildings on the same site', elements: [ { diff --git a/app/src/frontend/config/category-ui-config.ts b/app/src/frontend/config/category-ui-config.ts index ac41ba2d..8f828b8e 100644 --- a/app/src/frontend/config/category-ui-config.ts +++ b/app/src/frontend/config/category-ui-config.ts @@ -3,7 +3,7 @@ import { Category } from './categories-config'; import AgeContainer from '../building/data-containers/age'; import CommunityContainer from '../building/data-containers/community'; import ConstructionContainer from '../building/data-containers/construction'; -import DynamicsContainer from '../building/data-containers/dynamics/dynamics'; +import ResilienceContainer from '../building/data-containers/resilience'; import LocationContainer from '../building/data-containers/location'; import PlanningContainer from '../building/data-containers/planning'; import SizeContainer from '../building/data-containers/size'; @@ -26,7 +26,7 @@ export const categoryUiConfig: {[key in Category]: DataContainerType} = { [Category.Team]: TeamContainer, [Category.Planning]: PlanningContainer, [Category.Sustainability]: SustainabilityContainer, - [Category.Dynamics]: DynamicsContainer, + [Category.Resilience]: ResilienceContainer, [Category.Community]: CommunityContainer, }; diff --git a/app/src/frontend/config/data-fields-config.ts b/app/src/frontend/config/data-fields-config.ts index 5ed1e276..31f883ed 100644 --- a/app/src/frontend/config/data-fields-config.ts +++ b/app/src/frontend/config/data-fields-config.ts @@ -452,6 +452,12 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ //tooltip: , }, + historical_status: { + category: Category.Age, + title: "Historical Status", + tooltip: "Survival and Loss tracked using Historical Maps", + }, + edit_history: { category: Category.Planning, title: "PLANNING DATA", @@ -613,13 +619,13 @@ export const dataFields = { /* eslint-disable @typescript-eslint/camelcase */ }, dynamics_has_demolished_buildings: { - category: Category.Dynamics, + category: Category.Resilience, title: 'Were any other buildings ever built on this site?', example: true, }, demolished_buildings: { - category: Category.Dynamics, + category: Category.Resilience, title: 'Past (demolished) buildings on this site', items: { year_constructed: { diff --git a/app/src/frontend/styles/colours.css b/app/src/frontend/styles/colours.css index 14d54e60..9c28b5f9 100644 --- a/app/src/frontend/styles/colours.css +++ b/app/src/frontend/styles/colours.css @@ -66,13 +66,13 @@ background-color: #f77d11; } .background-age { - background-color: #ff6161; + background-color: #ab8fb0; } .background-size { - background-color: #f2a2b9; + background-color: #ff6161; } .background-construction { - background-color: #ab8fb0; + background-color: #f2a2b9; } .background-streetscape { background-color: #718899; @@ -86,7 +86,7 @@ .background-sustainability { background-color: #6bb1e3; } -.background-dynamics { +.background-resilience { background-color: #aaaaaa; } .background-community {