diff --git a/api.planx.uk/modules/admin/session/html.ts b/api.planx.uk/modules/admin/session/html.ts index 35d56cea18..fb25bca8bc 100644 --- a/api.planx.uk/modules/admin/session/html.ts +++ b/api.planx.uk/modules/admin/session/html.ts @@ -28,7 +28,7 @@ export const getHTMLExport: HTMLExportHandler = async (req, res, next) => { const responses = await $api.export.csvData(req.params.sessionId); const boundingBox = session.data.passport.data[ - "property.boundary.site.buffered" + "proposal.site.buffered" ] as unknown as GeoJSON.Feature; const userAction = session.data.passport.data?.[ "drawBoundary.action" @@ -75,7 +75,7 @@ export const getRedactedHTMLExport: HTMLExportHandler = async ( req.params.sessionId, ); const boundingBox = session.data.passport.data[ - "property.boundary.site.buffered" + "proposal.site.buffered" ] as unknown as GeoJSON.Feature; const userAction = session.data.passport.data?.[ "drawBoundary.action" diff --git a/api.planx.uk/modules/send/utils/exportZip.test.ts b/api.planx.uk/modules/send/utils/exportZip.test.ts index 5f9d1840cf..8a7e0f2daf 100644 --- a/api.planx.uk/modules/send/utils/exportZip.test.ts +++ b/api.planx.uk/modules/send/utils/exportZip.test.ts @@ -136,7 +136,7 @@ describe("buildSubmissionExportZip", () => { }); test("geojson and location plan is excluded when not present", async () => { - // set-up mock session passport excluding "property.boundary.site" + // set-up mock session passport excluding "proposal.site" const lowcalSessionWithoutBoundary: Partial = { ...mockLowcalSession, id: "1234", @@ -146,7 +146,7 @@ describe("buildSubmissionExportZip", () => { passport: { data: { ...mockLowcalSession.data!.passport.data, - "property.boundary.site": undefined, + "proposal.site": undefined, }, }, }, diff --git a/api.planx.uk/modules/send/utils/exportZip.ts b/api.planx.uk/modules/send/utils/exportZip.ts index da068d0aef..f518573b02 100644 --- a/api.planx.uk/modules/send/utils/exportZip.ts +++ b/api.planx.uk/modules/send/utils/exportZip.ts @@ -146,7 +146,7 @@ export async function buildSubmissionExportZip({ } } - const boundingBox = passport.data["property.boundary.site.buffered"]; + const boundingBox = passport.data["proposal.site.buffered"]; const userAction = passport.data?.["drawBoundary.action"]; // generate and add an HTML overview document for the submission to zip @@ -173,7 +173,7 @@ export async function buildSubmissionExportZip({ // add an optional GeoJSON file to zip const geojson: GeoJSON.Feature | undefined = - passport?.data?.["property.boundary.site"]; + passport?.data?.["proposal.site"]; if (geojson) { if (userAction) { geojson["properties"] ??= {}; diff --git a/api.planx.uk/tests/mocks/saveAndReturnMocks.ts b/api.planx.uk/tests/mocks/saveAndReturnMocks.ts index 5900d2b9aa..028d9494b7 100644 --- a/api.planx.uk/tests/mocks/saveAndReturnMocks.ts +++ b/api.planx.uk/tests/mocks/saveAndReturnMocks.ts @@ -42,7 +42,7 @@ export const mockLowcalSession: LowCalSession = { }, "drawBoundary.action": "Amended the title boundary", "proposal.projectType": ["new.office"], - "property.boundary.site": { + "proposal.site": { type: "Feature", geometry: { type: "Polygon", diff --git a/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json b/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json index e07cd72fdd..24d1ced07a 100644 --- a/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json +++ b/e2e/tests/api-driven/src/invite-to-pay/mocks/flow.json @@ -157049,7 +157049,7 @@ "description": "

The red line shown below should include:

If the red line already includes all these, select continue. If not, select 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 the Land Registry.

In some cases, this outline might not include all the works or the areas that will be closed off. This might be because you're 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.

", "hideFileUpload": false, - "fn": "property.boundary.site", + "fn": "proposal.site", "titleForUploading": "Upload a location plan", "descriptionForUploading": "

Your location plan must:

" }, diff --git a/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json b/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json index 80d1506ae1..9f618081c2 100644 --- a/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json +++ b/e2e/tests/api-driven/src/invite-to-pay/mocks/session.json @@ -93,7 +93,7 @@ "uniform.consentRegime": ["Certificate of Lawfulness"], "application.about.form": ["Proposed building works"], "property.EPCKnown.form": ["No"], - "property.boundary.site": { + "proposal.site": { "type": "Feature", "geometry": { "type": "Polygon", @@ -814,7 +814,7 @@ "auto": false, "data": { "proposal.siteArea": 21.6, - "property.boundary.site": { + "proposal.site": { "type": "Feature", "geometry": { "type": "Polygon", diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx index 255b2085a2..6afd73679d 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/Public.test.tsx @@ -42,7 +42,7 @@ test("recovers previously submitted files when clicking the back button", async const { user } = setup( { const handleSubmit = vi.fn(); const previouslySubmittedData = { - "property.boundary.site": { + "proposal.site": { type: "Feature", properties: {}, geometry: { @@ -84,7 +84,7 @@ test("recovers previously submitted drawing when clicking the back button", asyn const { user } = setup( { const { container } = setup( { titleForUploading: "Upload a location plan", descriptionForUploading: "", hideFileUpload: false, - fn: "property.boundary.site", + fn: "proposal.site", }, }, }; @@ -337,7 +337,7 @@ test("appends to existing '_requestedFiles' value", async () => { const { user } = setup( { // Previously submitted data is a good proxy for having previously fetched a title boundary and arriving to Draw with geojson in passport ! const previouslySubmittedData = { - "property.boundary.site": { + "proposal.site": { type: "Feature", properties: {}, geometry: { @@ -419,7 +419,7 @@ test("submits data based on the page you continue onwards from", async () => { const { user } = setup( { // Confirm that file is NOT saved to passport, but geojson is const submitted = handleSubmit.mock.calls[0][0]; expect(submitted.data).not.toHaveProperty(PASSPORT_UPLOAD_KEY); - expect(submitted.data["property.boundary.site"]).toEqual( - previouslySubmittedData["property.boundary.site"], + expect(submitted.data["proposal.site"]).toEqual( + previouslySubmittedData["proposal.site"], ); // DrawBoundary action captured correctly based on page diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx index 17f258eab7..58e5f20c05 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/Public/index.tsx @@ -55,10 +55,10 @@ export default function Component(props: Props) { const previousBoundary = props.previouslySubmittedData?.data?.[props.fn] || - passport.data?.["property.boundary.title"]; + passport.data?.["property.boundary"]; const previousArea = props.previouslySubmittedData?.data?.[props.fn] || - passport.data?.["property.boundary.title.area"]; + passport.data?.["proposal.site.area"]; const [boundary, setBoundary] = useState(previousBoundary); const [area, setArea] = useState(previousArea); const [mapValidationError, setMapValidationError] = useState(); @@ -167,7 +167,7 @@ export default function Component(props: Props) { // Track the type of map interaction if ( boundary?.geometry === - passport.data?.["property.boundary.title"]?.geometry + passport.data?.["property.boundary"]?.geometry ) { newPassportData[PASSPORT_COMPONENT_ACTION_KEY] = DrawBoundaryUserAction.Accept; diff --git a/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts b/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts index f2993c1f5b..69875aa276 100644 --- a/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts +++ b/editor.planx.uk/src/@planx/components/DrawBoundary/model.ts @@ -51,7 +51,7 @@ const defaultContent: DrawBoundary = { 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 might be because you're 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 :wastebasket:-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.

', hideFileUpload: false, - fn: "property.boundary.site", + fn: "proposal.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/FindProperty/Public/Public.test.tsx b/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx index b2bd212e6b..5dd8fb4dbf 100644 --- a/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx +++ b/editor.planx.uk/src/@planx/components/FindProperty/Public/Public.test.tsx @@ -36,9 +36,9 @@ const osAddressProps = { "property.type": ["residential.HMO.parent"], "property.localAuthorityDistrict": ["Southwark"], "property.region": ["London"], - "property.boundary.title.area": 1232.22, - "property.boundary.title.area.hectares": 0.123222, - "property.boundary.title": { + "property.boundary.area": 1232.22, + "property.boundary.area.hectares": 0.123222, + "property.boundary": { geometry: { type: "MultiPolygon", coordinates: [ @@ -85,9 +85,9 @@ const proposedAddressProps = { }, "property.localAuthorityDistrict": ["Southwark"], "property.region": ["London"], - "property.boundary.title.area": 1232.22, - "property.boundary.title.area.hectares": 0.123222, - "property.boundary.title": { + "proposal.site.area": 1232.22, + "proposal.site.area.hectares": 0.123222, + "property.boundary": { geometry: { type: "MultiPolygon", coordinates: [ diff --git a/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx b/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx index c7f3093821..033a925f4c 100644 --- a/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/FindProperty/Public/index.tsx @@ -156,9 +156,9 @@ function Component(props: Props) { if (titleBoundary) { const areaSquareMetres = Math.round(area(titleBoundary as Feature) * 100) / 100; - newPassportData["property.boundary.title"] = titleBoundary; - newPassportData["property.boundary.title.area"] = areaSquareMetres; - newPassportData["property.boundary.title.area.hectares"] = + newPassportData["property.boundary"] = titleBoundary; + newPassportData["property.boundary.area"] = areaSquareMetres; + newPassportData["property.boundary.area.hectares"] = squareMetresToHectares(areaSquareMetres); } diff --git a/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx b/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx index 5ffc2d2313..4c087c23af 100644 --- a/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx +++ b/editor.planx.uk/src/@planx/components/MapAndLabel/Public/index.tsx @@ -261,7 +261,7 @@ const Root = () => { basemap={basemap} ariaLabelOlFixedOverlay={`An interactive map for plotting and describing individual ${schemaName.toLocaleLowerCase()}`} geojsonData={ - passport && JSON.stringify(passport["property.boundary.site"]) + passport && JSON.stringify(passport["proposal.site"]) } geojsonBuffer={30} drawMode diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx index 209cd1e93c..26ab658847 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/Public.tsx @@ -53,7 +53,7 @@ function Component(props: Props) { state.cachedBreadcrumbs, state.teamSlug, state.teamIntegrations?.hasPlanningData, - state.computePassport().data?.["property.boundary.site"], + state.computePassport().data?.["proposal.site"], state.computePassport().data?.["_overrides"], (state.computePassport().data?.["_address"] as SiteAddress) || {}, ]); diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts index 17ed125da3..72fe5ef1d2 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/mocks/simpleFlow.ts @@ -61,7 +61,7 @@ export const simpleBreadcrumbs: Store.Breadcrumbs = { "property.type": ["commercial.office.workspace.gov.local"], "property.localAuthorityDistrict": ["Birmingham"], "property.region": ["West Midlands"], - "property.boundary.title": { + "property.boundary": { geometry: { type: "MultiPolygon", coordinates: [ @@ -88,8 +88,8 @@ export const simpleBreadcrumbs: Store.Breadcrumbs = { "organisation-entity": "13", }, }, - "property.boundary.title.area": 8242.37, - "property.boundary.title.area.hectares": 0.8242370000000001, + "proposal.site.area": 8242.37, + "proposal.site.area.hectares": 0.8242370000000001, "findProperty.action": "Selected an existing address", }, }, diff --git a/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx b/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx index 5cc2e29352..60bf2cc8e5 100644 --- a/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx +++ b/editor.planx.uk/src/@planx/components/PropertyInformation/Public.tsx @@ -44,7 +44,7 @@ function Component(props: PublicProps) { localAuthorityDistrict={ passport.data?.["property.localAuthorityDistrict"] } - titleBoundary={passport.data?.["property.boundary.title"]} + titleBoundary={passport.data?.["property.boundary"]} blpuCodes={blpuCodes} overrideAnswer={overrideAnswer} handleSubmit={() => { diff --git a/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx b/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx index 3b5c60decf..bf50d77245 100644 --- a/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx +++ b/editor.planx.uk/src/@planx/components/Review/Public/mocks/fileUpload.tsx @@ -157,7 +157,7 @@ export const drawBoundaryFlow = { data: { title: "Draw the boundary of the property", hideFileUpload: false, - fn: "property.boundary.site", + fn: "proposal.site", titleForUploading: "Upload a location plan", }, type: 10, diff --git a/editor.planx.uk/src/@planx/components/SetValue/utils.ts b/editor.planx.uk/src/@planx/components/SetValue/utils.ts index f4585db917..040257520f 100644 --- a/editor.planx.uk/src/@planx/components/SetValue/utils.ts +++ b/editor.planx.uk/src/@planx/components/SetValue/utils.ts @@ -21,7 +21,7 @@ export const handleSetValue: HandleSetValue = ({ }) => { // We do not amend values set at objects // These are internal exceptions we do not want to allow users to edit - // e.g. property.boundary.title + // e.g. property.boundary const isObject = typeof previousValues === "object" && !Array.isArray(previousValues) && diff --git a/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx b/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx index 1698223214..f87ae239c8 100644 --- a/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx +++ b/editor.planx.uk/src/@planx/components/shared/Schema/InputFields/MapFieldInput.tsx @@ -72,7 +72,7 @@ export const MapFieldInput: React.FC> = (props) => { height={400} basemap={mapOptions?.basemap} geojsonData={JSON.stringify( - passport.data?.["property.boundary.site"], + passport.data?.["proposal.site"], )} geojsonBuffer={30} drawMode diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts index fef56d7035..748dc8046a 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/mocks/allFacetFlow.ts @@ -171,7 +171,7 @@ export const mockFlow: FlowGraph = { title: ".", description: "

.

", hideFileUpload: false, - fn: "property.boundary.site", + fn: "proposal.site", titleForUploading: "Elephant", descriptionForUploading: "

Panda

", }, @@ -610,7 +610,7 @@ export const mockDrawBoundaryResult: SearchResult = { title: ".", description: "

.

", hideFileUpload: false, - fn: "property.boundary.site", + fn: "proposal.site", titleForUploading: "Elephant", descriptionForUploading: "

Panda

", }, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json index 09e770cf6e..99e333c825 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/breadcrumbsDependentOnPassport.json @@ -32,7 +32,7 @@ "drawBoundary": { "auto": false, "data": { - "property.boundary.site": { + "proposal.site": { "type": "Feature", "geometry": { "type": "Polygon", @@ -48,7 +48,7 @@ }, "properties": null }, - "property.boundary.area": 109.43 + "proposal.site.area": 109.43 } }, "planningConstraints": { diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json index 442fdc984b..289c7b9334 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/mocks/flowWithPassportComponents.json @@ -32,7 +32,7 @@ }, "drawBoundary": { "data": { - "fn": "property.boundary.site" + "fn": "proposal.site" }, "type": 10 }, diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts index fb0e5d0511..8b3c68d083 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/__tests__/preview/removeNodesDependentOnPassport.test.ts @@ -126,7 +126,7 @@ describe("nodesDependentOnPassport with record", () => { } as Store.CachedBreadcrumbs; const userData = { data: { - "property.boundary.site": { + "proposal.site": { type: "Feature", geometry: { type: "Polygon", @@ -142,7 +142,7 @@ describe("nodesDependentOnPassport with record", () => { }, properties: null, }, - "property.boundary.area": 76.27, + "proposal.site.area": 76.27, }, auto: false, };