Skip to content

Commit

Permalink
Add CIL schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
augustlindemer committed Dec 17, 2024
1 parent f377b91 commit 4f7847f
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 212 deletions.
4 changes: 4 additions & 0 deletions editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { EditorProps } from "../shared/types";
import { List, parseContent, validationSchema } from "./model";
import { ProposedAdvertisements } from "./schemas/Adverts";
import { ExistingBuildingsCIL } from "./schemas/CIL/ExistingCIL";
import { MezzanineCIL } from "./schemas/CIL/MezzanineCIL";
import { UnoccupiedBuildingsCIL } from "./schemas/CIL/UnoccupiedCIL";
import { NonResidentialFloorspace } from "./schemas/Floorspace";
import { BuildingDetailsGLA } from "./schemas/GLA/BuildingDetails";
import { CommunalSpaceGLA } from "./schemas/GLA/CommunalSpace";
Expand Down Expand Up @@ -71,6 +73,8 @@ export const SCHEMAS = [
{ name: "Parking details", schema: Parking },
{ name: "Parking details (GLA)", schema: ParkingGLA },
{ name: "Existing buildings (CIL)", schema: ExistingBuildingsCIL },
{ name: "Unoccupied buildings (CIL)", schema: UnoccupiedBuildingsCIL },
{ name: "Mezzanine floors (CIL)", schema: MezzanineCIL },
{ name: "Trees", schema: Trees },
{ name: "Trees (Map first)", schema: TreesMapFirst },
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ExistingBuildingsCIL: Schema = {
data: {
title: "How much of its floorspace will be retained?",
units: "m²",
fn: "areaRetained",
fn: "area.retained",
allowNegatives: false,
},
},
Expand All @@ -35,15 +35,15 @@ export const ExistingBuildingsCIL: Schema = {
data: {
title: "How much of its floorspace will be lost?",
units: "m²",
fn: "areaDemolished",
fn: "area.loss",
allowNegatives: false,
},
},
{
type: "question",
data: {
title:
"Has the building or part been lawfully occupied for 6 continuous months in the past 36 months (excluding temporarily lawful uses)?",
"Has the building or part been lawfully occupied for 6 continuous months in the past 36 months?",
fn: "continuousOccupation",
options: [
{ id: "true", data: { text: "Yes", val: "true" } },
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Schema } from "@planx/components/shared/Schema/model";
import { TextInputType } from "@planx/components/TextInput/model";

export const MezzanineCIL: Schema = {
type: "New mezzanine floor",
fields: [
{
type: "text",
data: {
title: "Describe the use of the mezzanine",
fn: "description",
type: TextInputType.Short,
},
},
{
type: "number",
data: {
title:
"What will be the Gross Internal Floor Area (GIA) of the mezzanine?",
units: "m²",
fn: "area",
allowNegatives: false,
},
},
],
min: 1,
} as const;
209 changes: 0 additions & 209 deletions editor.planx.uk/src/@planx/components/List/schemas/CIL/ProposedCIL.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Schema } from "@planx/components/shared/Schema/model";
import { TextInputType } from "@planx/components/TextInput/model";

export const UnoccupiedBuildingsCIL: Schema = {
type: "Building not meant for occupation or temporarily permitted",
fields: [
{
type: "text",
data: {
title: "Describe the existing building",
fn: "descriptionExisting",
type: TextInputType.Short,
},
},
{
type: "number",
data: {
title: "How much of its floorspace will be retained?",
units: "m²",
fn: "area.retained",
allowNegatives: false,
},
},
{
type: "text",
data: {
title: "What will the retained floorspace be used for?",
description: "This can be identical to its current use.",
fn: "descriptionProposed",
type: TextInputType.Short,
},
},
{
type: "number",
data: {
title: "How much of its floorspace will be lost?",
units: "m²",
fn: "area.loss",
allowNegatives: false,
},
},
],
min: 1,
} as const;

0 comments on commit 4f7847f

Please sign in to comment.