From f6b8d5481e6636ecec6da316510405e23fb21da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 25 Jun 2024 16:44:26 +0100 Subject: [PATCH] chore: Update all schemas with checklists - Also replace questions for checklists --- .../src/@planx/components/List/Editor.tsx | 10 +++ .../schemas/ResidentialUnits/GLA/Gained.ts | 68 +++++-------------- .../List/schemas/ResidentialUnits/GLA/Lost.ts | 68 +++++-------------- .../List/schemas/ResidentialUnits/GLA/New.ts | 68 +++++-------------- .../schemas/ResidentialUnits/GLA/Rebuilt.ts | 68 +++++-------------- .../schemas/ResidentialUnits/GLA/Removed.ts | 36 ---------- 6 files changed, 74 insertions(+), 244 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/List/Editor.tsx b/editor.planx.uk/src/@planx/components/List/Editor.tsx index 4e6d6f5544..bfa3e99ae8 100644 --- a/editor.planx.uk/src/@planx/components/List/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/List/Editor.tsx @@ -23,6 +23,8 @@ import { ProtectedSpaceGLA } from "./schemas/GLA/ProtectedSpace"; import { ResidentialUnitsExisting } from "./schemas/ResidentialUnits/Existing"; import { ResidentialUnitsGLAGained } from "./schemas/ResidentialUnits/GLA/Gained"; import { ResidentialUnitsGLALost } from "./schemas/ResidentialUnits/GLA/Lost"; +import { ResidentialUnitsGLANew } from "./schemas/ResidentialUnits/GLA/New"; +import { ResidentialUnitsGLARebuilt } from "./schemas/ResidentialUnits/GLA/Rebuilt"; import { ResidentialUnitsGLARemoved } from "./schemas/ResidentialUnits/GLA/Removed"; import { ResidentialUnitsProposed } from "./schemas/ResidentialUnits/Proposed"; @@ -36,6 +38,14 @@ export const SCHEMAS = [ schema: ResidentialUnitsGLAGained, }, { name: "Residential units (GLA) - Lost", schema: ResidentialUnitsGLALost }, + { + name: "Residential units (GLA) - New", + schema: ResidentialUnitsGLANew, + }, + { + name: "Residential units (GLA) - Rebuilt", + schema: ResidentialUnitsGLARebuilt, + }, { name: "Residential units (GLA) - Removed", schema: ResidentialUnitsGLARemoved, 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 index b08d3bbc6f..f403091c5c 100644 --- 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 @@ -70,61 +70,25 @@ export const ResidentialUnitsGLAGained: Schema = { ], }, }, - // { - // type: "checklist", // @todo - // 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 compliant with Part M4(2) of the Building Regulations 2010?", - fn: "compliance.m42", - options: [ - { id: "true", data: { text: "Yes" } }, - { id: "false", data: { text: "No" } }, - ], - }, - }, - { - type: "question", + type: "checklist", data: { - title: - "Is this unit compliant with Part M4(3)(2a) of the Building Regulations 2010?", - fn: "compliance.m432a", + title: "Is this unit compliant with any of the following?", + fn: "compliance", options: [ - { id: "true", data: { text: "Yes" } }, - { id: "false", data: { text: "No" } }, - ], - }, - }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(3)(2b) of the Building Regulations 2010?", - fn: "compliance.m432b", - options: [ - { id: "true", data: { text: "Yes" } }, - { id: "false", data: { text: "No" } }, + { + 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" } }, ], }, }, 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 index 5c4d126916..bed690a2e7 100644 --- 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 @@ -53,61 +53,25 @@ export const ResidentialUnitsGLALost: Schema = { ], }, }, - // { - // type: "checklist", // @todo - // 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 compliant with Part M4(2) of the Building Regulations 2010?", - fn: "compliance.m42", - options: [ - { id: "true", data: { text: "Yes" } }, - { id: "false", data: { text: "No" } }, - ], - }, - }, - { - type: "question", + type: "checklist", data: { - title: - "Is this unit compliant with Part M4(3)(2a) of the Building Regulations 2010?", - fn: "compliance.m432a", + title: "Is this unit compliant with any of the following?", + fn: "compliance", options: [ - { id: "true", data: { text: "Yes" } }, - { id: "false", data: { text: "No" } }, - ], - }, - }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(3)(2b) of the Building Regulations 2010?", - fn: "compliance.m432b", - options: [ - { id: "true", data: { text: "Yes" } }, - { id: "false", data: { text: "No" } }, + { + 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" } }, ], }, }, diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/New.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/New.ts index 67a67ff4d0..fe8f9a2a78 100644 --- a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/New.ts +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/New.ts @@ -90,61 +90,25 @@ export const ResidentialUnitsGLANew: Schema = { ], }, }, - // { - // type: "checklist", // @todo - // 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 compliant with Part M4(2) of the Building Regulations 2010?", - fn: "compliance.m42", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, - { - type: "question", + type: "checklist", data: { - title: - "Is this unit compliant with Part M4(3)(2a) of the Building Regulations 2010?", - fn: "compliance.m432a", + title: "Is this unit compliant with any of the following?", + fn: "compliance", options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(3)(2b) of the Building Regulations 2010?", - fn: "compliance.m432b", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, + { + 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" } }, ], }, }, diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Rebuilt.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Rebuilt.ts index 31953e66b6..b108866be2 100644 --- a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Rebuilt.ts +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Rebuilt.ts @@ -90,61 +90,25 @@ export const ResidentialUnitsGLARebuilt: Schema = { ], }, }, - // { - // type: "checklist", // @todo - // 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 compliant with Part M4(2) of the Building Regulations 2010?", - fn: "compliance.m42", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, - { - type: "question", + type: "checklist", data: { - title: - "Is this unit compliant with Part M4(3)(2a) of the Building Regulations 2010?", - fn: "compliance.m432a", + title: "Is this unit compliant with any of the following?", + fn: "compliance", options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(3)(2b) of the Building Regulations 2010?", - fn: "compliance.m432b", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, + { + 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" } }, ], }, }, diff --git a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Removed.ts b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Removed.ts index f8f16974ba..b5fde1a983 100644 --- a/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Removed.ts +++ b/editor.planx.uk/src/@planx/components/List/schemas/ResidentialUnits/GLA/Removed.ts @@ -91,42 +91,6 @@ export const ResidentialUnitsGLARemoved: Schema = { ], }, }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(2) of the Building Regulations 2010?", - fn: "compliance.m42", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(3)(2a) of the Building Regulations 2010?", - fn: "compliance.m432a", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, - { - type: "question", - data: { - title: - "Is this unit compliant with Part M4(3)(2b) of the Building Regulations 2010?", - fn: "compliance.m432b", - options: [ - { id: "true", data: { text: "Yes", val: "true" } }, - { id: "false", data: { text: "No", val: "false" } }, - ], - }, - }, { type: "question", data: {