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

chore: update default PropertyInformation and DrawBoundary content for new components #2681

Merged
merged 21 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
970deb4
fetch title boundary to autofill draw boundary
jessicamcinchak Dec 13, 2023
4c3b549
calculate area of title boundary
jessicamcinchak Dec 13, 2023
79ce0e7
update test mock from json to geojson entity response
jessicamcinchak Dec 13, 2023
eedb7ff
use latest map release
jessicamcinchak Dec 13, 2023
e183b1e
rebase & clean up area calculations
jessicamcinchak Dec 14, 2023
732354a
update area formatting in test mocks
jessicamcinchak Dec 14, 2023
4aeae55
show title boundary as blue line on PropertyInformation reference map
jessicamcinchak Dec 14, 2023
807aeb7
add loading indicator to FindProperty for slow planning data requests
jessicamcinchak Dec 14, 2023
9d5c749
rebase and bump map pkg
jessicamcinchak Jan 2, 2024
5880467
update attribution text
jessicamcinchak Jan 2, 2024
8f3ad1d
rebase to main
jessicamcinchak Jan 5, 2024
0ef80bc
rebase
jessicamcinchak Jan 8, 2024
66cc051
rebase
jessicamcinchak Jan 11, 2024
88ed7ab
adjust visually hidden text prompts
jessicamcinchak Jan 18, 2024
68a22c1
add geojson property to reflect user action on draw
jessicamcinchak Jan 18, 2024
2f7e818
add an internal passport var to track user interaction on draw
jessicamcinchak Jan 18, 2024
0ba22d7
pr feedback
jessicamcinchak Jan 19, 2024
47bb135
store default component content
jessicamcinchak Jan 19, 2024
7eea6b9
Merge branch 'main' of github.com:theopensystemslab/planx-new into je…
jessicamcinchak Jan 22, 2024
b6001ba
since separate migration repo, keep new defaults in model.ts directly
jessicamcinchak Jan 23, 2024
64e0dba
rebase
jessicamcinchak Jan 23, 2024
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
12 changes: 4 additions & 8 deletions editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ import Input from "ui/shared/Input";
import InputRow from "ui/shared/InputRow";

import type { DrawBoundary } from "./model";
import {
DEFAULT_TITLE,
DEFAULT_TITLE_FOR_UPLOADING,
parseDrawBoundary,
} from "./model";
import { parseDrawBoundary } from "./model";

export type Props = EditorProps<TYPES.DrawBoundary, DrawBoundary>;

Expand All @@ -46,7 +42,7 @@ function DrawBoundaryComponent(props: Props) {
<InputRow>
<Input
format="large"
placeholder={DEFAULT_TITLE}
placeholder={props.node?.data?.title}
name="title"
value={formik.values.title}
onChange={formik.handleChange}
Expand Down Expand Up @@ -84,13 +80,13 @@ function DrawBoundaryComponent(props: Props) {
</InputGroup>
</ModalSectionContent>
<ModalSectionContent
title={DEFAULT_TITLE_FOR_UPLOADING}
title={props.node?.data?.titleForUploading}
Icon={ICONS[TYPES.DrawBoundary]}
>
<InputRow>
<Input
format="large"
placeholder={DEFAULT_TITLE_FOR_UPLOADING}
placeholder={props.node?.data?.titleForUploading}
name="titleForUploading"
value={formik.values.titleForUploading}
onChange={formik.handleChange}
Expand Down
46 changes: 35 additions & 11 deletions editor.planx.uk/src/@planx/components/DrawBoundary/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,42 @@ export const parseDrawBoundary = (
data: Record<string, any> | undefined,
): DrawBoundary => ({
...parseMoreInformation(data),
title: data?.title || DEFAULT_TITLE,
description: data?.description || "",
titleForUploading: data?.titleForUploading || DEFAULT_TITLE_FOR_UPLOADING,
descriptionForUploading: data?.descriptionForUploading || "",
hideFileUpload: data?.hideFileUpload || false,
dataFieldBoundary: data?.dataFieldBoundary || DEFAULT_PASSPORT_BOUNDARY_KEY,
dataFieldArea: data?.dataFieldArea || DEFAULT_PASSPORT_AREA_KEY,
title: data?.title || defaultContent?.["title"],
description: data?.description || defaultContent?.["description"],
titleForUploading:
data?.titleForUploading || defaultContent?.["titleForUploading"],
descriptionForUploading:
data?.descriptionForUploading ||
defaultContent?.["descriptionForUploading"],
hideFileUpload: data?.hideFileUpload || defaultContent?.["hideFileUpload"],
dataFieldBoundary:
data?.dataFieldBoundary || defaultContent?.["dataFieldBoundary"],
dataFieldArea: data?.dataFieldArea || defaultContent?.["dataFieldArea"],
info: data?.info || defaultContent?.["info"],
policyRef: data?.policyRef || defaultContent?.["policyRef"],
howMeasured: data?.howMeasured || defaultContent?.["howMeasured"],
definitionImg: data?.definitionImg || defaultContent?.["definitionImg"],
});

export const DEFAULT_PASSPORT_BOUNDARY_KEY = "property.boundary.site" as const;
export const DEFAULT_PASSPORT_AREA_KEY = "property.boundary.area" as const;
export const DEFAULT_TITLE = "Draw the boundary of the property" as const;
export const DEFAULT_TITLE_FOR_UPLOADING = "Upload a location plan" as const;
export const PASSPORT_UPLOAD_KEY = "proposal.drawing.locationPlan" as const; // not added to editor yet
export const PASSPORT_COMPONENT_ACTION_KEY = "drawBoundary.action" as const; // internal use only

// Default content as of Jan 2024 when title boundaries were introduced
// Rather than editing HTML directly here, try updating component directly via editor rich text inputs then running
// `copy(window.api.getState().flow["{your node id}"].data)` and pasting here
jessicamcinchak marked this conversation as resolved.
Show resolved Hide resolved
const defaultContent: DrawBoundary = {
info: "<p>This outline identifies the location of the proposed changes on a map. This information is required for all planning applications. It is sometimes called a &apos;red line drawing&apos; or &apos;location plan&apos;.</p>",
title: "Check or amend the outline of your property and works",
policyRef:
'<p><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.legislation.gov.uk/uksi/2015/595/article/7">The Town and Country Planning (Development Management Procedure) (England) Order 2015</a>,</p><p><a target="_blank" rel="noopener noreferrer nofollow" href="https://www.gov.uk/government/collections/planning-practice-guidance">Planning Practice Guidance (PPG)</a></p>',
description:
"<p>The red line shown below should include:</p><ul><li><p>the outline of your property boundary</p></li><li><p>any works outside the property boundary</p></li><li><p>areas that will be closed off or you&apos;ll need access to during the works</p></li></ul><p>If the red line already includes all these, tap continue. If it does not, tap <em>More information</em> for guidance on how to amend or redraw the outline.</p>",
howMeasured:
'<p>We have pre-populated the map with a red outline that includes the entire property, using information from Land Registry.</p><p>In some cases, this outline might not include all the works or the areas that will be closed off. This could be the case if you are proposing works to a public highway (such as a dropped kerb), doing works that involve multiple properties, or works to a building that is part of a larger estate.</p><p>In these cases, you should amend the red outline by dragging the edges, or erase it by clicking the 🗑-icon on the map and draw a new outline.</p><p></p><h1>How to draw and amend the outline</h1><ol><li><p>Move the cursor to the corner you want to start with and click or tap once.</p></li><li><p>Move the cursor to the next corner and click or tap.</p></li><li><p>Repeat until you have the shape you need.</p></li><li><p>Click or tap the last corner again to stop drawing.</p></li><li><p>To amend the outline, click or tap on a line and drag it into a new position.</p></li></ol><img src="https://api.editor.planx.uk/file/public/dni98ojg/Draw_Outline_2.gif">',
dataFieldArea: "property.boundary.area",
hideFileUpload: false,
dataFieldBoundary: "property.boundary.site",
titleForUploading: "Upload a location plan",
descriptionForUploading:
"<p>Your location plan must:</p><ul><li><p>be based on an accurate, recognisable map</p></li><li><p>be drawn to a scale, labelled, and/or marked with a scale bar</p></li><li><p>show the site outline in red</p></li><li><p>include a<strong> </strong>north point</p></li></ul>",
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const parseContent = (
title: data?.title || "About the property",
description:
data?.description ||
"This is the information we currently have about the property",
"This is the information we currently have about the property, including its title boundary shown in blue from the Land Registry",
showPropertyTypeOverride: data?.showPropertyTypeOverride || false,
...parseMoreInformation(data),
});
2 changes: 1 addition & 1 deletion editor.planx.uk/src/ui/editor/RichTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ const RichTextInput: FC<Props> = (props) => {
tippyOptions={{
duration: 100,
// Hack to "stop" transition of BubbleMenu
moveTransition: "transform 600s"
moveTransition: "transform 600s",
jessicamcinchak marked this conversation as resolved.
Show resolved Hide resolved
}}
className="bubble-menu"
>
Expand Down
Loading