From 42b77b6ae92716e2587af8b51176b50930da8c91 Mon Sep 17 00:00:00 2001 From: augustlindemer <118665588+augustlindemer@users.noreply.github.com> Date: Thu, 5 Sep 2024 13:06:55 +0100 Subject: [PATCH] feat: add Lost/Gained list schema to GLA residential units (#3588) --- .../src/@planx/components/List/Editor.tsx | 10 + .../List/schemas/ResidentialUnits/Existing.ts | 44 ++-- .../schemas/ResidentialUnits/GLA/Gained.ts | 215 ++++++++++++++++++ .../List/schemas/ResidentialUnits/GLA/Lost.ts | 215 ++++++++++++++++++ .../List/schemas/ResidentialUnits/Proposed.ts | 46 ++-- 5 files changed, 486 insertions(+), 44 deletions(-) create mode 100644 editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Gained.ts create mode 100644 editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Lost.ts diff --git a/editor.planx.uk/src/@planx/components/List/Editor.tsx b/editor.planx.uk/src/@planx/components/List/Editor.tsx index 563c9b6c7d..bd4d1b87ec 100644 --- a/editor.planx.uk/src/@planx/components/List/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/List/Editor.tsx @@ -29,6 +29,8 @@ import { ResidentialUnitsGLANew } from "./schemas/ResidentialUnits/GLA/New"; import { ResidentialUnitsGLARebuilt } from "./schemas/ResidentialUnits/GLA/Rebuilt"; import { ResidentialUnitsGLARemoved } from "./schemas/ResidentialUnits/GLA/Removed"; import { ResidentialUnitsGLARetained } from "./schemas/ResidentialUnits/GLA/Retained"; +import { ResidentialUnitsGLALost } from "./schemas/ResidentialUnits/GLA/Lost"; +import { ResidentialUnitsGLAGained } from "./schemas/ResidentialUnits/GLA/Gained"; import { ResidentialUnitsProposed } from "./schemas/ResidentialUnits/Proposed"; import { Trees } from "./schemas/Trees"; import { TreesMapFirst } from "./schemas/TreesMapFirst"; @@ -54,6 +56,14 @@ export const SCHEMAS = [ name: "Residential units (GLA) - Retained", schema: ResidentialUnitsGLARetained, }, + { + name: "Residential units (GLA) - Lost", + schema: ResidentialUnitsGLALost, + }, + { + name: "Residential units (GLA) - Gained", + schema: ResidentialUnitsGLAGained, + }, { name: "Non-residential floorspace", schema: NonResidentialFloorspace }, { name: "Existing and proposed uses (GLA)", diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Existing.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Existing.ts index fe76b8d0e0..bc8d4353b9 100644 --- a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Existing.ts +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Existing.ts @@ -3,6 +3,27 @@ import { Schema } from "@planx/components/shared/Schema/model"; export const ResidentialUnitsExisting: Schema = { type: "Existing residential unit type", fields: [ + { + type: "question", + data: { + title: "What best describes the type of this unit?", + fn: "type", + options: [ + { id: "house", data: { text: "House", val: "house" } }, + { + id: "flat", + data: { text: "Flat, apartment or maisonette", val: "flat" }, + }, + { + id: "sheltered", + data: { text: "Sheltered housing", val: "sheltered" }, + }, + { id: "studio", data: { text: "Studio or bedsit", val: "studio" } }, + { id: "cluster", data: { text: "Cluster flat", val: "cluster" } }, + { id: "other", data: { text: "Other", val: "other" } }, + ], + }, + }, { type: "question", data: { @@ -30,27 +51,6 @@ export const ResidentialUnitsExisting: Schema = { ], }, }, - { - type: "question", - data: { - title: "What best describes the type of this unit?", - fn: "type", - options: [ - { id: "house", data: { text: "House", val: "house" } }, - { - id: "flat", - data: { text: "Flat, apartment or maisonette", val: "flat" }, - }, - { - id: "sheltered", - data: { text: "Sheltered housing", val: "sheltered" }, - }, - { id: "studio", data: { text: "Studio or bedsit", val: "studio" } }, - { id: "cluster", data: { text: "Cluster flat", val: "cluster" } }, - { id: "other", data: { text: "Other", val: "other" } }, - ], - }, - }, { type: "number", data: { @@ -62,7 +62,7 @@ export const ResidentialUnitsExisting: Schema = { { type: "number", data: { - title: "How many existing units fit the descriptions above?", + title: "How many units of the type described above exist on the site?", fn: "identicalUnits", allowNegatives: false, }, diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Gained.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Gained.ts new file mode 100644 index 0000000000..0c67dcbe81 --- /dev/null +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Gained.ts @@ -0,0 +1,215 @@ +import { Schema } from "@planx/components/shared/Schema/model"; + +export const ResidentialUnitsGLAGained: Schema = { + type: "Gained residential unit type", + fields: [ + { + type: "question", + data: { + title: "What best describes the type of this unit?", + fn: "type", + options: [ + { id: "terraced", data: { text: "Terraced home", val: "terraced" } }, + { + id: "semiDetached", + data: { text: "Semi detached home", val: "semiDetached" }, + }, + { id: "detached", data: { text: "Detached home", val: "detached" } }, + { + id: "flat", + data: { text: "Flat/apartment or maisonette", val: "flat" }, + }, + { id: "LW", data: { text: "Live/work unit", val: "LW" } }, + { id: "cluster", data: { text: "Cluster flat", val: "cluster" } }, + { id: "studio", data: { text: "Studio or bedsit", val: "studio" } }, + { id: "coLiving", data: { text: "Co living unit", val: "coLiving" } }, + { id: "hostel", data: { text: "Hostel room", val: "hostel" } }, + { id: "HMO", data: { text: "HMO", val: "HMO" } }, + { + id: "student", + data: { text: "Student accommodation", val: "student" }, + }, + { id: "other", data: { text: "Other", val: "other" } }, + ], + }, + }, + { + type: "number", + data: { + title: "What will be the Gross Internal Floor Area (GIA) of this unit?", + units: "m²", + fn: "area", + allowNegatives: false, + }, + }, + { + type: "number", + data: { + title: "How many habitable rooms will this unit have?", + fn: "habitable", + allowNegatives: false, + }, + }, + { + type: "number", + data: { + title: "How many bedrooms will this unit have?", + fn: "bedrooms", + allowNegatives: false, + }, + }, + { + type: "question", + data: { + title: "Which best describes the tenure of this unit?", + fn: "tenure", + options: [ + { id: "LAR", data: { text: "London Affordable Rent", val: "LAR" } }, + { + id: "AR", + data: { + text: "Affordable rent (not at LAR benchmark rents)", + val: "AR", + }, + }, + { id: "SR", data: { text: "Social rent", val: "SR" } }, + { id: "LRR", data: { text: "London Living Rent", val: "LRR" } }, + { + id: "sharedEquity", + data: { text: "Shared equity", val: "sharedEquity" }, + }, + { id: "LSO", data: { text: "London Shared Ownership", val: "LSO" } }, + { id: "DMS", data: { text: "Discount market sale", val: "DMS" } }, + { id: "DMR", data: { text: "Discount market rent", val: "DMR" } }, + { + id: "DMRLLR", + data: { + text: "Discount market rent (charged at London Living Rents)", + val: "DMRLLR", + }, + }, + { + id: "marketForRent", + data: { text: "Market for rent", val: "marketForRent" }, + }, + { id: "SH", data: { text: "Starter homes", val: "SH" } }, + { + id: "selfCustomBuild", + data: { + text: "Self-build and custom build", + val: "selfCustomBuild", + }, + }, + { + id: "marketForSale", + data: { text: "Market for sale", val: "marketForSale" }, + }, + { id: "other", data: { text: "Other", val: "other" } }, + ], + }, + }, + { + type: "question", + data: { + title: "What best describes the provider of this unit?", + fn: "provider", + options: [ + { id: "private", data: { text: "Private", val: "private" } }, + { + id: "privateRented", + data: { text: "Private rented sector", val: "privateRented" }, + }, + { id: "HA", data: { text: "Housing association", val: "HA" } }, + { id: "LA", data: { text: "Local authority", val: "LA" } }, + { + id: "publicAuthority", + data: { text: "Other public authority", val: "publicAuthority" }, + }, + { + id: "councilDelivery", + data: { text: "Council delivery company", val: "councilDelivery" }, + }, + { + id: "councilBuildToRent", + data: { + text: "Council delivered build to rent", + val: "councilBuildToRent", + }, + }, + { + id: "affordableHousing", + data: { + text: "Other affordable housing provider", + val: "affordableHousing", + }, + }, + { id: "selfBuild", data: { text: "Self-build", val: "selfBuild" } }, + ], + }, + }, + { + type: "checklist", + data: { + title: "Will this unit be compliant with any of the following?", + fn: "compliance", + options: [ + { + id: "m42", + data: { text: "Part M4(2) of the Building Regulations 2010" }, + }, + { + id: "m432a", + data: { text: "Part M4(3)(2a) of the Building Regulations 2010" }, + }, + { + id: "m432b", + data: { text: "Part M4(3)(2b) of the Building Regulations 2010" }, + }, + { id: "none", data: { text: "None of these" } }, + ], + }, + }, + { + type: "question", + data: { + title: "Will this unit be built on garden land?", + fn: "garden", + options: [ + { id: "true", data: { text: "Yes", val: "true" } }, + { id: "false", data: { text: "No", val: "false" } }, + ], + }, + }, + { + type: "question", + data: { + title: "Will this unit provide sheltered accommodation?", + fn: "sheltered", + options: [ + { id: "true", data: { text: "Yes", val: "true" } }, + { id: "false", data: { text: "No", val: "false" } }, + ], + }, + }, + { + type: "question", + data: { + title: "Is this unit specifically designed for older people?", + fn: "olderPersons", + options: [ + { id: "true", data: { text: "Yes", val: "true" } }, + { id: "false", data: { text: "No", val: "false" } }, + ], + }, + }, + { + type: "number", + data: { + title: "How many units of the type described above are gained?", + fn: "identicalUnits", + allowNegatives: false, + }, + }, + ], + min: 1, +} as const; diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Lost.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Lost.ts new file mode 100644 index 0000000000..0816a00e71 --- /dev/null +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Lost.ts @@ -0,0 +1,215 @@ +import { Schema } from "@planx/components/shared/Schema/model"; + +export const ResidentialUnitsGLALost: Schema = { + type: "Lost residential unit type", + fields: [ + { + type: "question", + data: { + title: "What best describes the type of this unit?", + fn: "type", + options: [ + { id: "terraced", data: { text: "Terraced home", val: "terraced" } }, + { + id: "semiDetached", + data: { text: "Semi detached home", val: "semiDetached" }, + }, + { id: "detached", data: { text: "Detached home", val: "detached" } }, + { + id: "flat", + data: { text: "Flat/apartment or maisonette", val: "flat" }, + }, + { id: "LW", data: { text: "Live/work unit", val: "LW" } }, + { id: "cluster", data: { text: "Cluster flat", val: "cluster" } }, + { id: "studio", data: { text: "Studio or bedsit", val: "studio" } }, + { id: "coLiving", data: { text: "Co living unit", val: "coLiving" } }, + { id: "hostel", data: { text: "Hostel room", val: "hostel" } }, + { id: "HMO", data: { text: "HMO", val: "HMO" } }, + { + id: "student", + data: { text: "Student accommodation", val: "student" }, + }, + { id: "other", data: { text: "Other", val: "other" } }, + ], + }, + }, + { + type: "number", + data: { + title: "What is the Gross Internal Floor Area (GIA) of this unit?", + units: "m²", + fn: "area", + allowNegatives: false, + }, + }, + { + type: "number", + data: { + title: "How many habitable rooms does this unit have?", + fn: "habitable", + allowNegatives: false, + }, + }, + { + type: "number", + data: { + title: "How many bedrooms does this unit have?", + fn: "bedrooms", + allowNegatives: false, + }, + }, + { + type: "question", + data: { + title: "Which best describes the tenure of this unit?", + fn: "tenure", + options: [ + { id: "LAR", data: { text: "London Affordable Rent", val: "LAR" } }, + { + id: "AR", + data: { + text: "Affordable rent (not at LAR benchmark rents)", + val: "AR", + }, + }, + { id: "SR", data: { text: "Social rent", val: "SR" } }, + { id: "LRR", data: { text: "London Living Rent", val: "LRR" } }, + { + id: "sharedEquity", + data: { text: "Shared equity", val: "sharedEquity" }, + }, + { id: "LSO", data: { text: "London Shared Ownership", val: "LSO" } }, + { id: "DMS", data: { text: "Discount market sale", val: "DMS" } }, + { id: "DMR", data: { text: "Discount market rent", val: "DMR" } }, + { + id: "DMRLLR", + data: { + text: "Discount market rent (charged at London Living Rents)", + val: "DMRLLR", + }, + }, + { + id: "marketForRent", + data: { text: "Market for rent", val: "marketForRent" }, + }, + { id: "SH", data: { text: "Starter homes", val: "SH" } }, + { + id: "selfCustomBuild", + data: { + text: "Self-build and custom build", + val: "selfCustomBuild", + }, + }, + { + id: "marketForSale", + data: { text: "Market for sale", val: "marketForSale" }, + }, + { id: "other", data: { text: "Other", val: "other" } }, + ], + }, + }, + { + type: "question", + data: { + title: "What best describes the provider of this unit?", + fn: "provider", + options: [ + { id: "private", data: { text: "Private", val: "private" } }, + { + id: "privateRented", + data: { text: "Private rented sector", val: "privateRented" }, + }, + { id: "HA", data: { text: "Housing association", val: "HA" } }, + { id: "LA", data: { text: "Local authority", val: "LA" } }, + { + id: "publicAuthority", + data: { text: "Other public authority", val: "publicAuthority" }, + }, + { + id: "councilDelivery", + data: { text: "Council delivery company", val: "councilDelivery" }, + }, + { + id: "councilBuildToRent", + data: { + text: "Council delivered build to rent", + val: "councilBuildToRent", + }, + }, + { + id: "affordableHousing", + data: { + text: "Other affordable housing provider", + val: "affordableHousing", + }, + }, + { id: "selfBuild", data: { text: "Self-build", val: "selfBuild" } }, + ], + }, + }, + { + type: "checklist", + data: { + title: "Is this unit compliant with any of the following?", + fn: "compliance", + options: [ + { + id: "m42", + data: { text: "Part M4(2) of the Building Regulations 2010" }, + }, + { + id: "m432a", + data: { text: "Part M4(3)(2a) of the Building Regulations 2010" }, + }, + { + id: "m432b", + data: { text: "Part M4(3)(2b) of the Building Regulations 2010" }, + }, + { id: "none", data: { text: "None of these" } }, + ], + }, + }, + { + type: "question", + data: { + title: "Is this unit built on garden land?", + fn: "garden", + options: [ + { id: "true", data: { text: "Yes", val: "true" } }, + { id: "false", data: { text: "No", val: "false" } }, + ], + }, + }, + { + type: "question", + data: { + title: "Does this unit provide sheltered accommodation?", + fn: "sheltered", + options: [ + { id: "true", data: { text: "Yes", val: "true" } }, + { id: "false", data: { text: "No", val: "false" } }, + ], + }, + }, + { + type: "question", + data: { + title: "Is this unit specifically designed for older people?", + fn: "olderPersons", + options: [ + { id: "true", data: { text: "Yes", val: "true" } }, + { id: "false", data: { text: "No", val: "false" } }, + ], + }, + }, + { + type: "number", + data: { + title: "How many units of the type described above are lost?", + fn: "identicalUnits", + allowNegatives: false, + }, + }, + ], + min: 1, +} as const; diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Proposed.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Proposed.ts index fdd295110b..a62a70cfef 100644 --- a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Proposed.ts +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/Proposed.ts @@ -3,6 +3,27 @@ import { Schema } from "@planx/components/shared/Schema/model"; export const ResidentialUnitsProposed: Schema = { type: "Proposed residential unit type", fields: [ + { + type: "question", + data: { + title: "What best describes the type of this unit?", + fn: "type", + options: [ + { id: "house", data: { text: "House", val: "house" } }, + { + id: "flat", + data: { text: "Flat, apartment or maisonette", val: "flat" }, + }, + { + id: "sheltered", + data: { text: "Sheltered housing", val: "sheltered" }, + }, + { id: "studio", data: { text: "Studio or bedsit", val: "studio" } }, + { id: "cluster", data: { text: "Cluster flat", val: "cluster" } }, + { id: "other", data: { text: "Other", val: "other" } }, + ], + }, + }, { type: "question", data: { @@ -30,27 +51,6 @@ export const ResidentialUnitsProposed: Schema = { ], }, }, - { - type: "question", - data: { - title: "What best describes the type of this unit?", - fn: "type", - options: [ - { id: "house", data: { text: "House", val: "house" } }, - { - id: "flat", - data: { text: "Flat, apartment or maisonette", val: "flat" }, - }, - { - id: "sheltered", - data: { text: "Sheltered housing", val: "sheltered" }, - }, - { id: "studio", data: { text: "Studio or bedsit", val: "studio" } }, - { id: "cluster", data: { text: "Cluster flat", val: "cluster" } }, - { id: "other", data: { text: "Other", val: "other" } }, - ], - }, - }, { type: "number", data: { @@ -62,7 +62,9 @@ export const ResidentialUnitsProposed: Schema = { { type: "number", data: { - title: "How many proposed units fit the descriptions above?", + title: "How many units of the type described above are you proposing?", + description: + "This is the total number of units of this type that will be on the site after completion of the project.", fn: "identicalUnits", allowNegatives: false, },