-
Notifications
You must be signed in to change notification settings - Fork 2
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 #3267
Merged
augustlindemer
merged 19 commits into
main
from
augustlindemer-open-and-protected-spaces-GLA
Jun 11, 2024
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9740347
Create Lost.ts
augustlindemer bf7789a
Create Gained.ts
augustlindemer c31a085
Update Editor.tsx
augustlindemer 596e1c0
Create ExistingAndProposedUses.ts
augustlindemer 5a059ef
Update ExistingAndProposedUses.ts
augustlindemer d9757b8
Create CommunalSpace.ts
augustlindemer 3aea515
Update Editor.tsx
augustlindemer 6b56b27
Update ExistingAndProposedUses.ts
augustlindemer f76e227
Create BuildingDetails.ts
augustlindemer 322b784
Update Editor.tsx
augustlindemer 445b49f
Update BuildingDetails.ts
augustlindemer 919b46c
Update BuildingDetails.ts
augustlindemer 96c9e76
Create OpenSpace.ts
augustlindemer 8130b57
Update OpenSpace.ts
augustlindemer 101ac4e
Create ProtectedSpace.ts
augustlindemer c481e67
Update Editor.tsx
augustlindemer e6d844d
Update ExistingAndProposedUses.ts
augustlindemer 6dbe7e7
Update CommunalSpace.ts
augustlindemer c452e46
Update ExistingAndProposedUses.ts
augustlindemer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
editor.planx.uk/src/@planx/components/List/schemas/GLA/BuildingDetails.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
36 changes: 36 additions & 0 deletions
36
editor.planx.uk/src/@planx/components/List/schemas/GLA/CommunalSpace.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "gain", data: { text: "Gained", val: "gain" } }, | ||
{ id: "loss", data: { text: "Lost", val: "loss" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
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; |
56 changes: 56 additions & 0 deletions
56
editor.planx.uk/src/@planx/components/List/schemas/GLA/ExistingAndProposedUses.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "areaExisting", // area.existing | ||
allowNegatives: false, | ||
}, | ||
}, | ||
{ | ||
type: "number", | ||
data: { | ||
title: "What is the gross internal floor area lost?", | ||
units: "m²", | ||
fn: "areaLoss", // area.loss | ||
allowNegatives: false, | ||
}, | ||
}, | ||
{ | ||
type: "number", | ||
data: { | ||
title: "What is the gross internal floor area gained?", | ||
units: "m²", | ||
fn: "areaGain", // area.gain | ||
allowNegatives: false, | ||
}, | ||
}, | ||
], | ||
min: 1, | ||
} as const; |
96 changes: 96 additions & 0 deletions
96
editor.planx.uk/src/@planx/components/List/schemas/GLA/OpenSpace.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import { TextInputType } from "@planx/components/TextInput/model"; | ||
import { Schema } from "@planx/components/List/model"; | ||
|
||
export const OpenSpaceGLA: Schema = { | ||
type: "Open space details", | ||
fields: [ | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What is the project's impact on this open space?", | ||
fn: "development", | ||
options: [ | ||
{ id: "loss", data: { text: "Loss", val: "loss" } }, | ||
{ id: "gain", data: { text: "Gain", val: "gain" } }, | ||
{ id: "changeOfUse", data: { text: "Change of use", val: "changeOfUse" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What best describes the type of this open space?", | ||
fn: "type", | ||
options: [ | ||
{ id: "park", data: { text: "Parks and gardens", val: "park" } }, | ||
{ id: "natural", data: { text: "Natural and semi-natural", val: "natural" } }, | ||
{ id: "greenCorridor", data: { text: "Green corridors", val: "greenCorridor" } }, | ||
{ id: "sport", data: { text: "Outdoor sports facilities", val: "sport" } }, | ||
{ id: "amenity", data: { text: "Amenity", val: "amenity" } }, | ||
{ id: "children", data: { text: "Provision for children and young people", val: "children" } }, | ||
{ id: "allotment", data: { text: "Allotments, community gardens and city farms", val: "allotment" } }, | ||
{ id: "burial", data: { text: "Cemeteries, churchyards and other burial grounds", val: "burial" } }, | ||
{ id: "fringe", data: { text: "Countryside in urban fringe areas", val: "fringe" } }, | ||
{ id: "civic", data: { text: "Civic spaces", val: "civic" } }, | ||
{ id: "brownfield", data: { text: "Brownfield land", val: "brownfield" } }, | ||
{ id: "nonResidential", data: { text: "Non-residential institution grounds or garden", val: "nonResidential" } }, | ||
{ id: "residential", data: { text: "Residential garden", val: "residential" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What best describes the designation of this open space?", | ||
fn: "designation", | ||
options: [ | ||
{ id: "greenBelt", data: { text: "Green Belt", val: "greenBelt" } }, | ||
{ id: "metropolitan", data: { text: "Metropolitan Open Land", val: "metropolitan" } }, | ||
{ id: "local", data: { text: "Local Open Spaces", val: "local" } }, | ||
{ id: "other", data: { text: "Other designation", val: "other" } }, | ||
{ id: "none", data: { text: "Not designated", val: "none" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "text", | ||
data: { | ||
title: "Describe the open space", | ||
fn: "description", | ||
type: TextInputType.Long, | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What is the access to this open space?", | ||
fn: "access", | ||
options: [ | ||
{ id: "restricted", data: { text: "Restricted", val: "restricted" } }, | ||
{ id: "unrestricted", data: { text: "Unrestricted", val: "unrestricted" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "number", | ||
data: { | ||
title: "What is the area of this open space?", | ||
units: "ha", | ||
fn: "area", | ||
allowNegatives: false, | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "Do the changes to this open space involve a land swap?", | ||
fn: "swap", | ||
options: [ | ||
{ id: "true", data: { text: "Yes", val: "true" } }, | ||
{ id: "false", data: { text: "No", val: "false" } }, | ||
], | ||
}, | ||
}, | ||
], | ||
min: 1, | ||
} as const; |
65 changes: 65 additions & 0 deletions
65
editor.planx.uk/src/@planx/components/List/schemas/GLA/ProtectedSpace.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { TextInputType } from "@planx/components/TextInput/model"; | ||
import { Schema } from "@planx/components/List/model"; | ||
|
||
export const ProtectedSpaceGLA: Schema = { | ||
type: "Protected space details", | ||
fields: [ | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What is the project's impact on this protected space?", | ||
fn: "development", | ||
options: [ | ||
{ id: "loss", data: { text: "Loss", val: "loss" } }, | ||
{ id: "gain", data: { text: "Gain", val: "gain" } }, | ||
{ id: "changeOfUse", data: { text: "Change of use", val: "changeOfUse" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What best describes the designation of this protected space?", | ||
fn: "designation", | ||
options: [ | ||
{ id: "SSSI", data: { text: "Sites of Special Scientific Interest", val: "SSSI" } }, | ||
{ id: "localReserve", data: { text: "Local Nature Reserve", val: "localReserve" } }, | ||
{ id: "metropolitan", data: { text: "Site of Metropolitan Importance", val: "metropolitan" } }, | ||
{ id: "boroughGradeOne", data: { text: "Site of Borough Grade 1 Importance", val: "boroughGradeOne" } }, | ||
{ id: "boroughGradeTwo", data: { text: "Site of Borough Grade 2 Importance", val: "boroughGradeTwo" } }, | ||
{ id: "local", data: { text: "Site of Local Importance", val: "local" } }, | ||
{ id: "none", data: { text: "Not designated", val: "none" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "text", | ||
data: { | ||
title: "Describe the protected space", | ||
fn: "description", | ||
type: TextInputType.Long, | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What is the access to this open space?", | ||
fn: "access", | ||
options: [ | ||
{ id: "restricted", data: { text: "Restricted", val: "restricted" } }, | ||
{ id: "unrestricted", data: { text: "Unrestricted", val: "unrestricted" } }, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "number", | ||
data: { | ||
title: "What is the area of this open space?", | ||
units: "ha", | ||
fn: "area", | ||
allowNegatives: false, | ||
}, | ||
}, | ||
], | ||
min: 1, | ||
} as const; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my first go at summing identical units by development type was only accounting for the previous three options, but I'll update it to work the same when
gained
&lost
are options too 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also nit picky thing: you use
loss
in later schemas, butlost
here as "development" options - are they actually different in legislation or can we standardise?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting. loss/gain is what the data hub has in their technical schema across categories (including resi units), so I updated the lost/gained to loss/gain.