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

wip: find+replace DrawBoundary dataFieldBoundary prop to fn and remove dataFieldArea prop #594

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion src/export/bops/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export function computeBOPSParams({
}

// 1b. property boundary
const geojson = passport.any(["property.boundary.site"]);
const geojson = passport.any(["proposal.site"]);
if (geojson) data.boundary_geojson = geojson;

// 2. files
Expand Down
3 changes: 1 addition & 2 deletions src/export/bops/mocks/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143193,11 +143193,10 @@ export const mockPublishedLDCFlow: FlowGraph = {
"<p>The site outline is often the same as the property boundary. This includes any gardens or outside spaces.</p><p>You should include:</p><ul><li><p>all the changes up to a public road or pavement</p></li><li><p>any work outside the property boundary (such as dropped kerbs)</p></li><li><p>areas that will be closed off during the work</p></li><li><p>access areas to the works (such as roads and tracks)</p></li></ul>",
howMeasured:
"<h2><strong>Ways to provide your site outline</strong></h2><p>You can either:</p><ul><li><p>draw your site outline on this map</p></li><li><p>upload a location plan</p></li></ul><p>You do not need to do both.</p><p>Drawing your site outline on this map helps us accurately identify things that might affect your project. For example, if your site is in a conservation area.</p>",
dataFieldArea: "proposal.siteArea",
definitionImg:
"https://user-data-8038f15.s3.eu-west-2.amazonaws.com/yrjahw3c/siteplan2.png",
hideFileUpload: false,
dataFieldBoundary: "property.boundary.site",
fn: "proposal.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>",
Expand Down
4 changes: 2 additions & 2 deletions src/export/bops/mocks/payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const mockExpectedBOPSPayload = {
"uniform.consentRegime": ["Certificate of Lawfulness"],
"application.about.form": ["Proposed building works"],
"property.EPCKnown.form": ["The property does not have one"],
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -1049,7 +1049,7 @@ export const mockExpectedBOPSPayload = {
auto: false,
data: {
"proposal.siteArea": 201.43,
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down
4 changes: 2 additions & 2 deletions src/export/bops/mocks/sessionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const mockSessionData = {
"uniform.consentRegime": ["Certificate of Lawfulness"],
"application.about.form": ["Proposed building works"],
"property.EPCKnown.form": ["The property does not have one"],
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -954,7 +954,7 @@ export const mockSessionData = {
auto: false,
data: {
"proposal.siteArea": 201.43,
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down
6 changes: 3 additions & 3 deletions src/export/bops/tests/proposalDetails.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ describe("Components which use an internal schema", () => {
"property.type": ["residential.dwelling.house.terrace"],
"property.localAuthorityDistrict": ["Lambeth"],
"property.region": ["London"],
"property.boundary.title": {
"property.boundary": {
geometry: {
type: "MultiPolygon",
coordinates: [
Expand Down Expand Up @@ -1441,8 +1441,8 @@ describe("Components which use an internal schema", () => {
"organisation-entity": "13",
},
},
"property.boundary.title.area": 161.15,
"property.boundary.title.area.hectares": 0.016115,
"property.boundary.area": 161.15,
"property.boundary.area.hectares": 0.016115,
"findProperty.action": "Selected an existing address",
},
},
Expand Down
3 changes: 1 addition & 2 deletions src/export/digitalPlanning/mocks/flows/planningPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6076,9 +6076,8 @@ export const mockPublishedPlanningPermissionFlow = {
'<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>This is not just the outline of your new project. It&apos;s called a red line drawing or location plan. </p><p>It needs to be accurate so we can spot things that might impact your project. If it&apos;s wrong, your application may be invalid.</p><h1>You need to draw:</h1><ul><li><p>the outline of your property boundary - this should be your whole building and land, not just the new project</p></li></ul><h1>You must also include:</h1><ul><li><p>any work outside the property boundary (like a dropped kerb)</p></li><li><p>areas that will be closed off or you&apos;ll need access to during the work (like part of a road)</p></li></ul>",
dataFieldArea: "property.boundary.area",
hideFileUpload: true,
dataFieldBoundary: "property.boundary.site",
fn: "proposal.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>",
Expand Down
9 changes: 4 additions & 5 deletions src/export/digitalPlanning/mocks/flows/priorApproval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19204,9 +19204,8 @@ export const mockPublishedPriorApprovalFlow = {
"<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, select continue. If not, select More information 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 the Land Registry.</p><p>In some cases, this outline might not include all the works or the areas that will be closed off. This might be because you&apos;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.</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",
fn: "proposal.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>",
Expand Down Expand Up @@ -43506,11 +43505,11 @@ export const mockPublishedPriorApprovalFlow = {
},
ShPkwTNiCM: {
data: {
title: "Set proposal.siteArea to property.boundary.area",
title: "Set proposal.siteArea to proposal.site.area",
output: "proposal.siteArea",
formula: "property.boundary.area",
formula: "proposal.site.area",
defaults: {
"property.boundary.area": "0",
"proposal.site.area": "0",
},
formatOutputForAutomations: false,
},
Expand Down
44 changes: 22 additions & 22 deletions src/export/digitalPlanning/mocks/lawfulDevelopmentCertificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ export const mockLDCESession = {
"uniform.applicationTo": ["X0415"],
"uniform.consentRegime": ["Certificate of Lawfulness"],
"application.about.form": ["Existing building works"],
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -1676,7 +1676,7 @@ export const mockLDCESession = {
"applicant.ownership.noticeGiven": ["true"],
"applicant.ownership.owner3.name": "Matilda Wormwood",
"applicant.siteContact.telephone": "01098 765 432",
"property.boundary.site.buffered": {
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -4321,7 +4321,7 @@ export const mockLDCESession = {
auto: false,
data: {
"proposal.siteArea": 2993.67,
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -4364,7 +4364,7 @@ export const mockLDCESession = {
properties: null,
},
"proposal.siteArea.hectares": 0.299367,
"property.boundary.site.buffered": {
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -5220,7 +5220,7 @@ export const mockLDCPSession = {
"uniform.applicationTo": ["N410"],
"uniform.consentRegime": ["Certificate of Lawfulness"],
"application.about.form": ["Proposed building works"],
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -5403,7 +5403,7 @@ export const mockLDCPSession = {
"application.basisOfLawfulness": ["permittedDevelopment"],
"application.preAppAdvice.form": ["No"],
"applicant.ownership.certificate": ["a"],
"property.boundary.site.buffered": {
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -6826,7 +6826,7 @@ export const mockLDCPSession = {
auto: false,
data: {
"proposal.siteArea": 1418.26,
"property.boundary.site": {
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand All @@ -6849,7 +6849,7 @@ export const mockLDCPSession = {
properties: null,
},
"proposal.siteArea.hectares": 0.141826,
"property.boundary.site.buffered": {
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -7989,8 +7989,8 @@ export const mockLDCPSession2 = {
"uniform.consentRegime": ["Certificate of Lawfulness"],
"application.about.form": ["Proposed building works"],
"property.EPCKnown.form": ["The property does not have one"],
"property.boundary.area": 114.19,
"property.boundary.site": {
"proposal.site.area": 114.19,
"proposal.site": {
type: "Feature",
geometry: {
type: "MultiPolygon",
Expand Down Expand Up @@ -8026,7 +8026,7 @@ export const mockLDCPSession2 = {
"applicant.interest.form": ["Occupier"],
"applicant.phone.primary": "0309393939",
"application.fee.payable": 0,
"property.boundary.title": {
"property.boundary": {
type: "Feature",
geometry: {
type: "MultiPolygon",
Expand Down Expand Up @@ -8068,15 +8068,15 @@ export const mockLDCPSession2 = {
"proposal.visibility.public": ["false"],
"proposal.newFloorArea.other": 0,
"applicant.ownership.interest": ["occupier"],
"property.boundary.title.area": 114.19,
"property.boundary.area": 114.19,
"application.basisOfLawfulness": ["permittedDevelopment"],
"application.preAppAdvice.form": ["No"],
"application.sitePlan.required": ["true"],
"property.constraints.planning": ["road.classified"],
"property.titleNumberKnown.form": ["No"],
"application.elevations.required": ["true"],
"property.boundary.area.hectares": 0.011419,
"property.boundary.site.buffered": {
"proposal.site.area.hectares": 0.011419,
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -8161,7 +8161,7 @@ export const mockLDCPSession2 = {
"property.ownership.ownerOne.interest": ["owner"],
"application.declaration.accurate.form": ["Yes"],
"application.sitePlanProposed.required": ["true"],
"property.boundary.title.area.hectares": 0.011419,
"property.boundary.area.hectares": 0.011419,
"application.fee.category.oneToThirteen": ["true"],
"application.fee.exemption.resubmission": ["false"],
"application.declaration.connection.form": ["No connections"],
Expand Down Expand Up @@ -9171,7 +9171,7 @@ export const mockLDCPSession2 = {
},
"property.region": ["London"],
"findProperty.action": "Selected an existing address",
"property.boundary.title": {
"property.boundary": {
type: "Feature",
geometry: {
type: "MultiPolygon",
Expand Down Expand Up @@ -9201,9 +9201,9 @@ export const mockLDCPSession2 = {
"organisation-entity": "13",
},
},
"property.boundary.title.area": 114.19,
"property.boundary.area": 114.19,
"property.localAuthorityDistrict": ["Lambeth"],
"property.boundary.title.area.hectares": 0.011419,
"property.boundary.area.hectares": 0.011419,
},
},
HM4ffx9N7u: {
Expand Down Expand Up @@ -9833,8 +9833,8 @@ export const mockLDCPSession2 = {
auto: false,
data: {
"drawBoundary.action": "Accepted the title boundary",
"property.boundary.area": 114.19,
"property.boundary.site": {
"proposal.site.area": 114.19,
"proposal.site": {
type: "Feature",
geometry: {
type: "MultiPolygon",
Expand Down Expand Up @@ -9864,8 +9864,8 @@ export const mockLDCPSession2 = {
"organisation-entity": "13",
},
},
"property.boundary.area.hectares": 0.011419,
"property.boundary.site.buffered": {
"proposal.site.area.hectares": 0.011419,
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down
16 changes: 8 additions & 8 deletions src/export/digitalPlanning/mocks/planningPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,8 @@ export const mockPlanningPermissionSession = {
"applicant.agent.title": "Mx",
"applicant.siteContact.role": ["proxy"],
"property.EPCKnown.form": ["The property does not have one"],
"property.boundary.area": 125.92,
"property.boundary.site": {
"proposal.site.area": 125.92,
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -901,8 +901,8 @@ export const mockPlanningPermissionSession = {
"proposal.cars.number.proposed": 1,
"property.titleNumberKnown.form": ["No"],
"applicant.ownership.certificate": ["a"],
"property.boundary.area.hectares": 0.012592,
"property.boundary.site.buffered": {
"proposal.site.area.hectares": 0.012592,
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down Expand Up @@ -1816,8 +1816,8 @@ export const mockPlanningPermissionSession = {
H5vt0Zwv5M: {
auto: false,
data: {
"property.boundary.area": 125.92,
"property.boundary.site": {
"proposal.site.area": 125.92,
"proposal.site": {
type: "Feature",
geometry: {
type: "Polygon",
Expand All @@ -1833,8 +1833,8 @@ export const mockPlanningPermissionSession = {
},
properties: null,
},
"property.boundary.area.hectares": 0.012592,
"property.boundary.site.buffered": {
"proposal.site.area.hectares": 0.012592,
"proposal.site.buffered": {
type: "Feature",
geometry: {
type: "Polygon",
Expand Down
Loading
Loading