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 material details to list component and schema #3384

Merged
merged 3 commits into from
Jul 8, 2024
Merged
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
3 changes: 3 additions & 0 deletions editor.planx.uk/src/@planx/components/List/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import InputRowLabel from "ui/shared/InputRowLabel";
import { EditorProps, ICONS, InternalNotes, MoreInformation } from "../ui";
import { List, parseContent } from "./model";
import { ProposedAdvertisements } from "./schemas/Adverts";
import { MaterialDetails } from "./schemas/Materials";
import { NonResidentialFloorspace } from "./schemas/Floorspace";
import { BuildingDetailsGLA } from "./schemas/GLA/BuildingDetails";
import { CommunalSpaceGLA } from "./schemas/GLA/CommunalSpace";
Expand All @@ -28,6 +29,7 @@ import { ResidentialUnitsGLARebuilt } from "./schemas/ResidentialUnits/GLA/Rebui
import { ResidentialUnitsGLARemoved } from "./schemas/ResidentialUnits/GLA/Removed";
import { ResidentialUnitsProposed } from "./schemas/ResidentialUnits/Proposed";


type Props = EditorProps<TYPES.List, List>;

export const SCHEMAS = [
Expand Down Expand Up @@ -55,6 +57,7 @@ export const SCHEMAS = [
name: "Existing and proposed uses (GLA)",
schema: ExistingAndProposedUsesGLA,
},
{ name: "Material details", schema: MaterialDetails },
{ name: "Building details (GLA)", schema: BuildingDetailsGLA },
{ name: "Communal spaces (GLA)", schema: CommunalSpaceGLA },
{ name: "Protected spaces (GLA)", schema: ProtectedSpaceGLA },
Expand Down
63 changes: 63 additions & 0 deletions editor.planx.uk/src/@planx/components/List/schemas/Materials.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { Schema } from "@planx/components/List/model";
import { TextInputType } from "@planx/components/TextInput/model";

export const MaterialDetails: Schema = {
type: "Material",
fields: [
{
type: "question",
data: {
title: "Type",
fn: "type",
options: [
{ id: "wall", data: { text: "External walls", val: "wall" } },
{
id: "window",
data: { text: "Windows", val: "window" },
},
{ id: "door", data: { text: "Doors", val: "door" } },
{
id: "roof",
data: { text: "Roof", val: "roof" },
},
{
id: "boundary",
data: {
text: "Fences, walls and gates",
val: "boundary",
},
},
{
id: "surface",
data: { text: "External ground materials for access and parking", val: "surface" },
},
{
id: "lighting",
data: { text: "Lighting", val: "lighting" },
},
{
id: "other",
data: { text: "Others", val: "other" },
},
],
},
},
{
type: "text",
data: {
title: "Existing material description",
fn: "existing",
type: TextInputType.Short,
},
},
{
type: "text",
data: {
title: "Proposed material description",
fn: "proposed",
type: TextInputType.Short,
},
},
],
min: 1,
} as const;
Loading