Skip to content

Commit

Permalink
chore: Update all schemas with checklists
Browse files Browse the repository at this point in the history
- Also replace questions for checklists
  • Loading branch information
DafyddLlyr committed Jun 25, 2024
1 parent f31ba60 commit f6b8d54
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 244 deletions.
10 changes: 10 additions & 0 deletions editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" } },
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" } },
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" } },
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" } },
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit f6b8d54

Please sign in to comment.