-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bcf0e47
commit 6219c4f
Showing
8 changed files
with
186 additions
and
38 deletions.
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
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
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
68 changes: 68 additions & 0 deletions
68
editor.planx.uk/src/@planx/components/List/schemas/Owners.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,68 @@ | ||
import { Schema } from "@planx/components/shared/Schema/model"; | ||
import { TextInputType } from "@planx/components/TextInput/model"; | ||
|
||
export const Owners: Schema = { | ||
type: "Person", | ||
fields: [ | ||
{ | ||
type: "question", | ||
data: { | ||
title: "What is the nature of their interest in the land?", | ||
fn: "interest", | ||
options: [ | ||
{ | ||
id: "owner", | ||
data: { text: "Owner", val: "owner" }, | ||
}, | ||
{ | ||
id: "lessee", | ||
data: { text: "Lessee", val: "lessee" }, | ||
}, | ||
{ | ||
id: "occupier", | ||
data: { text: "Occupier", val: "occupier" }, | ||
}, | ||
{ | ||
id: "other", | ||
data: { text: "Something else", val: "other" }, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
type: "text", | ||
data: { | ||
title: "What is their full name?", | ||
fn: "name", | ||
type: TextInputType.Short, | ||
}, | ||
}, | ||
{ | ||
type: "address", | ||
data: { | ||
title: "What is their address?", | ||
fn: "address", | ||
}, | ||
}, | ||
{ | ||
type: "question", | ||
data: { | ||
title: "Have you notified them?", | ||
description: | ||
"Anyone with an interest in the land should be notified before submitting this application.", | ||
fn: "noticeGiven", | ||
options: [ | ||
{ | ||
id: "yes", | ||
data: { text: "Yes", val: "true" }, | ||
}, | ||
{ | ||
id: "no", | ||
data: { text: "No", val: "false" }, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
min: 1, | ||
} as const; |
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
36 changes: 36 additions & 0 deletions
36
editor.planx.uk/src/@planx/components/shared/Schema/InputFields/AddressFieldInput.tsx
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 Box from "@mui/material/Box"; | ||
import Typography from "@mui/material/Typography"; | ||
import { | ||
AddressFields, | ||
FormProps, | ||
} from "@planx/components/AddressInput/Public"; | ||
import React from "react"; | ||
import InputLegend from "ui/editor/InputLegend"; | ||
|
||
import { AddressField } from "../model"; | ||
import { getFieldProps, Props } from "."; | ||
import { FieldInputDescription } from "./shared"; | ||
|
||
export const AddressFieldInput: React.FC<Props<AddressField>> = (props) => { | ||
const { data, formik } = props; | ||
const { id, errorMessage, value } = getFieldProps(props); | ||
|
||
return ( | ||
<Box component="fieldset"> | ||
<InputLegend> | ||
<Typography variant="body1" pb={1}> | ||
<strong>{data.title}</strong> | ||
</Typography> | ||
</InputLegend> | ||
{data.description && ( | ||
<FieldInputDescription description={data.description} /> | ||
)} | ||
<AddressFields | ||
id={id} | ||
values={value as unknown as FormProps} | ||
errors={errorMessage} | ||
handleChange={formik.handleChange} | ||
/> | ||
</Box> | ||
); | ||
}; |
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
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