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 parking schemas to list component #3623

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import { BuildingDetailsGLA } from "./schemas/GLA/BuildingDetails";
import { CommunalSpaceGLA } from "./schemas/GLA/CommunalSpace";
import { ExistingAndProposedUsesGLA } from "./schemas/GLA/ExistingAndProposedUses";
import { OpenSpaceGLA } from "./schemas/GLA/OpenSpace";
import { ParkingGLA } from "./schemas/GLA/ParkingGLA";
import { ProtectedSpaceGLA } from "./schemas/GLA/ProtectedSpace";
import { MaterialDetails } from "./schemas/Materials";
import { Parking } from "./schemas/Parking";
import { ResidentialUnitsExisting } from "./schemas/ResidentialUnits/Existing";
import { ResidentialUnitsGLANew } from "./schemas/ResidentialUnits/GLA/New";
import { ResidentialUnitsGLARebuilt } from "./schemas/ResidentialUnits/GLA/Rebuilt";
Expand Down Expand Up @@ -63,6 +65,8 @@ export const SCHEMAS = [
{ name: "Protected spaces (GLA)", schema: ProtectedSpaceGLA },
{ name: "Open spaces (GLA)", schema: OpenSpaceGLA },
{ name: "Proposed advertisements", schema: ProposedAdvertisements },
{ name: "Parking details", schema: Parking },
{ name: "Parking details (GLA)", schema: ParkingGLA },
...(hasFeatureFlag("TREES")
? [
{ name: "Trees", schema: Trees },
Expand Down Expand Up @@ -155,4 +159,4 @@ function ListComponent(props: Props) {
);
}

export default ListComponent;
export default ListComponent;
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { Schema } from "@planx/components/shared/Schema/model";

export const ParkingGLA: Schema = {
type: "Parking space type",
fields: [
{
type: "question",
data: {
title: "Type",
fn: "type",
options: [
{ id: "cars", data: { text: "Cars", val: "cars" } },
{
id: "vans",
data: { text: "Vans or minibuses", val: "vans" },
},
{
id: "motorcycles",
data: { text: "Motorcycles", val: "motorcycles" },
},
{
id: "cycles",
data: {
text: "Bicycles",
val: "cycles",
},
},
{
id: "bus",
data: {
text: "Buses",
val: "bus",
},
},
{
id: "disabled",
data: { text: "Disabled person parking", val: "disabled" },
},
{
id: "carClub",
data: {
text: "Car club",
val: "carClub",
},
},
{
id: "offStreet.residential",
data: {
text: "Residential off-street parking",
val: "offStreet.residential",
},
},
{
id: "other",
data: {
text: "Other",
val: "other",
},
},
],
},
},
{
type: "number",
data: {
title: "How many existing spaces of this type are there on the site?",
fn: "existing",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "How many spaces of this type are you proposing?",
description:
"This is the total number of parking spaces of this type after the works, including any retained spaces.",
fn: "proposed",
allowNegatives: false,
},
},
],
min: 1,
} as const;
62 changes: 62 additions & 0 deletions editor.planx.uk/src/@planx/components/List/schemas/Parking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Schema } from "@planx/components/shared/Schema/model";

export const Parking: Schema = {
type: "Parking space type",
fields: [
{
type: "question",
data: {
title: "Type",
fn: "type",
options: [
{ id: "cars", data: { text: "Cars", val: "cars" } },
{
id: "vans",
data: { text: "Vans or minibuses", val: "vans" },
},
{
id: "motorcycles",
data: { text: "Motorcycles", val: "motorcycles" },
},
{
id: "disabled",
data: { text: "Disabled person parking", val: "disabled" },
},
{
id: "cycles",
data: {
text: "Bicycles",
val: "cycles",
},
},
{
id: "other",
data: {
text: "Other (e.g. bus)",
val: "other",
},
},
],
},
},
{
type: "number",
data: {
title: "How many existing spaces of this type are there on the site?",
fn: "existing",
allowNegatives: false,
},
},
{
type: "number",
data: {
title: "How many spaces of this type are you proposing?",
description:
"This is the total number of parking spaces of this type after the works, including any retained spaces.",
fn: "proposed",
allowNegatives: false,
},
},
],
min: 1,
} as const;
Loading