Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add new GLA schemas for residential units and existing and proposed uses #3264

Closed
wants to merge 12 commits into from
44 changes: 27 additions & 17 deletions editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ import InputRowLabel from "ui/shared/InputRowLabel";
import { EditorProps, ICONS, InternalNotes, MoreInformation } from "../ui";
import { List, parseContent } from "./model";
import { ResidentialUnitsExisting } from "./schemas/ResidentialUnits/Existing";
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 { ResidentialUnitsProposed } from "./schemas/ResidentialUnits/Proposed";
// 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 { ResidentialUnitsGLAGained } from "./schemas/ResidentialUnits/GLA/Gained";
import { ResidentialUnitsGLALost } from "./schemas/ResidentialUnits/GLA/Lost";
import { ExistingAndProposedUsesGLA } from "./schemas/GLA/ExistingAndProposedUses";
import { CommunalSpaceGLA } from "./schemas/GLA/CommunalSpace";
import { BuildingDetailsGLA } from "./schemas/GLA/BuildingDetails";
import { Zoo } from "./schemas/Zoo";
import { ProposedAdvertisements } from "./schemas/Adverts";

Expand All @@ -27,19 +32,24 @@ type Props = EditorProps<TYPES.List, List>;
export const SCHEMAS = [
{ name: "Residential units - Existing", schema: ResidentialUnitsExisting },
{ name: "Residential units - Proposed", schema: ResidentialUnitsProposed },
{ name: "Residential units (GLA) - New", schema: ResidentialUnitsGLANew },
{
name: "Residential units (GLA) - Rebuilt",
schema: ResidentialUnitsGLARebuilt,
},
{
name: "Residentail units (GLA) - Removed",
schema: ResidentialUnitsGLARemoved,
},
{
name: "Residential units (GLA) - Retained",
schema: ResidentialUnitsGLARetained,
},
{ name: "Residential units (GLA) - Gained", schema: ResidentialUnitsGLAGained },
{ name: "Residential units (GLA) - Lost", schema: ResidentialUnitsGLALost },
{ name: "Existing and proposed uses (GLA)", schema: ExistingAndProposedUsesGLA },
{ name: "Communal spaces (GLA)", schema: CommunalSpaceGLA },
{ name: "Building details (GLA)", schema: BuildingDetailsGLA },
// { name: "Residential units (GLA) - New", schema: ResidentialUnitsGLANew },
// {
// name: "Residential units (GLA) - Rebuilt",
// schema: ResidentialUnitsGLARebuilt,
// },
// {
// name: "Residentail units (GLA) - Removed",
// schema: ResidentialUnitsGLARemoved,
// },
// {
// name: "Residential units (GLA) - Retained",
// schema: ResidentialUnitsGLARetained,
// },
{ name: "Zoo (test)", schema: Zoo },
{ name: "Proposed advertisements", schema: ProposedAdvertisements },
];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { TextInputType } from "@planx/components/TextInput/model";
import { Schema } from "@planx/components/List/model";

export const BuildingDetailsGLA: Schema = {
type: "Building detail",
fields: [
{
type: "text",
data: {
title: "Building reference",
fn: "reference",
type: TextInputType.Short,
},
},
{
type: "number",
data: {
title: "What is the maximum height of the building?",
units: "m",
fn: "height",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "How many storeys does the building have?",
fn: "storeys",
allowNegatives: false,
},
},
],
min: 1,
} as const;
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Schema } from "@planx/components/List/model";

export const CommunalSpaceGLA: Schema = {
type: "Unit of communal space",
fields: [
{
type: "question",
data: {
title: "Is this unit of communal space lost or gained?",
fn: "development",
options: [
{ id: "gained", data: { text: "Gained", val: "gained" } },
{ id: "lost", data: { text: "Lost", val: "lost" } },
],
},
},
{
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 identical units does the description above apply to?",
fn: "identicalUnits",
allowNegatives: false,
},
},
],
min: 1,
} as const;
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Schema } from "@planx/components/List/model";

export const ExistingAndProposedUsesGLA: Schema = {
type: "Existing and proposed uses",
fields: [
{
type: "question",
data: {
title: "What is the use class?",
fn: "useClass",
options: [
{ id: "bTwo", data: { text: "B2 - General industry", val: "bTwo" } },
{ id: "bEight", data: { text: "B8 - Storage and distribution", val: "bEight" } },
{ id: "cOne", data: { text: "C1 - Hotels", val: "cOne" } },
{ id: "cTwo", data: { text: "C2 - Residential institutions", val: "cTwo" } },
{ id: "cTwoA", data: { text: "C2a - Secure residential institutions", val: "cTwoA" } },
{ id: "cThree", data: { text: "C3 - Dwellinghouses", val: "cThree" } },
{ id: "cFour", data: { text: "C4 - Houses in multiple occupation", val: "cFour" } },
{ id: "e", data: { text: "E - Commercial, business and service", val: "e" } },
{ id: "fOne", data: { text: "F1 - Learning and non-residential institutions", val: "fOne" } },
{ id: "fTwo", data: { text: "F2 - Local community uses", val: "fTwo" } },
{ id: "SG", data: { text: "Sui generis", val: "SG" } },
{ id: "unknown", data: { text: "Unknown", val: "unknown" } },
],
},
},
{
type: "number",
data: {
title: "What is the existing gross internal floor area?",
units: "m²",
fn: "area.existing",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "What is the gross internal floor area lost?",
units: "m²",
fn: "area.lost",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "What is the gross internal floor area gained?",
units: "m²",
fn: "area.gained",
allowNegatives: false,
},
},
],
min: 1,
} as const;
Loading
Loading