From 257e398777e0350ef05d80626f961cc940a941d7 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Tue, 23 Jan 2024 13:56:54 +0000 Subject: [PATCH] chore: update default PropertyInformation and DrawBoundary content for new components (#2681) --- .../@planx/components/DrawBoundary/Editor.tsx | 12 ++--- .../@planx/components/DrawBoundary/model.ts | 46 ++++++++++++++----- .../components/PropertyInformation/model.ts | 2 +- .../src/ui/editor/RichTextInput.tsx | 2 +- 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx index 82f2e6b78a..2ce16c912e 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Editor.tsx @@ -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; @@ -46,7 +42,7 @@ function DrawBoundaryComponent(props: Props) { | 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 +const defaultContent: DrawBoundary = { + info: "

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 'red line drawing' or 'location plan'.

", + title: "Check or amend the outline of your property and works", + policyRef: + '

The Town and Country Planning (Development Management Procedure) (England) Order 2015,

Planning Practice Guidance (PPG)

', + description: + "

The red line shown below should include:

  • the outline of your property boundary

  • any works outside the property boundary

  • areas that will be closed off or you'll need access to during the works

If the red line already includes all these, tap continue. If it does not, tap More information for guidance on how to amend or redraw the outline.

", + howMeasured: + '

We have pre-populated the map with a red outline that includes the entire property, using information from Land Registry.

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.

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.

How to draw and amend the outline

  1. Move the cursor to the corner you want to start with and click or tap once.

  2. Move the cursor to the next corner and click or tap.

  3. Repeat until you have the shape you need.

  4. Click or tap the last corner again to stop drawing.

  5. To amend the outline, click or tap on a line and drag it into a new position.

', + dataFieldArea: "property.boundary.area", + hideFileUpload: false, + dataFieldBoundary: "property.boundary.site", + titleForUploading: "Upload a location plan", + descriptionForUploading: + "

Your location plan must:

  • be based on an accurate, recognisable map

  • be drawn to a scale, labelled, and/or marked with a scale bar

  • show the site outline in red

  • include a north point

", +}; diff --git a/editor.planx.uk/src/@planx/components/PropertyInformation/model.ts b/editor.planx.uk/src/@planx/components/PropertyInformation/model.ts index 23842fea18..29e2ee5634 100644 --- a/editor.planx.uk/src/@planx/components/PropertyInformation/model.ts +++ b/editor.planx.uk/src/@planx/components/PropertyInformation/model.ts @@ -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), }); diff --git a/editor.planx.uk/src/ui/editor/RichTextInput.tsx b/editor.planx.uk/src/ui/editor/RichTextInput.tsx index 37963f4984..454f70b241 100644 --- a/editor.planx.uk/src/ui/editor/RichTextInput.tsx +++ b/editor.planx.uk/src/ui/editor/RichTextInput.tsx @@ -497,7 +497,7 @@ const RichTextInput: FC = (props) => { tippyOptions={{ duration: 100, // Hack to "stop" transition of BubbleMenu - moveTransition: "transform 600s" + moveTransition: "transform 600s", }} className="bubble-menu" >