From c083dbb55b98a0eec660dddd027a842ed42e81d5 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 10 Dec 2024 17:41:50 +0000 Subject: [PATCH 01/12] add in mock data --- .../src/create-flow-with-geospatial.spec.ts | 4 + .../ui-driven/src/mocks/geospatialMocks.ts | 238 ++++++++++++++++++ 2 files changed, 242 insertions(+) diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index 02ecfbc29e..e6c29fd4d9 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -225,6 +225,10 @@ test.describe("Flow creation, publish and preview", () => { "The correct value for area comes from the map properties ", ).toBeVisible(); + await expect( + page.locator("h1", { hasText: "Planning constraints" }), + ).toBeVisible(); + // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints }); diff --git a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts index e923545f46..150e27d3f0 100644 --- a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts +++ b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts @@ -64,3 +64,241 @@ export const mockChangedMapGeoJson: GeoJsonChangeHandler = { "area.hectares": 0.001072, }, }; + +export const mockChangedMapGeoJson: GeoJsonChangeHandler = { + type: "Feature", + geometry: { + type: "Polygon", + coordinates: [ + [ + [-0.6341888375038146, 51.60562241658701], + [-0.6341217822784424, 51.605580770520504], + [-0.63405472705307, 51.605580770520504], + [-0.6341888375038146, 51.60562241658701], + ], + ], + }, + properties: { + label: "1", + "area.squareMetres": 10.72, + "area.hectares": 0.001072, + }, +}; + +export const mockPropertyConstraints = { + sourceRequest: "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=conservation-area&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", + constraints: { + listed: { + fn: "listed", + value: true, + text: "is, or is within, a Listed Building", + data: [ + { + "entry-date": "2024-04-16", + "start-date": "1980-05-15", + "end-date": "", + entity: 42103309, + name: "No Address Supplied", + dataset: "listed-building-outline", + typology: "geography", + reference: "12/435 and 963/1", + prefix: "listed-building-outline", + "organisation-entity": "192" + } + ], + category: "Heritage and conservation" + }, + "designated.conservationArea": { + fn: "designated.conservationArea", + value: true, + text: "is in a Conservation Area", + data: [ + { + "entry-date": "2024-01-13", + "start-date": "1974-06-25", + "end-date": "", + entity: 44000877, + name: "Hackford Road", + dataset: "conservation-area", + typology: "geography", + reference: "CA16", + prefix: "conservation-area", + "organisation-entity": "192", + "designation-date": "1974-06-25" + } + ], + category: "Heritage and conservation" + }, + article4: { + fn: "article4", + value: false, + text: "is not in an Article 4 direction area", + category: "General policy" + }, + "article4.caz": { + fn: "article4.caz", + value: false, + text: "is not in the Central Activities Zone", + category: "General policy" + }, + brownfieldSite: { + fn: "brownfieldSite", + value: false, + text: "is not on Brownfield land", + category: "General policy" + }, + "designated.AONB": { + fn: "designated.AONB", + value: false, + text: "is not in an Area of Outstanding Natural Beauty", + category: "Heritage and conservation" + }, + greenBelt: { + fn: "greenBelt", + value: false, + text: "is not in a Green Belt", + category: "General policy" + }, + "designated.nationalPark": { + fn: "designated.nationalPark", + value: false, + text: "is not in a National Park", + category: "Heritage and conservation" + }, + "designated.nationalPark.broads": { + fn: "designated.nationalPark.broads", + value: false + }, + "designated.WHS": { + fn: "designated.WHS", + value: false, + text: "is not an UNESCO World Heritage Site", + category: "Heritage and conservation" + }, + flood: { + fn: "flood", + value: false, + text: "is not in a Flood Risk Zone", + category: "Flooding" + }, + monument: { + fn: "monument", + value: false, + text: "is not the site of a Scheduled Monument", + category: "Heritage and conservation" + }, + "nature.ASNW": { + fn: "nature.ASNW", + value: false, + text: "is not in an Ancient Semi-Natural Woodland (ASNW)", + category: "Ecology" + }, + "nature.ramsarSite": { + fn: "nature.ramsarSite", + value: false, + text: "is not in a Ramsar Site", + category: "Ecology" + }, + "nature.SAC": { + fn: "nature.SAC", + value: false, + text: "is not in a Special Area of Conservation (SAC)", + category: "Ecology" + }, + "nature.SPA": { + fn: "nature.SPA", + value: false, + text: "is not in a Special Protection Area (SPA)", + category: "Ecology" + }, + "nature.SSSI": { + fn: "nature.SSSI", + value: false, + text: "is not a Site of Special Scientific Interest (SSSI)", + category: "Ecology" + }, + registeredPark: { + fn: "registeredPark", + value: false, + text: "is not in a Historic Park or Garden", + category: "Heritage and conservation" + }, + tpo: { + fn: "tpo", + value: false, + text: "is not in a Tree Preservation Order (TPO) Zone", + category: "Trees" + }, + designated: { + value: true + }, + "listed.grade.I": { + fn: "listed.grade.I", + value: false + }, + "listed.grade.II": { + fn: "listed.grade.II", + value: false + }, + "listed.grade.II*": { + fn: "listed.grade.II*", + value: false + } + }, + metadata: { + article4: { + "entry-date": "", + "start-date": "", + "end-date": "", + collection: "article-4-direction", + dataset: "article-4-direction-area", + description: "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", + name: "Article 4 direction area", + plural: "Article 4 direction areas", + prefix: "", + text: "A local planning authority may create an [article 4 direction](https://www.gov.uk/guidance/when-is-permission-required#article-4-direction) to alter or remove [permitted development rights](https://www.gov.uk/government/publications/permitted-development-rights-for-householders-technical-guidance) from a building or area.\n\nEach [article 4 direction](/dataset/article-4-direction) may apply to one or more article 4 direction areas.", + typology: "geography", + wikidata: "", + wikipedia: "", + entities: "", + themes: ["heritage"], + "entity-count": { + dataset: "article-4-direction-area", + count: 2444 + }, + "paint-options": "", + attribution: "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + licence: "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + consideration: "article-4-directions", + "github-discussion": 30, + "entity-minimum": 7010000000, + "entity-maximum": 7019999999, + phase: "beta", + realm: "dataset", + "replacement-dataset": "", + version: "3.0" + }, + // ... rest of metadata entries follow same structure + } +}; + +export const mockRoadData = { + sourceRequest: "https://api.os.uk/features/v1/wfs?service=WFS&request=GetFeature&version=2.0.0&typeNames=Highways_RoadLink&outputFormat=GEOJSON&srsName=urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326&count=1&filter=%0A++++%3Cogc%3AFilter%3E%0A++++++%3Cogc%3APropertyIsLike+wildCard%3D%22%25%22+singleChar%3D%22%23%22+escapeChar%3D%22%21%22%3E%0A++++++++%3Cogc%3APropertyName%3EFormsPartOf%3C%2Fogc%3APropertyName%3E%0A++++++++%3Cogc%3ALiteral%3E%25Street%23usrn21900651%25%3C%2Fogc%3ALiteral%3E%0A++++++%3C%2Fogc%3APropertyIsLike%3E%0A++++%3C%2Fogc%3AFilter%3E%0A++&", + metadata: { + "road.classified": { + name: "Classified road", + plural: "Classified roads", + text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road." + } + }, + constraints: { + "road.classified": { + fn: "road.classified", + value: false, + text: "is not on a Classified Road", + category: "General policy" + } + } +}; \ No newline at end of file From a25f5f5216392c5207e55c903fe7ec2a15117e95 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 10 Dec 2024 18:45:48 +0000 Subject: [PATCH 02/12] setup mocks for network intercepts --- .../src/create-flow-with-geospatial.spec.ts | 13 +++ e2e/tests/ui-driven/src/helpers/context.ts | 18 ++++ .../ui-driven/src/mocks/geospatialMocks.ts | 90 ++++++++++--------- e2e/tests/ui-driven/src/mocks/gisResponse.ts | 23 +++++ 4 files changed, 102 insertions(+), 42 deletions(-) create mode 100644 e2e/tests/ui-driven/src/mocks/gisResponse.ts diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index e6c29fd4d9..12072b0ca5 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -37,6 +37,10 @@ import { setupOSMapsStyles, setupOSMapsVectorTiles, } from "./mocks/osMapsResponse"; +import { + setupGISMockResponse, + setupRoadsMockResponse, +} from "./mocks/gisResponse"; test.describe("Flow creation, publish and preview", () => { let context: TestContext = { @@ -133,6 +137,9 @@ test.describe("Flow creation, publish and preview", () => { setupOSMapsStyles(page); setupOSMapsVectorTiles(page); + await setupGISMockResponse(page); + await setupRoadsMockResponse(page); + await expect( page.locator("h1", { hasText: "Find the property" }), ).toBeVisible(); @@ -229,6 +236,12 @@ test.describe("Flow creation, publish and preview", () => { page.locator("h1", { hasText: "Planning constraints" }), ).toBeVisible(); + await expect( + page.getByText( + "These are the planning constraints we think apply to this property", + ), + ).toBeVisible(); + // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints }); diff --git a/e2e/tests/ui-driven/src/helpers/context.ts b/e2e/tests/ui-driven/src/helpers/context.ts index 792a99a1ed..38ef6a3109 100644 --- a/e2e/tests/ui-driven/src/helpers/context.ts +++ b/e2e/tests/ui-driven/src/helpers/context.ts @@ -50,6 +50,24 @@ export async function setUpTestContext( submissionEmail: context.team.settings?.submissionEmail, }, }); + const integrations = await $admin.client.request( + gql` + mutation AddPlanningData($teamId: Int) { + update_team_integrations( + where: { team_id: { _eq: $teamId } } + _set: { has_planning_data: true } + ) { + returning { + has_planning_data + team_id + } + } + } + `, + { + teamId: context.team.id, + }, + ); } if ( context.flow && diff --git a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts index 150e27d3f0..199b9db386 100644 --- a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts +++ b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts @@ -86,7 +86,8 @@ export const mockChangedMapGeoJson: GeoJsonChangeHandler = { }; export const mockPropertyConstraints = { - sourceRequest: "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=conservation-area&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", + sourceRequest: + "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=conservation-area&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", constraints: { listed: { fn: "listed", @@ -103,10 +104,10 @@ export const mockPropertyConstraints = { typology: "geography", reference: "12/435 and 963/1", prefix: "listed-building-outline", - "organisation-entity": "192" - } + "organisation-entity": "192", + }, ], - category: "Heritage and conservation" + category: "Heritage and conservation", }, "designated.conservationArea": { fn: "designated.conservationArea", @@ -124,126 +125,126 @@ export const mockPropertyConstraints = { reference: "CA16", prefix: "conservation-area", "organisation-entity": "192", - "designation-date": "1974-06-25" - } + "designation-date": "1974-06-25", + }, ], - category: "Heritage and conservation" + category: "Heritage and conservation", }, article4: { fn: "article4", value: false, text: "is not in an Article 4 direction area", - category: "General policy" + category: "General policy", }, "article4.caz": { fn: "article4.caz", value: false, text: "is not in the Central Activities Zone", - category: "General policy" + category: "General policy", }, brownfieldSite: { fn: "brownfieldSite", value: false, text: "is not on Brownfield land", - category: "General policy" + category: "General policy", }, "designated.AONB": { fn: "designated.AONB", - value: false, + value: true, text: "is not in an Area of Outstanding Natural Beauty", - category: "Heritage and conservation" + category: "Heritage and conservation", }, greenBelt: { fn: "greenBelt", value: false, text: "is not in a Green Belt", - category: "General policy" + category: "General policy", }, "designated.nationalPark": { fn: "designated.nationalPark", value: false, text: "is not in a National Park", - category: "Heritage and conservation" + category: "Heritage and conservation", }, "designated.nationalPark.broads": { fn: "designated.nationalPark.broads", - value: false + value: false, }, "designated.WHS": { fn: "designated.WHS", value: false, text: "is not an UNESCO World Heritage Site", - category: "Heritage and conservation" + category: "Heritage and conservation", }, flood: { fn: "flood", value: false, text: "is not in a Flood Risk Zone", - category: "Flooding" + category: "Flooding", }, monument: { fn: "monument", value: false, text: "is not the site of a Scheduled Monument", - category: "Heritage and conservation" + category: "Heritage and conservation", }, "nature.ASNW": { fn: "nature.ASNW", value: false, text: "is not in an Ancient Semi-Natural Woodland (ASNW)", - category: "Ecology" + category: "Ecology", }, "nature.ramsarSite": { fn: "nature.ramsarSite", value: false, text: "is not in a Ramsar Site", - category: "Ecology" + category: "Ecology", }, "nature.SAC": { fn: "nature.SAC", value: false, text: "is not in a Special Area of Conservation (SAC)", - category: "Ecology" + category: "Ecology", }, "nature.SPA": { fn: "nature.SPA", value: false, text: "is not in a Special Protection Area (SPA)", - category: "Ecology" + category: "Ecology", }, "nature.SSSI": { fn: "nature.SSSI", value: false, text: "is not a Site of Special Scientific Interest (SSSI)", - category: "Ecology" + category: "Ecology", }, registeredPark: { fn: "registeredPark", value: false, text: "is not in a Historic Park or Garden", - category: "Heritage and conservation" + category: "Heritage and conservation", }, tpo: { fn: "tpo", value: false, text: "is not in a Tree Preservation Order (TPO) Zone", - category: "Trees" + category: "Trees", }, designated: { - value: true + value: true, }, "listed.grade.I": { fn: "listed.grade.I", - value: false + value: false, }, "listed.grade.II": { fn: "listed.grade.II", - value: false + value: false, }, "listed.grade.II*": { fn: "listed.grade.II*", - value: false - } + value: false, + }, }, metadata: { article4: { @@ -252,7 +253,8 @@ export const mockPropertyConstraints = { "end-date": "", collection: "article-4-direction", dataset: "article-4-direction-area", - description: "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", + description: + "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", name: "Article 4 direction area", plural: "Article 4 direction areas", prefix: "", @@ -264,13 +266,14 @@ export const mockPropertyConstraints = { themes: ["heritage"], "entity-count": { dataset: "article-4-direction-area", - count: 2444 + count: 2444, }, "paint-options": "", attribution: "crown-copyright", "attribution-text": "© Crown copyright and database right 2024", licence: "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "licence-text": + "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", consideration: "article-4-directions", "github-discussion": 30, "entity-minimum": 7010000000, @@ -278,27 +281,30 @@ export const mockPropertyConstraints = { phase: "beta", realm: "dataset", "replacement-dataset": "", - version: "3.0" + version: "3.0", }, // ... rest of metadata entries follow same structure - } + }, }; export const mockRoadData = { - sourceRequest: "https://api.os.uk/features/v1/wfs?service=WFS&request=GetFeature&version=2.0.0&typeNames=Highways_RoadLink&outputFormat=GEOJSON&srsName=urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326&count=1&filter=%0A++++%3Cogc%3AFilter%3E%0A++++++%3Cogc%3APropertyIsLike+wildCard%3D%22%25%22+singleChar%3D%22%23%22+escapeChar%3D%22%21%22%3E%0A++++++++%3Cogc%3APropertyName%3EFormsPartOf%3C%2Fogc%3APropertyName%3E%0A++++++++%3Cogc%3ALiteral%3E%25Street%23usrn21900651%25%3C%2Fogc%3ALiteral%3E%0A++++++%3C%2Fogc%3APropertyIsLike%3E%0A++++%3C%2Fogc%3AFilter%3E%0A++&", + sourceRequest: + "https://api.os.uk/features/v1/wfs?service=WFS&request=GetFeature&version=2.0.0&typeNames=Highways_RoadLink&outputFormat=GEOJSON&srsName=urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326&count=1&filter=%0A++++%3Cogc%3AFilter%3E%0A++++++%3Cogc%3APropertyIsLike+wildCard%3D%22%25%22+singleChar%3D%22%23%22+escapeChar%3D%22%21%22%3E%0A++++++++%3Cogc%3APropertyName%3EFormsPartOf%3C%2Fogc%3APropertyName%3E%0A++++++++%3Cogc%3ALiteral%3E%25Street%23usrn21900651%25%3C%2Fogc%3ALiteral%3E%0A++++++%3C%2Fogc%3APropertyIsLike%3E%0A++++%3C%2Fogc%3AFilter%3E%0A++&", metadata: { "road.classified": { name: "Classified road", plural: "Classified roads", - text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road." - } + text: "This will effect your project if you are looking to add a dropped kerb. It may also impact some agricultural or forestry projects within 25 metres of a classified road.", + }, }, constraints: { "road.classified": { fn: "road.classified", value: false, text: "is not on a Classified Road", - category: "General policy" - } - } -}; \ No newline at end of file + category: "General policy", + }, + }, +}; + +export const mockDigitalLandURL = `https://api.editor.planx.dev/gis/testing?geom=POINT%28-0.1151501+51.4745098%29&vals=article4%2Carticle4.caz%2CbrownfieldSite%2Cdesignated.AONB%2Cdesignated.conservationArea%2CgreenBelt%2Cdesignated.nationalPark%2Cdesignated.nationalPark.broads%2Cdesignated.WHS%2Cflood%2Clisted%2Cmonument%2Cnature.ASNW%2Cnature.ramsarSite%2Cnature.SAC%2Cnature.SPA%2Cnature.SSSI%2CregisteredPark%2Ctpo%2Croad.classified`; diff --git a/e2e/tests/ui-driven/src/mocks/gisResponse.ts b/e2e/tests/ui-driven/src/mocks/gisResponse.ts new file mode 100644 index 0000000000..6f410ce93b --- /dev/null +++ b/e2e/tests/ui-driven/src/mocks/gisResponse.ts @@ -0,0 +1,23 @@ +import { Page } from "@playwright/test"; +import { mockPropertyConstraints, mockRoadData } from "./geospatialMocks"; + +export async function setupGISMockResponse(page: Page) { + const gisDigitalLandEndpoint = new RegExp(/\/gis\/E2E\?geom.*/); + const wildcardPattern = "**/gis/E2E?geom*"; + await page.route(wildcardPattern, async (route) => { + await route.fulfill({ + status: 200, + body: JSON.stringify(mockPropertyConstraints), + }); + }); +} + +export async function setupRoadsMockResponse(page: Page) { + const gisRoadsEndpoint = new RegExp(/\/roads\?.*/); + await page.route(gisRoadsEndpoint, async (route) => { + await route.fulfill({ + status: 200, + body: JSON.stringify(mockRoadData), + }); + }); +} From 26a3a80a49e5beeb4f0f82b3701170d1349b38e9 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 10 Dec 2024 18:57:23 +0000 Subject: [PATCH 03/12] add checks up to the first constraint displaying for listed building --- e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index 12072b0ca5..c92d2ba0d5 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -242,6 +242,8 @@ test.describe("Flow creation, publish and preview", () => { ), ).toBeVisible(); + await expect(page.getByRole('button', { name: 'is, or is within, a Listed' })).toBeVisible() + // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints }); From 680a1b21d6a9ac88954057f99f9398dbfd63b7e3 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 10 Dec 2024 18:57:37 +0000 Subject: [PATCH 04/12] lint:fix --- e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index c92d2ba0d5..6e7f8d3f46 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -242,7 +242,9 @@ test.describe("Flow creation, publish and preview", () => { ), ).toBeVisible(); - await expect(page.getByRole('button', { name: 'is, or is within, a Listed' })).toBeVisible() + await expect( + page.getByRole("button", { name: "is, or is within, a Listed" }), + ).toBeVisible(); // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints From ac3314d8f8aebc27ed36d59970f488a9716c5268 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 17 Dec 2024 16:24:29 +0000 Subject: [PATCH 05/12] add extra request checks --- .../src/create-flow-with-geospatial.spec.ts | 10 ++++++++ .../ui-driven/src/helpers/addComponent.ts | 4 +++ e2e/tests/ui-driven/src/helpers/context.ts | 4 ++- .../ui-driven/src/mocks/geospatialMocks.ts | 24 +----------------- e2e/tests/ui-driven/src/mocks/gisResponse.ts | 25 ++++++++++++++++--- 5 files changed, 39 insertions(+), 28 deletions(-) diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index 6e7f8d3f46..d1c05d06b1 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -38,6 +38,7 @@ import { setupOSMapsVectorTiles, } from "./mocks/osMapsResponse"; import { + planningConstraintHeaders, setupGISMockResponse, setupRoadsMockResponse, } from "./mocks/gisResponse"; @@ -246,6 +247,15 @@ test.describe("Flow creation, publish and preview", () => { page.getByRole("button", { name: "is, or is within, a Listed" }), ).toBeVisible(); + // ensure constraints that don't apply show up + await page + .getByRole("button", { name: "Constraints that don't apply" }) + .click(); + + const dontApplyHeadings = await page.getByRole("heading").allTextContents(); + + expect(dontApplyHeadings).toEqual(planningConstraintHeaders); + // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints }); diff --git a/e2e/tests/ui-driven/src/helpers/addComponent.ts b/e2e/tests/ui-driven/src/helpers/addComponent.ts index 0ad8f252d1..7f9c6f10b3 100644 --- a/e2e/tests/ui-driven/src/helpers/addComponent.ts +++ b/e2e/tests/ui-driven/src/helpers/addComponent.ts @@ -87,6 +87,10 @@ const createBaseComponent = async ( await page.getByLabel("Show users a 'change' link to").click(); break; case ComponentType.PlanningConstraints: + await page + .getByRole("row", { name: "via Planning Data: conservation-area" }) + .locator("span") + .click(); break; case ComponentType.DrawBoundary: break; diff --git a/e2e/tests/ui-driven/src/helpers/context.ts b/e2e/tests/ui-driven/src/helpers/context.ts index 38ef6a3109..e88bce2a0b 100644 --- a/e2e/tests/ui-driven/src/helpers/context.ts +++ b/e2e/tests/ui-driven/src/helpers/context.ts @@ -50,7 +50,9 @@ export async function setUpTestContext( submissionEmail: context.team.settings?.submissionEmail, }, }); - const integrations = await $admin.client.request( + + // has_planning_data needs to be altered manually for geospatial tests + await $admin.client.request( gql` mutation AddPlanningData($teamId: Int) { update_team_integrations( diff --git a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts index 199b9db386..1b4df41a05 100644 --- a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts +++ b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts @@ -109,27 +109,6 @@ export const mockPropertyConstraints = { ], category: "Heritage and conservation", }, - "designated.conservationArea": { - fn: "designated.conservationArea", - value: true, - text: "is in a Conservation Area", - data: [ - { - "entry-date": "2024-01-13", - "start-date": "1974-06-25", - "end-date": "", - entity: 44000877, - name: "Hackford Road", - dataset: "conservation-area", - typology: "geography", - reference: "CA16", - prefix: "conservation-area", - "organisation-entity": "192", - "designation-date": "1974-06-25", - }, - ], - category: "Heritage and conservation", - }, article4: { fn: "article4", value: false, @@ -150,7 +129,7 @@ export const mockPropertyConstraints = { }, "designated.AONB": { fn: "designated.AONB", - value: true, + value: false, text: "is not in an Area of Outstanding Natural Beauty", category: "Heritage and conservation", }, @@ -283,7 +262,6 @@ export const mockPropertyConstraints = { "replacement-dataset": "", version: "3.0", }, - // ... rest of metadata entries follow same structure }, }; diff --git a/e2e/tests/ui-driven/src/mocks/gisResponse.ts b/e2e/tests/ui-driven/src/mocks/gisResponse.ts index 6f410ce93b..eed4289076 100644 --- a/e2e/tests/ui-driven/src/mocks/gisResponse.ts +++ b/e2e/tests/ui-driven/src/mocks/gisResponse.ts @@ -1,10 +1,11 @@ -import { Page } from "@playwright/test"; +import { expect, Page } from "@playwright/test"; import { mockPropertyConstraints, mockRoadData } from "./geospatialMocks"; export async function setupGISMockResponse(page: Page) { - const gisDigitalLandEndpoint = new RegExp(/\/gis\/E2E\?geom.*/); - const wildcardPattern = "**/gis/E2E?geom*"; - await page.route(wildcardPattern, async (route) => { + const gisDigitalLandEndpoint = "**/gis/E2E?geom*"; + await page.route(gisDigitalLandEndpoint, async (route, request) => { + const urlContainsConstraints = checkGISMockRequestUrl(request.url()); + expect(urlContainsConstraints).toEqual(true); await route.fulfill({ status: 200, body: JSON.stringify(mockPropertyConstraints), @@ -12,6 +13,11 @@ export async function setupGISMockResponse(page: Page) { }); } +export function checkGISMockRequestUrl(url: string) { + const splitUrl = url.split("/").pop()?.split("%2C"); + return !splitUrl?.includes("designated.conservationArea"); +} + export async function setupRoadsMockResponse(page: Page) { const gisRoadsEndpoint = new RegExp(/\/roads\?.*/); await page.route(gisRoadsEndpoint, async (route) => { @@ -21,3 +27,14 @@ export async function setupRoadsMockResponse(page: Page) { }); }); } + +export const planningConstraintHeaders = [ + "Planning constraints", + "These are the planning constraints we think apply to this property", + "Heritage and conservation", + "General policy", + "Heritage and conservation", + "Flooding", + "Ecology", + "Trees", +]; From a27c02f2a5a765990127557086a0545274a85ede Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 17 Dec 2024 16:44:35 +0000 Subject: [PATCH 06/12] add geoSpatial user actions --- .../src/create-flow-with-geospatial.spec.ts | 25 ++++++++++---- .../src/helpers/geoSpatialUserActions.ts | 33 +++++++++++++++++++ .../ui-driven/src/helpers/userActions.ts | 7 ---- 3 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index d1c05d06b1..c152f08c71 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -6,11 +6,7 @@ import { } from "./helpers/context"; import { getTeamPage } from "./helpers/getPage"; import { createAuthenticatedSession } from "./helpers/globalHelpers"; -import { - answerFindProperty, - answerQuestion, - clickContinue, -} from "./helpers/userActions"; +import { answerQuestion, clickContinue } from "./helpers/userActions"; import { PlaywrightEditor } from "./pages/Editor"; import { navigateToService, @@ -42,6 +38,11 @@ import { setupGISMockResponse, setupRoadsMockResponse, } from "./mocks/gisResponse"; +import exp from "node:constants"; +import { + answerFindProperty, + userChallengesPlanningConstraint, +} from "./helpers/geoSpatialUserActions"; test.describe("Flow creation, publish and preview", () => { let context: TestContext = { @@ -243,10 +244,22 @@ test.describe("Flow creation, publish and preview", () => { ), ).toBeVisible(); + const listedBuildingConstraintRowItem = page.getByRole("button", { + name: "is, or is within, a Listed", + }); + + await expect(listedBuildingConstraintRowItem).toBeVisible(); + + await listedBuildingConstraintRowItem.click(); + + await userChallengesPlanningConstraint(page); + await expect( - page.getByRole("button", { name: "is, or is within, a Listed" }), + listedBuildingConstraintRowItem.getByText("Marked as not applicable"), ).toBeVisible(); + await listedBuildingConstraintRowItem.click(); + // ensure constraints that don't apply show up await page .getByRole("button", { name: "Constraints that don't apply" }) diff --git a/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts b/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts new file mode 100644 index 0000000000..71829f4e76 --- /dev/null +++ b/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts @@ -0,0 +1,33 @@ +import { Page } from "@playwright/test"; +import { setupOSMockResponse } from "../mocks/osPlacesResponse"; + +export async function answerFindProperty(page: Page) { + await setupOSMockResponse(page); + await page.getByLabel("Postcode").fill("SW1 1AA"); + await page.getByLabel("Select an address").click(); + await page.getByRole("option").first().click(); +} + +export const userChallengesPlanningConstraint = async (page: Page) => { + const thisDoesNotApplyConstraintButton = page.getByRole("button", { + name: "I don't think this constraint", + }); + + await thisDoesNotApplyConstraintButton.click(); + + const constraintDoesNotApplyDialog = page.getByRole("heading", { + name: "I don't think this constraint", + }); + constraintDoesNotApplyDialog.isVisible(); + + const noAddressSuppliedButton = page.getByTestId("42103309"); + noAddressSuppliedButton.click(); + + const tellUsWhyText = page.getByRole("textbox"); + await tellUsWhyText.fill("This is the reason why"); + + const submitConstraintChallenge = page.getByTestId( + "override-modal-submit-button", + ); + submitConstraintChallenge.click(); +}; diff --git a/e2e/tests/ui-driven/src/helpers/userActions.ts b/e2e/tests/ui-driven/src/helpers/userActions.ts index 35d24d5ae9..44682ed558 100644 --- a/e2e/tests/ui-driven/src/helpers/userActions.ts +++ b/e2e/tests/ui-driven/src/helpers/userActions.ts @@ -194,13 +194,6 @@ export async function submitCardDetails(page: Page) { await page.locator("#confirm").click(); } -export async function answerFindProperty(page: Page) { - await setupOSMockResponse(page); - await page.getByLabel("Postcode").fill("SW1 1AA"); - await page.getByLabel("Select an address").click(); - await page.getByRole("option").first().click(); -} - export async function answerContactInput( page: Page, { From 56e8cc0e5fcf341293d0ce95636f18c095e8f85d Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 17 Dec 2024 16:50:32 +0000 Subject: [PATCH 07/12] refine data mocks --- .../ui-driven/src/mocks/geospatialMocks.ts | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts index 1b4df41a05..d319de3977 100644 --- a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts +++ b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts @@ -225,44 +225,6 @@ export const mockPropertyConstraints = { value: false, }, }, - metadata: { - article4: { - "entry-date": "", - "start-date": "", - "end-date": "", - collection: "article-4-direction", - dataset: "article-4-direction-area", - description: - "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", - name: "Article 4 direction area", - plural: "Article 4 direction areas", - prefix: "", - text: "A local planning authority may create an [article 4 direction](https://www.gov.uk/guidance/when-is-permission-required#article-4-direction) to alter or remove [permitted development rights](https://www.gov.uk/government/publications/permitted-development-rights-for-householders-technical-guidance) from a building or area.\n\nEach [article 4 direction](/dataset/article-4-direction) may apply to one or more article 4 direction areas.", - typology: "geography", - wikidata: "", - wikipedia: "", - entities: "", - themes: ["heritage"], - "entity-count": { - dataset: "article-4-direction-area", - count: 2444, - }, - "paint-options": "", - attribution: "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - licence: "ogl3", - "licence-text": - "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - consideration: "article-4-directions", - "github-discussion": 30, - "entity-minimum": 7010000000, - "entity-maximum": 7019999999, - phase: "beta", - realm: "dataset", - "replacement-dataset": "", - version: "3.0", - }, - }, }; export const mockRoadData = { @@ -284,5 +246,3 @@ export const mockRoadData = { }, }, }; - -export const mockDigitalLandURL = `https://api.editor.planx.dev/gis/testing?geom=POINT%28-0.1151501+51.4745098%29&vals=article4%2Carticle4.caz%2CbrownfieldSite%2Cdesignated.AONB%2Cdesignated.conservationArea%2CgreenBelt%2Cdesignated.nationalPark%2Cdesignated.nationalPark.broads%2Cdesignated.WHS%2Cflood%2Clisted%2Cmonument%2Cnature.ASNW%2Cnature.ramsarSite%2Cnature.SAC%2Cnature.SPA%2Cnature.SSSI%2CregisteredPark%2Ctpo%2Croad.classified`; From 1d0f807f6458f5d73e26322e239b5a3870a7645c Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 17 Dec 2024 16:55:24 +0000 Subject: [PATCH 08/12] refine imports and mock naming --- e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts | 6 +++--- e2e/tests/ui-driven/src/helpers/userActions.ts | 1 - e2e/tests/ui-driven/src/mocks/gisResponse.ts | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index c152f08c71..303f8b9217 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -34,11 +34,10 @@ import { setupOSMapsVectorTiles, } from "./mocks/osMapsResponse"; import { - planningConstraintHeaders, + planningConstraintHeadersMock, setupGISMockResponse, setupRoadsMockResponse, } from "./mocks/gisResponse"; -import exp from "node:constants"; import { answerFindProperty, userChallengesPlanningConstraint, @@ -258,6 +257,7 @@ test.describe("Flow creation, publish and preview", () => { listedBuildingConstraintRowItem.getByText("Marked as not applicable"), ).toBeVisible(); + // click to hide constraint data await listedBuildingConstraintRowItem.click(); // ensure constraints that don't apply show up @@ -267,7 +267,7 @@ test.describe("Flow creation, publish and preview", () => { const dontApplyHeadings = await page.getByRole("heading").allTextContents(); - expect(dontApplyHeadings).toEqual(planningConstraintHeaders); + expect(dontApplyHeadings).toEqual(planningConstraintHeadersMock); // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints diff --git a/e2e/tests/ui-driven/src/helpers/userActions.ts b/e2e/tests/ui-driven/src/helpers/userActions.ts index 44682ed558..6229183c02 100644 --- a/e2e/tests/ui-driven/src/helpers/userActions.ts +++ b/e2e/tests/ui-driven/src/helpers/userActions.ts @@ -1,6 +1,5 @@ import type { Locator, Page } from "@playwright/test"; import { expect } from "@playwright/test"; -import { setupOSMockResponse } from "../mocks/osPlacesResponse"; import { findSessionId, getGraphQLClient } from "./context"; import { TEST_EMAIL, log, waitForDebugLog } from "./globalHelpers"; import { TestContext } from "./types"; diff --git a/e2e/tests/ui-driven/src/mocks/gisResponse.ts b/e2e/tests/ui-driven/src/mocks/gisResponse.ts index eed4289076..29dafa15ab 100644 --- a/e2e/tests/ui-driven/src/mocks/gisResponse.ts +++ b/e2e/tests/ui-driven/src/mocks/gisResponse.ts @@ -28,7 +28,7 @@ export async function setupRoadsMockResponse(page: Page) { }); } -export const planningConstraintHeaders = [ +export const planningConstraintHeadersMock = [ "Planning constraints", "These are the planning constraints we think apply to this property", "Heritage and conservation", From 717eeaf17857518c9d48424efac991d0863d2408 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 17 Dec 2024 17:12:09 +0000 Subject: [PATCH 09/12] fix answerFindProp --- e2e/tests/ui-driven/src/invite-to-pay/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts b/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts index 40009b5b90..0d29aac6a9 100644 --- a/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts +++ b/e2e/tests/ui-driven/src/invite-to-pay/helpers.ts @@ -5,10 +5,10 @@ import { TEST_EMAIL, addSessionToContext, log } from "../helpers/globalHelpers"; import { answerChecklist, answerContactInput, - answerFindProperty, fillInEmail, } from "../helpers/userActions"; import { TestContext } from "../helpers/types"; +import { answerFindProperty } from "../helpers/geoSpatialUserActions"; /** * Navigates to pay component whilst completing the minimum requirements for an Invite to Pay flow From e371275f27638008d867cb537dac7f650aea5b80 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Wed, 18 Dec 2024 10:31:40 +0000 Subject: [PATCH 10/12] add true includes to gis request url check --- e2e/tests/ui-driven/src/mocks/gisResponse.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e2e/tests/ui-driven/src/mocks/gisResponse.ts b/e2e/tests/ui-driven/src/mocks/gisResponse.ts index 29dafa15ab..fbaf45ca96 100644 --- a/e2e/tests/ui-driven/src/mocks/gisResponse.ts +++ b/e2e/tests/ui-driven/src/mocks/gisResponse.ts @@ -15,7 +15,10 @@ export async function setupGISMockResponse(page: Page) { export function checkGISMockRequestUrl(url: string) { const splitUrl = url.split("/").pop()?.split("%2C"); - return !splitUrl?.includes("designated.conservationArea"); + return ( + !splitUrl?.includes("designated.conservationArea") && + splitUrl?.includes("listed") + ); } export async function setupRoadsMockResponse(page: Page) { From a43684e4ac9e9c187d37f14bf1f6a9c2485baa06 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Wed, 18 Dec 2024 15:26:49 +0000 Subject: [PATCH 11/12] add changes from comments --- .../src/create-flow-with-geospatial.spec.ts | 4 +- e2e/tests/ui-driven/src/helpers/context.ts | 2 +- .../src/helpers/geoSpatialUserActions.ts | 21 +- .../ui-driven/src/mocks/geospatialMocks.ts | 24 +- .../src/mocks/propertyConstraintMetadata.json | 606 ++++++++++++++++++ .../components/PlanningConstraints/Modal.tsx | 2 +- 6 files changed, 628 insertions(+), 31 deletions(-) create mode 100644 e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index 303f8b9217..16b46b755e 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -233,6 +233,8 @@ test.describe("Flow creation, publish and preview", () => { "The correct value for area comes from the map properties ", ).toBeVisible(); + await clickContinue({ page }); + await expect( page.locator("h1", { hasText: "Planning constraints" }), ).toBeVisible(); @@ -244,7 +246,7 @@ test.describe("Flow creation, publish and preview", () => { ).toBeVisible(); const listedBuildingConstraintRowItem = page.getByRole("button", { - name: "is, or is within, a Listed", + name: "Listed building outlines", }); await expect(listedBuildingConstraintRowItem).toBeVisible(); diff --git a/e2e/tests/ui-driven/src/helpers/context.ts b/e2e/tests/ui-driven/src/helpers/context.ts index e88bce2a0b..393895a384 100644 --- a/e2e/tests/ui-driven/src/helpers/context.ts +++ b/e2e/tests/ui-driven/src/helpers/context.ts @@ -54,7 +54,7 @@ export async function setUpTestContext( // has_planning_data needs to be altered manually for geospatial tests await $admin.client.request( gql` - mutation AddPlanningData($teamId: Int) { + mutation TogglePlanningData($teamId: Int) { update_team_integrations( where: { team_id: { _eq: $teamId } } _set: { has_planning_data: true } diff --git a/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts b/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts index 71829f4e76..aea7a7b2a4 100644 --- a/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts +++ b/e2e/tests/ui-driven/src/helpers/geoSpatialUserActions.ts @@ -1,4 +1,4 @@ -import { Page } from "@playwright/test"; +import { expect, Page } from "@playwright/test"; import { setupOSMockResponse } from "../mocks/osPlacesResponse"; export async function answerFindProperty(page: Page) { @@ -10,18 +10,18 @@ export async function answerFindProperty(page: Page) { export const userChallengesPlanningConstraint = async (page: Page) => { const thisDoesNotApplyConstraintButton = page.getByRole("button", { - name: "I don't think this constraint", + name: "I don't think this constraint applies to this property", }); await thisDoesNotApplyConstraintButton.click(); const constraintDoesNotApplyDialog = page.getByRole("heading", { - name: "I don't think this constraint", + name: "I don't think this constraint applies to this property", }); - constraintDoesNotApplyDialog.isVisible(); + await constraintDoesNotApplyDialog.isVisible(); - const noAddressSuppliedButton = page.getByTestId("42103309"); - noAddressSuppliedButton.click(); + const noAddressSuppliedButton = page.getByTestId("entity-checkbox-42103309"); + await noAddressSuppliedButton.click(); const tellUsWhyText = page.getByRole("textbox"); await tellUsWhyText.fill("This is the reason why"); @@ -29,5 +29,12 @@ export const userChallengesPlanningConstraint = async (page: Page) => { const submitConstraintChallenge = page.getByTestId( "override-modal-submit-button", ); - submitConstraintChallenge.click(); + await submitConstraintChallenge.click(); + + await expect( + page.getByTestId("error-message-checklist-error-inaccurate-entities"), + ).toBeHidden(); + await expect( + page.getByTestId("error-message-input-error-inaccurate-entities"), + ).toBeHidden(); }; diff --git a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts index d319de3977..5568658cf3 100644 --- a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts +++ b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts @@ -1,5 +1,6 @@ import { OptionWithDataValues } from "../helpers/types"; import { Feature, Polygon } from "geojson"; +import propertyConstraintsMetadata from "./propertyConstraintMetadata.json"; type ChangeHandlerProperties = { label: string; @@ -65,29 +66,9 @@ export const mockChangedMapGeoJson: GeoJsonChangeHandler = { }, }; -export const mockChangedMapGeoJson: GeoJsonChangeHandler = { - type: "Feature", - geometry: { - type: "Polygon", - coordinates: [ - [ - [-0.6341888375038146, 51.60562241658701], - [-0.6341217822784424, 51.605580770520504], - [-0.63405472705307, 51.605580770520504], - [-0.6341888375038146, 51.60562241658701], - ], - ], - }, - properties: { - label: "1", - "area.squareMetres": 10.72, - "area.hectares": 0.001072, - }, -}; - export const mockPropertyConstraints = { sourceRequest: - "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=conservation-area&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", + "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", constraints: { listed: { fn: "listed", @@ -225,6 +206,7 @@ export const mockPropertyConstraints = { value: false, }, }, + metadata: propertyConstraintsMetadata, }; export const mockRoadData = { diff --git a/e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json b/e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json new file mode 100644 index 0000000000..4025dcfe43 --- /dev/null +++ b/e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json @@ -0,0 +1,606 @@ +{ + "article4": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "article-4-direction", + "dataset": "article-4-direction-area", + "description": "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", + "name": "Article 4 direction area", + "plural": "Article 4 direction areas", + "prefix": "", + "text": "A local planning authority may create an [article 4 direction](https://www.gov.uk/guidance/when-is-permission-required#article-4-direction) to alter or remove [permitted development rights](https://www.gov.uk/government/publications/permitted-development-rights-for-householders-technical-guidance) from a building or area.\n\nEach [article 4 direction](/dataset/article-4-direction) may apply to one or more article 4 direction areas.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["heritage"], + "entity-count": { + "dataset": "article-4-direction-area", + "count": 2438 + }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "article-4-directions", + "github-discussion": 30, + "entity-minimum": 7010000000, + "entity-maximum": 7019999999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "3.0" + }, + "article4.caz": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "central-activities-zone", + "dataset": "central-activities-zone", + "description": "", + "name": "Central activities zone", + "plural": "Central activities zones", + "prefix": "", + "text": "The [Greater London Authority](https://www.london.gov.uk/) (GLA) designates a central area of London with [implications for planning](https://www.london.gov.uk/what-we-do/planning/implementing-london-plan/london-plan-guidance-and-spgs/central-activities-zone)\nThis dataset combines data provided by the GLA with the boundary from the individual London boroughs.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["development"], + "entity-count": { + "dataset": "central-activities-zone", + "count": 10 + }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "central-activty-zones", + "github-discussion": "", + "entity-minimum": 2200000, + "entity-maximum": 2299999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "brownfieldSite": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "brownfield-site", + "dataset": "brownfield-site", + "description": "", + "name": "Brownfield site", + "plural": "Brownfield sites", + "prefix": "", + "text": "This is an experimental dataset of the boundaries of brownfield sites found on [data.gov.uk](https://www.data.gov.uk/search?q=brownfield)\nand local planning authority web sites.\nWe expect to combine this dataset with the [brownfield land](/dataset/brownfield-land) dataset in the near future.", + "typology": "geography", + "wikidata": "Q896586", + "wikipedia": "Brownfield_land", + "entities": "", + "themes": ["development"], + "entity-count": { + "dataset": "brownfield-site", + "count": 339 + }, + "paint-options": { + "colour": "#745729" + }, + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "brownfield-land", + "github-discussion": 28, + "entity-minimum": 1800000, + "entity-maximum": 1899999, + "phase": "alpha", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "designated.AONB": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "area-of-outstanding-natural-beauty", + "dataset": "area-of-outstanding-natural-beauty", + "description": "Land protected by law to conserve and enhance its natural beauty", + "name": "Area of outstanding natural beauty", + "plural": "Areas of outstanding natural beauty", + "prefix": "", + "text": "An area of outstanding natural beauty (AONB) as designated by [Natural England](https://www.gov.uk/government/organisations/natural-england).\n\nNatural England provides [guidance](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications) to help local authorities decide on planning applications in protected sites and areas.", + "typology": "geography", + "wikidata": "Q174945", + "wikipedia": "Area_of_Outstanding_Natural_Beauty", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "area-of-outstanding-natural-beauty", + "count": 34 + }, + "paint-options": { + "colour": "#d53880" + }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "areas-of-outstanding-natural-beauty", + "github-discussion": 31, + "entity-minimum": 1000000, + "entity-maximum": 1099999, + "phase": "live", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "greenBelt": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "green-belt", + "dataset": "green-belt", + "description": "", + "name": "Green belt", + "plural": "Green belt", + "prefix": "", + "text": "Boundaries for land designated by a local planning authority as being [green belt](https://www.gov.uk/guidance/green-belt),\ngrouped using the [greenbelt core](/dataset/greenbelt-core) category.\nThis data is compiled by the Department for Levelling Up, Housing and Communities for the purposes of gathering [green belt statistics](https://www.gov.uk/government/collections/green-belt-statistics).", + "typology": "geography", + "wikidata": "Q2734873", + "wikipedia": "Green_belt_(United_Kingdom)", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "green-belt", + "count": 185 + }, + "paint-options": { + "colour": "#85994b" + }, + "attribution": "os-open-data", + "attribution-text": "Your use of OS OpenData is subject to the terms at http://os.uk/opendata/licence\nContains Ordnance Survey data © Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "greenbelt", + "github-discussion": 45, + "entity-minimum": 610000, + "entity-maximum": 610999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "designated.nationalPark": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "national-park", + "dataset": "national-park", + "description": "", + "name": "National park", + "plural": "National parks", + "prefix": "statistical-geography", + "text": "The administrative boundaries of [national park authorities](/dataset/national-park-authority) in England as provided by the ONS for the purposes of producing statistics.", + "typology": "geography", + "wikidata": "Q60256727", + "wikipedia": "National_park", + "entities": "", + "themes": ["heritage"], + "entity-count": { + "dataset": "national-park", + "count": 10 + }, + "paint-options": { + "colour": "#3DA52C" + }, + "attribution": "ons-boundary", + "attribution-text": "Source: Office for National Statistics licensed under the Open Government Licence v.3.0\nContains OS data © Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "national-parks-and-the-broads", + "github-discussion": "", + "entity-minimum": 520000, + "entity-maximum": 520999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "designated.WHS": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "historic-england", + "dataset": "world-heritage-site-buffer-zone", + "description": "", + "name": "World heritage site buffer zone", + "plural": "World heritage site buffer zones", + "prefix": "", + "text": "A [World Heritage Site](/dataset/world-heritage-site) may have a [buffer zone](https://whc.unesco.org/en/series/25/) with implications for planning.", + "typology": "geography", + "wikidata": "Q9259", + "wikipedia": "World_Heritage_Site", + "entities": "", + "themes": ["heritage"], + "entity-count": { + "dataset": "world-heritage-site-buffer-zone", + "count": 9 + }, + "paint-options": { + "colour": "#EB1EE5", + "opacity": 0.2 + }, + "attribution": "historic-england", + "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "world-heritage-sites", + "github-discussion": "", + "entity-minimum": 16110000, + "entity-maximum": 16129999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "flood": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "flood-risk-zone", + "dataset": "flood-risk-zone", + "description": "Area identified as being at risk of flooding from rivers or the sea", + "name": "Flood risk zone", + "plural": "Flood risk zones", + "prefix": "", + "text": "Flood zones are a guide produced by the Environment Agency to demonstrate the probability of river and sea flooding in areas across England. Flood zones are based on the likelihood of an area flooding, with flood zone 1 areas least likely to flood and flood zone 3 areas more likely to flood. \n\nThe flood zones were produced to help developers, councils and communities understand the flood risks present in specific locations or regions. Despite being a very useful indicator of an area’s flood risk, the zones cannot tell you whether a location will definitely flood or to what severity.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "flood-risk-zone", + "count": 550621 + }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "flood-risk-zones", + "github-discussion": 46, + "entity-minimum": 65000000, + "entity-maximum": 65999999, + "phase": "live", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "listed": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "listed-building", + "dataset": "listed-building-outline", + "description": "boundary of a listed building", + "name": "Listed building outline", + "plural": "Listed building outlines", + "prefix": "", + "text": "The geospatial boundary for [listed buildings](https://historicengland.org.uk/listing/what-is-designation/listed-buildings) as designated by [Historic England](https://historicengland.org.uk/) as collected from local planning authorities.\n\nWe are [working with a group of local planning authorities](/about/) to help them publish their data to inform planning decisions, and to develop a [data specification for listed building outlines](https://www.digital-land.info/guidance/specifications/listed-building).\n\nWe expect to eventually merge this dataset with the [listed building](/dataset/listed-building) dataset.", + "typology": "geography", + "wikidata": "Q570600", + "wikipedia": "Listed_building", + "entities": "", + "themes": ["heritage"], + "entity-count": { + "dataset": "listed-building-outline", + "count": 34225 + }, + "paint-options": { + "colour": "#F9C744" + }, + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "listed-buildings", + "github-discussion": 44, + "entity-minimum": 42100000, + "entity-maximum": 43099999, + "phase": "alpha", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "monument": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "historic-england", + "dataset": "scheduled-monument", + "description": "", + "name": "Scheduled monument", + "plural": "Scheduled monuments", + "prefix": "", + "text": "Historic buildings or sites such as Roman remains, burial mounds, castles, bridges, earthworks, the remains of deserted villages and industrial sites can be designated scheduled monuments by the Secretary of State for [Digital, Culture, Media and Sport](https://www.gov.uk/government/organisations/department-for-digital-culture-media-sport). \n\nThis list of scheduled monuments is kept and maintained by [Historic England](https://historicengland.org.uk/).", + "typology": "geography", + "wikidata": "Q219538", + "wikipedia": "Scheduled_monument", + "entities": "", + "themes": ["heritage"], + "entity-count": { + "dataset": "scheduled-monument", + "count": 19987 + }, + "paint-options": { + "colour": "#0F9CDA" + }, + "attribution": "historic-england", + "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "scheduled-monuments", + "github-discussion": "", + "entity-minimum": 13900000, + "entity-maximum": 13999999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.ASNW": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "ancient-woodland", + "dataset": "ancient-woodland", + "description": "An area that’s been wooded continuously since at least 1600 AD", + "name": "Ancient woodland", + "plural": "Ancient woodlands", + "prefix": "", + "text": "An area designated as ancient woodland by Natural England.\n\nNatural England and Forestry Commission [Guidance](https://www.gov.uk/guidance/ancient-woodland-and-veteran-trees-protection-surveys-licences) is used in planning decisions.", + "typology": "geography", + "wikidata": "Q3078732", + "wikipedia": "Ancient_woodland", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "ancient-woodland", + "count": 44261 + }, + "paint-options": { + "colour": "#00703c", + "opacity": 0.2 + }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "ancient-woodlands", + "github-discussion": 32, + "entity-minimum": 110000000, + "entity-maximum": 129999999, + "phase": "live", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.ramsarSite": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "ramsar", + "dataset": "ramsar", + "description": "", + "name": "Ramsar site", + "plural": "Ramsar sites", + "prefix": "", + "text": "An internationally protected site listed as a wetland of international importance.\nRamsar sites are designated by [UNESCO](https://en.unesco.org/) and managed by [Natural England](https://www.gov.uk/government/organisations/natural-england).\n\nNatural England provides [guidance ](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications) to help local authorities decide on planning applications in protected sites and areas.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "ramsar", + "count": 73 + }, + "paint-options": { + "colour": "#7fcdff" + }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "ramsar", + "github-discussion": 41, + "entity-minimum": 612000, + "entity-maximum": 619999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.SAC": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "special-area-of-conservation", + "dataset": "special-area-of-conservation", + "description": "", + "name": "Special area of conservation", + "plural": "Special areas of conservation", + "prefix": "", + "text": "Special areas of conservation (SACs) are area of land which have been designated by\n[DEFRA](https://www.gov.uk/government/organisations/department-for-environment-food-rural-affairs),\nwith advice from the [Joint Nature Conservation Committee](https://jncc.gov.uk/),\nto protect specific habitats and species.\n\nDEFRA and [Natural England](https://www.gov.uk/government/organisations/natural-england) publish\n[guidance](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications)\non how to review planning applications in protected sites and areas.", + "typology": "geography", + "wikidata": "Q1191622", + "wikipedia": "Special_Area_of_Conservation", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "special-area-of-conservation", + "count": 260 + }, + "paint-options": { + "colour": "#7A8705" + }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "special-areas-of-conservation", + "github-discussion": "", + "entity-minimum": 14800000, + "entity-maximum": 14899999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.SPA": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "special-protection-area", + "dataset": "special-protection-area", + "description": "", + "name": "Special protection area", + "plural": "Special protection areas", + "prefix": "", + "text": "[Special protection areas](https://naturalengland-defra.opendata.arcgis.com/maps/Defra::special-protection-areas-england/about) is an area designated \nfor the protection of birds and wildlife. This dataset is provided by [Natural England](https://www.gov.uk/government/organisations/natural-england).", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "special-protection-area", + "count": 88 + }, + "paint-options": "", + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "special-protection-areas", + "github-discussion": "", + "entity-minimum": 14900000, + "entity-maximum": 14999999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.SSSI": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "site-of-special-scientific-interest", + "dataset": "site-of-special-scientific-interest", + "description": "", + "name": "Site of special scientific interest", + "plural": "Sites of special scientific interest", + "prefix": "", + "text": "Sites of special scientific interest (SSSI) are nationally protected sites that have features such as wildlife or geology. \n\nSSSIs are designated by [Natural England](https://www.gov.uk/government/organisations/natural-england).\nThere is [guidance](https://www.gov.uk/guidance/protected-areas-sites-of-special-scientific-interest) to help local authorities decide on planning applications in protected SSSIs.", + "typology": "geography", + "wikidata": "Q422211", + "wikipedia": "Site_of_Special_Scientific_Interest", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "site-of-special-scientific-interest", + "count": 4128 + }, + "paint-options": { + "colour": "#308fac" + }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "sites-of-special-scientific-interest", + "github-discussion": "", + "entity-minimum": 14500000, + "entity-maximum": 14599999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "registeredPark": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "historic-england", + "dataset": "park-and-garden", + "description": "", + "name": "Historic parks and gardens", + "plural": "Parks and gardens", + "prefix": "", + "text": "Historic parks and gardens as listed by [Historic England](https://historicengland.org.uk/) in the [Register of Parks and Gardens of Special Historic Interest](https://historicengland.org.uk/listing/what-is-designation/registered-parks-and-gardens/).", + "typology": "geography", + "wikidata": "Q6975250", + "wikipedia": "Register_of_Historic_Parks_and_Gardens_of_Special_Historic_Interest_in_England", + "entities": "", + "themes": ["environment", "heritage"], + "entity-count": { + "dataset": "park-and-garden", + "count": 1715 + }, + "paint-options": { + "colour": "#0EB951" + }, + "attribution": "historic-england", + "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "", + "github-discussion": "", + "entity-minimum": 11100000, + "entity-maximum": 11199999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "tpo": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "tree-preservation-order", + "dataset": "tree-preservation-zone", + "description": "An area covered by a tree preservation order", + "name": "Tree preservation zone", + "plural": "Trees preservation zones", + "prefix": "", + "text": "A Tree Preservation Order (TPO) can be placed on single trees, groups of trees and even whole woodlands. Tree Preservation Orders are made by local planning authorities following [guidance](https://www.gov.uk/guidance/tree-preservation-orders-and-trees-in-conservation-areas) provided by the [Ministry of Housing, Communities and Local Governments](https://www.gov.uk/government/organisations/ministry-of-housing-communities-local-government).\n\nEach [tree preservation order](/dataset/tree-preservation-order) may apply to a number of tree preservation order zones, and a number of individual [trees](/dataset/tree).\n\nThis dataset contains data from [a small group of local planning authorities](/about/) who we are working with to develop a [data specification for tree preservation orders](https://www.digital-land.info/guidance/specifications/tree-preservation-order).", + "typology": "geography", + "wikidata": "Q10884", + "wikipedia": "Tree", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "tree-preservation-zone", + "count": 13062 + }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "tree-preservation-orders", + "github-discussion": 43, + "entity-minimum": 19100000, + "entity-maximum": 29099999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "2.0" + } +} diff --git a/editor.planx.uk/src/@planx/components/PlanningConstraints/Modal.tsx b/editor.planx.uk/src/@planx/components/PlanningConstraints/Modal.tsx index dabc39d5ec..412e2cae07 100644 --- a/editor.planx.uk/src/@planx/components/PlanningConstraints/Modal.tsx +++ b/editor.planx.uk/src/@planx/components/PlanningConstraints/Modal.tsx @@ -194,7 +194,7 @@ export const OverrideEntitiesModal = ({ entities?.map((e) => ( Date: Fri, 20 Dec 2024 12:49:08 +0000 Subject: [PATCH 12/12] refine prop constraints response --- .../ui-driven/src/mocks/geospatialMocks.ts | 144 ---- e2e/tests/ui-driven/src/mocks/gisResponse.ts | 5 +- .../src/mocks/propertyConstraintMetadata.json | 606 ---------------- .../src/mocks/propertyConstraintResponse.json | 670 ++++++++++++++++++ 4 files changed, 673 insertions(+), 752 deletions(-) delete mode 100644 e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json create mode 100644 e2e/tests/ui-driven/src/mocks/propertyConstraintResponse.json diff --git a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts index 5568658cf3..5354e94101 100644 --- a/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts +++ b/e2e/tests/ui-driven/src/mocks/geospatialMocks.ts @@ -1,6 +1,5 @@ import { OptionWithDataValues } from "../helpers/types"; import { Feature, Polygon } from "geojson"; -import propertyConstraintsMetadata from "./propertyConstraintMetadata.json"; type ChangeHandlerProperties = { label: string; @@ -66,149 +65,6 @@ export const mockChangedMapGeoJson: GeoJsonChangeHandler = { }, }; -export const mockPropertyConstraints = { - sourceRequest: - "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", - constraints: { - listed: { - fn: "listed", - value: true, - text: "is, or is within, a Listed Building", - data: [ - { - "entry-date": "2024-04-16", - "start-date": "1980-05-15", - "end-date": "", - entity: 42103309, - name: "No Address Supplied", - dataset: "listed-building-outline", - typology: "geography", - reference: "12/435 and 963/1", - prefix: "listed-building-outline", - "organisation-entity": "192", - }, - ], - category: "Heritage and conservation", - }, - article4: { - fn: "article4", - value: false, - text: "is not in an Article 4 direction area", - category: "General policy", - }, - "article4.caz": { - fn: "article4.caz", - value: false, - text: "is not in the Central Activities Zone", - category: "General policy", - }, - brownfieldSite: { - fn: "brownfieldSite", - value: false, - text: "is not on Brownfield land", - category: "General policy", - }, - "designated.AONB": { - fn: "designated.AONB", - value: false, - text: "is not in an Area of Outstanding Natural Beauty", - category: "Heritage and conservation", - }, - greenBelt: { - fn: "greenBelt", - value: false, - text: "is not in a Green Belt", - category: "General policy", - }, - "designated.nationalPark": { - fn: "designated.nationalPark", - value: false, - text: "is not in a National Park", - category: "Heritage and conservation", - }, - "designated.nationalPark.broads": { - fn: "designated.nationalPark.broads", - value: false, - }, - "designated.WHS": { - fn: "designated.WHS", - value: false, - text: "is not an UNESCO World Heritage Site", - category: "Heritage and conservation", - }, - flood: { - fn: "flood", - value: false, - text: "is not in a Flood Risk Zone", - category: "Flooding", - }, - monument: { - fn: "monument", - value: false, - text: "is not the site of a Scheduled Monument", - category: "Heritage and conservation", - }, - "nature.ASNW": { - fn: "nature.ASNW", - value: false, - text: "is not in an Ancient Semi-Natural Woodland (ASNW)", - category: "Ecology", - }, - "nature.ramsarSite": { - fn: "nature.ramsarSite", - value: false, - text: "is not in a Ramsar Site", - category: "Ecology", - }, - "nature.SAC": { - fn: "nature.SAC", - value: false, - text: "is not in a Special Area of Conservation (SAC)", - category: "Ecology", - }, - "nature.SPA": { - fn: "nature.SPA", - value: false, - text: "is not in a Special Protection Area (SPA)", - category: "Ecology", - }, - "nature.SSSI": { - fn: "nature.SSSI", - value: false, - text: "is not a Site of Special Scientific Interest (SSSI)", - category: "Ecology", - }, - registeredPark: { - fn: "registeredPark", - value: false, - text: "is not in a Historic Park or Garden", - category: "Heritage and conservation", - }, - tpo: { - fn: "tpo", - value: false, - text: "is not in a Tree Preservation Order (TPO) Zone", - category: "Trees", - }, - designated: { - value: true, - }, - "listed.grade.I": { - fn: "listed.grade.I", - value: false, - }, - "listed.grade.II": { - fn: "listed.grade.II", - value: false, - }, - "listed.grade.II*": { - fn: "listed.grade.II*", - value: false, - }, - }, - metadata: propertyConstraintsMetadata, -}; - export const mockRoadData = { sourceRequest: "https://api.os.uk/features/v1/wfs?service=WFS&request=GetFeature&version=2.0.0&typeNames=Highways_RoadLink&outputFormat=GEOJSON&srsName=urn%3Aogc%3Adef%3Acrs%3AEPSG%3A%3A4326&count=1&filter=%0A++++%3Cogc%3AFilter%3E%0A++++++%3Cogc%3APropertyIsLike+wildCard%3D%22%25%22+singleChar%3D%22%23%22+escapeChar%3D%22%21%22%3E%0A++++++++%3Cogc%3APropertyName%3EFormsPartOf%3C%2Fogc%3APropertyName%3E%0A++++++++%3Cogc%3ALiteral%3E%25Street%23usrn21900651%25%3C%2Fogc%3ALiteral%3E%0A++++++%3C%2Fogc%3APropertyIsLike%3E%0A++++%3C%2Fogc%3AFilter%3E%0A++&", diff --git a/e2e/tests/ui-driven/src/mocks/gisResponse.ts b/e2e/tests/ui-driven/src/mocks/gisResponse.ts index fbaf45ca96..2fe8215041 100644 --- a/e2e/tests/ui-driven/src/mocks/gisResponse.ts +++ b/e2e/tests/ui-driven/src/mocks/gisResponse.ts @@ -1,5 +1,6 @@ import { expect, Page } from "@playwright/test"; -import { mockPropertyConstraints, mockRoadData } from "./geospatialMocks"; +import { mockRoadData } from "./geospatialMocks"; +import propertyConstraintsResponse from "./propertyConstraintResponse.json"; export async function setupGISMockResponse(page: Page) { const gisDigitalLandEndpoint = "**/gis/E2E?geom*"; @@ -8,7 +9,7 @@ export async function setupGISMockResponse(page: Page) { expect(urlContainsConstraints).toEqual(true); await route.fulfill({ status: 200, - body: JSON.stringify(mockPropertyConstraints), + body: JSON.stringify(propertyConstraintsResponse), }); }); } diff --git a/e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json b/e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json deleted file mode 100644 index 4025dcfe43..0000000000 --- a/e2e/tests/ui-driven/src/mocks/propertyConstraintMetadata.json +++ /dev/null @@ -1,606 +0,0 @@ -{ - "article4": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "article-4-direction", - "dataset": "article-4-direction-area", - "description": "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", - "name": "Article 4 direction area", - "plural": "Article 4 direction areas", - "prefix": "", - "text": "A local planning authority may create an [article 4 direction](https://www.gov.uk/guidance/when-is-permission-required#article-4-direction) to alter or remove [permitted development rights](https://www.gov.uk/government/publications/permitted-development-rights-for-householders-technical-guidance) from a building or area.\n\nEach [article 4 direction](/dataset/article-4-direction) may apply to one or more article 4 direction areas.", - "typology": "geography", - "wikidata": "", - "wikipedia": "", - "entities": "", - "themes": ["heritage"], - "entity-count": { - "dataset": "article-4-direction-area", - "count": 2438 - }, - "paint-options": "", - "attribution": "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "article-4-directions", - "github-discussion": 30, - "entity-minimum": 7010000000, - "entity-maximum": 7019999999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "3.0" - }, - "article4.caz": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "central-activities-zone", - "dataset": "central-activities-zone", - "description": "", - "name": "Central activities zone", - "plural": "Central activities zones", - "prefix": "", - "text": "The [Greater London Authority](https://www.london.gov.uk/) (GLA) designates a central area of London with [implications for planning](https://www.london.gov.uk/what-we-do/planning/implementing-london-plan/london-plan-guidance-and-spgs/central-activities-zone)\nThis dataset combines data provided by the GLA with the boundary from the individual London boroughs.", - "typology": "geography", - "wikidata": "", - "wikipedia": "", - "entities": "", - "themes": ["development"], - "entity-count": { - "dataset": "central-activities-zone", - "count": 10 - }, - "paint-options": "", - "attribution": "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "central-activty-zones", - "github-discussion": "", - "entity-minimum": 2200000, - "entity-maximum": 2299999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "brownfieldSite": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "brownfield-site", - "dataset": "brownfield-site", - "description": "", - "name": "Brownfield site", - "plural": "Brownfield sites", - "prefix": "", - "text": "This is an experimental dataset of the boundaries of brownfield sites found on [data.gov.uk](https://www.data.gov.uk/search?q=brownfield)\nand local planning authority web sites.\nWe expect to combine this dataset with the [brownfield land](/dataset/brownfield-land) dataset in the near future.", - "typology": "geography", - "wikidata": "Q896586", - "wikipedia": "Brownfield_land", - "entities": "", - "themes": ["development"], - "entity-count": { - "dataset": "brownfield-site", - "count": 339 - }, - "paint-options": { - "colour": "#745729" - }, - "attribution": "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "brownfield-land", - "github-discussion": 28, - "entity-minimum": 1800000, - "entity-maximum": 1899999, - "phase": "alpha", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "designated.AONB": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "area-of-outstanding-natural-beauty", - "dataset": "area-of-outstanding-natural-beauty", - "description": "Land protected by law to conserve and enhance its natural beauty", - "name": "Area of outstanding natural beauty", - "plural": "Areas of outstanding natural beauty", - "prefix": "", - "text": "An area of outstanding natural beauty (AONB) as designated by [Natural England](https://www.gov.uk/government/organisations/natural-england).\n\nNatural England provides [guidance](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications) to help local authorities decide on planning applications in protected sites and areas.", - "typology": "geography", - "wikidata": "Q174945", - "wikipedia": "Area_of_Outstanding_Natural_Beauty", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "area-of-outstanding-natural-beauty", - "count": 34 - }, - "paint-options": { - "colour": "#d53880" - }, - "attribution": "natural-england", - "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "areas-of-outstanding-natural-beauty", - "github-discussion": 31, - "entity-minimum": 1000000, - "entity-maximum": 1099999, - "phase": "live", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "greenBelt": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "green-belt", - "dataset": "green-belt", - "description": "", - "name": "Green belt", - "plural": "Green belt", - "prefix": "", - "text": "Boundaries for land designated by a local planning authority as being [green belt](https://www.gov.uk/guidance/green-belt),\ngrouped using the [greenbelt core](/dataset/greenbelt-core) category.\nThis data is compiled by the Department for Levelling Up, Housing and Communities for the purposes of gathering [green belt statistics](https://www.gov.uk/government/collections/green-belt-statistics).", - "typology": "geography", - "wikidata": "Q2734873", - "wikipedia": "Green_belt_(United_Kingdom)", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "green-belt", - "count": 185 - }, - "paint-options": { - "colour": "#85994b" - }, - "attribution": "os-open-data", - "attribution-text": "Your use of OS OpenData is subject to the terms at http://os.uk/opendata/licence\nContains Ordnance Survey data © Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "greenbelt", - "github-discussion": 45, - "entity-minimum": 610000, - "entity-maximum": 610999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "designated.nationalPark": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "national-park", - "dataset": "national-park", - "description": "", - "name": "National park", - "plural": "National parks", - "prefix": "statistical-geography", - "text": "The administrative boundaries of [national park authorities](/dataset/national-park-authority) in England as provided by the ONS for the purposes of producing statistics.", - "typology": "geography", - "wikidata": "Q60256727", - "wikipedia": "National_park", - "entities": "", - "themes": ["heritage"], - "entity-count": { - "dataset": "national-park", - "count": 10 - }, - "paint-options": { - "colour": "#3DA52C" - }, - "attribution": "ons-boundary", - "attribution-text": "Source: Office for National Statistics licensed under the Open Government Licence v.3.0\nContains OS data © Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "national-parks-and-the-broads", - "github-discussion": "", - "entity-minimum": 520000, - "entity-maximum": 520999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "designated.WHS": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "historic-england", - "dataset": "world-heritage-site-buffer-zone", - "description": "", - "name": "World heritage site buffer zone", - "plural": "World heritage site buffer zones", - "prefix": "", - "text": "A [World Heritage Site](/dataset/world-heritage-site) may have a [buffer zone](https://whc.unesco.org/en/series/25/) with implications for planning.", - "typology": "geography", - "wikidata": "Q9259", - "wikipedia": "World_Heritage_Site", - "entities": "", - "themes": ["heritage"], - "entity-count": { - "dataset": "world-heritage-site-buffer-zone", - "count": 9 - }, - "paint-options": { - "colour": "#EB1EE5", - "opacity": 0.2 - }, - "attribution": "historic-england", - "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "world-heritage-sites", - "github-discussion": "", - "entity-minimum": 16110000, - "entity-maximum": 16129999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "flood": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "flood-risk-zone", - "dataset": "flood-risk-zone", - "description": "Area identified as being at risk of flooding from rivers or the sea", - "name": "Flood risk zone", - "plural": "Flood risk zones", - "prefix": "", - "text": "Flood zones are a guide produced by the Environment Agency to demonstrate the probability of river and sea flooding in areas across England. Flood zones are based on the likelihood of an area flooding, with flood zone 1 areas least likely to flood and flood zone 3 areas more likely to flood. \n\nThe flood zones were produced to help developers, councils and communities understand the flood risks present in specific locations or regions. Despite being a very useful indicator of an area’s flood risk, the zones cannot tell you whether a location will definitely flood or to what severity.", - "typology": "geography", - "wikidata": "", - "wikipedia": "", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "flood-risk-zone", - "count": 550621 - }, - "paint-options": "", - "attribution": "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "flood-risk-zones", - "github-discussion": 46, - "entity-minimum": 65000000, - "entity-maximum": 65999999, - "phase": "live", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "listed": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "listed-building", - "dataset": "listed-building-outline", - "description": "boundary of a listed building", - "name": "Listed building outline", - "plural": "Listed building outlines", - "prefix": "", - "text": "The geospatial boundary for [listed buildings](https://historicengland.org.uk/listing/what-is-designation/listed-buildings) as designated by [Historic England](https://historicengland.org.uk/) as collected from local planning authorities.\n\nWe are [working with a group of local planning authorities](/about/) to help them publish their data to inform planning decisions, and to develop a [data specification for listed building outlines](https://www.digital-land.info/guidance/specifications/listed-building).\n\nWe expect to eventually merge this dataset with the [listed building](/dataset/listed-building) dataset.", - "typology": "geography", - "wikidata": "Q570600", - "wikipedia": "Listed_building", - "entities": "", - "themes": ["heritage"], - "entity-count": { - "dataset": "listed-building-outline", - "count": 34225 - }, - "paint-options": { - "colour": "#F9C744" - }, - "attribution": "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "listed-buildings", - "github-discussion": 44, - "entity-minimum": 42100000, - "entity-maximum": 43099999, - "phase": "alpha", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "monument": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "historic-england", - "dataset": "scheduled-monument", - "description": "", - "name": "Scheduled monument", - "plural": "Scheduled monuments", - "prefix": "", - "text": "Historic buildings or sites such as Roman remains, burial mounds, castles, bridges, earthworks, the remains of deserted villages and industrial sites can be designated scheduled monuments by the Secretary of State for [Digital, Culture, Media and Sport](https://www.gov.uk/government/organisations/department-for-digital-culture-media-sport). \n\nThis list of scheduled monuments is kept and maintained by [Historic England](https://historicengland.org.uk/).", - "typology": "geography", - "wikidata": "Q219538", - "wikipedia": "Scheduled_monument", - "entities": "", - "themes": ["heritage"], - "entity-count": { - "dataset": "scheduled-monument", - "count": 19987 - }, - "paint-options": { - "colour": "#0F9CDA" - }, - "attribution": "historic-england", - "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "scheduled-monuments", - "github-discussion": "", - "entity-minimum": 13900000, - "entity-maximum": 13999999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "nature.ASNW": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "ancient-woodland", - "dataset": "ancient-woodland", - "description": "An area that’s been wooded continuously since at least 1600 AD", - "name": "Ancient woodland", - "plural": "Ancient woodlands", - "prefix": "", - "text": "An area designated as ancient woodland by Natural England.\n\nNatural England and Forestry Commission [Guidance](https://www.gov.uk/guidance/ancient-woodland-and-veteran-trees-protection-surveys-licences) is used in planning decisions.", - "typology": "geography", - "wikidata": "Q3078732", - "wikipedia": "Ancient_woodland", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "ancient-woodland", - "count": 44261 - }, - "paint-options": { - "colour": "#00703c", - "opacity": 0.2 - }, - "attribution": "natural-england", - "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "ancient-woodlands", - "github-discussion": 32, - "entity-minimum": 110000000, - "entity-maximum": 129999999, - "phase": "live", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "nature.ramsarSite": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "ramsar", - "dataset": "ramsar", - "description": "", - "name": "Ramsar site", - "plural": "Ramsar sites", - "prefix": "", - "text": "An internationally protected site listed as a wetland of international importance.\nRamsar sites are designated by [UNESCO](https://en.unesco.org/) and managed by [Natural England](https://www.gov.uk/government/organisations/natural-england).\n\nNatural England provides [guidance ](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications) to help local authorities decide on planning applications in protected sites and areas.", - "typology": "geography", - "wikidata": "", - "wikipedia": "", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "ramsar", - "count": 73 - }, - "paint-options": { - "colour": "#7fcdff" - }, - "attribution": "natural-england", - "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "ramsar", - "github-discussion": 41, - "entity-minimum": 612000, - "entity-maximum": 619999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "nature.SAC": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "special-area-of-conservation", - "dataset": "special-area-of-conservation", - "description": "", - "name": "Special area of conservation", - "plural": "Special areas of conservation", - "prefix": "", - "text": "Special areas of conservation (SACs) are area of land which have been designated by\n[DEFRA](https://www.gov.uk/government/organisations/department-for-environment-food-rural-affairs),\nwith advice from the [Joint Nature Conservation Committee](https://jncc.gov.uk/),\nto protect specific habitats and species.\n\nDEFRA and [Natural England](https://www.gov.uk/government/organisations/natural-england) publish\n[guidance](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications)\non how to review planning applications in protected sites and areas.", - "typology": "geography", - "wikidata": "Q1191622", - "wikipedia": "Special_Area_of_Conservation", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "special-area-of-conservation", - "count": 260 - }, - "paint-options": { - "colour": "#7A8705" - }, - "attribution": "natural-england", - "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "special-areas-of-conservation", - "github-discussion": "", - "entity-minimum": 14800000, - "entity-maximum": 14899999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "nature.SPA": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "special-protection-area", - "dataset": "special-protection-area", - "description": "", - "name": "Special protection area", - "plural": "Special protection areas", - "prefix": "", - "text": "[Special protection areas](https://naturalengland-defra.opendata.arcgis.com/maps/Defra::special-protection-areas-england/about) is an area designated \nfor the protection of birds and wildlife. This dataset is provided by [Natural England](https://www.gov.uk/government/organisations/natural-england).", - "typology": "geography", - "wikidata": "", - "wikipedia": "", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "special-protection-area", - "count": 88 - }, - "paint-options": "", - "attribution": "natural-england", - "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "special-protection-areas", - "github-discussion": "", - "entity-minimum": 14900000, - "entity-maximum": 14999999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "nature.SSSI": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "site-of-special-scientific-interest", - "dataset": "site-of-special-scientific-interest", - "description": "", - "name": "Site of special scientific interest", - "plural": "Sites of special scientific interest", - "prefix": "", - "text": "Sites of special scientific interest (SSSI) are nationally protected sites that have features such as wildlife or geology. \n\nSSSIs are designated by [Natural England](https://www.gov.uk/government/organisations/natural-england).\nThere is [guidance](https://www.gov.uk/guidance/protected-areas-sites-of-special-scientific-interest) to help local authorities decide on planning applications in protected SSSIs.", - "typology": "geography", - "wikidata": "Q422211", - "wikipedia": "Site_of_Special_Scientific_Interest", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "site-of-special-scientific-interest", - "count": 4128 - }, - "paint-options": { - "colour": "#308fac" - }, - "attribution": "natural-england", - "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "sites-of-special-scientific-interest", - "github-discussion": "", - "entity-minimum": 14500000, - "entity-maximum": 14599999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "registeredPark": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "historic-england", - "dataset": "park-and-garden", - "description": "", - "name": "Historic parks and gardens", - "plural": "Parks and gardens", - "prefix": "", - "text": "Historic parks and gardens as listed by [Historic England](https://historicengland.org.uk/) in the [Register of Parks and Gardens of Special Historic Interest](https://historicengland.org.uk/listing/what-is-designation/registered-parks-and-gardens/).", - "typology": "geography", - "wikidata": "Q6975250", - "wikipedia": "Register_of_Historic_Parks_and_Gardens_of_Special_Historic_Interest_in_England", - "entities": "", - "themes": ["environment", "heritage"], - "entity-count": { - "dataset": "park-and-garden", - "count": 1715 - }, - "paint-options": { - "colour": "#0EB951" - }, - "attribution": "historic-england", - "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "", - "github-discussion": "", - "entity-minimum": 11100000, - "entity-maximum": 11199999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "1.0" - }, - "tpo": { - "entry-date": "", - "start-date": "", - "end-date": "", - "collection": "tree-preservation-order", - "dataset": "tree-preservation-zone", - "description": "An area covered by a tree preservation order", - "name": "Tree preservation zone", - "plural": "Trees preservation zones", - "prefix": "", - "text": "A Tree Preservation Order (TPO) can be placed on single trees, groups of trees and even whole woodlands. Tree Preservation Orders are made by local planning authorities following [guidance](https://www.gov.uk/guidance/tree-preservation-orders-and-trees-in-conservation-areas) provided by the [Ministry of Housing, Communities and Local Governments](https://www.gov.uk/government/organisations/ministry-of-housing-communities-local-government).\n\nEach [tree preservation order](/dataset/tree-preservation-order) may apply to a number of tree preservation order zones, and a number of individual [trees](/dataset/tree).\n\nThis dataset contains data from [a small group of local planning authorities](/about/) who we are working with to develop a [data specification for tree preservation orders](https://www.digital-land.info/guidance/specifications/tree-preservation-order).", - "typology": "geography", - "wikidata": "Q10884", - "wikipedia": "Tree", - "entities": "", - "themes": ["environment"], - "entity-count": { - "dataset": "tree-preservation-zone", - "count": 13062 - }, - "paint-options": "", - "attribution": "crown-copyright", - "attribution-text": "© Crown copyright and database right 2024", - "licence": "ogl3", - "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", - "consideration": "tree-preservation-orders", - "github-discussion": 43, - "entity-minimum": 19100000, - "entity-maximum": 29099999, - "phase": "beta", - "realm": "dataset", - "replacement-dataset": "", - "version": "2.0" - } -} diff --git a/e2e/tests/ui-driven/src/mocks/propertyConstraintResponse.json b/e2e/tests/ui-driven/src/mocks/propertyConstraintResponse.json new file mode 100644 index 0000000000..cf7407b337 --- /dev/null +++ b/e2e/tests/ui-driven/src/mocks/propertyConstraintResponse.json @@ -0,0 +1,670 @@ +{ + "sourceRequest": "https://www.planning.data.gov.uk/entity.json?entries=current&geometry=POINT%28-0.1151501+51.4745098%29&geometry_relation=intersects&exclude_field=geometry%2Cpoint&limit=100&dataset=article-4-direction-area&dataset=central-activities-zone&dataset=brownfield-land&dataset=brownfield-site&dataset=area-of-outstanding-natural-beauty&dataset=green-belt&dataset=national-park&dataset=world-heritage-site&dataset=world-heritage-site-buffer-zone&dataset=flood-risk-zone&dataset=listed-building&dataset=listed-building-outline&dataset=scheduled-monument&dataset=ancient-woodland&dataset=ramsar&dataset=special-area-of-conservation&dataset=special-protection-area&dataset=site-of-special-scientific-interest&dataset=park-and-garden&dataset=tree&dataset=tree-preservation-order&dataset=tree-preservation-zone", + "constraints": { + "listed": { + "fn": "listed", + "value": true, + "text": "is, or is within, a Listed Building", + "data": [ + { + "entry-date": "2024-04-16", + "start-date": "1980-05-15", + "end-date": "", + "entity": 42103309, + "name": "No Address Supplied", + "dataset": "listed-building-outline", + "typology": "geography", + "reference": "12/435 and 963/1", + "prefix": "listed-building-outline", + "organisation-entity": "192" + } + ], + "category": "Heritage and conservation" + }, + "article4": { + "fn": "article4", + "value": false, + "text": "is not in an Article 4 direction area", + "category": "General policy" + }, + "article4.caz": { + "fn": "article4.caz", + "value": false, + "text": "is not in the Central Activities Zone", + "category": "General policy" + }, + "brownfieldSite": { + "fn": "brownfieldSite", + "value": false, + "text": "is not on Brownfield land", + "category": "General policy" + }, + "designated.AONB": { + "fn": "designated.AONB", + "value": false, + "text": "is not in an Area of Outstanding Natural Beauty", + "category": "Heritage and conservation" + }, + "greenBelt": { + "fn": "greenBelt", + "value": false, + "text": "is not in a Green Belt", + "category": "General policy" + }, + "designated.nationalPark": { + "fn": "designated.nationalPark", + "value": false, + "text": "is not in a National Park", + "category": "Heritage and conservation" + }, + "designated.nationalPark.broads": { + "fn": "designated.nationalPark.broads", + "value": false + }, + "designated.WHS": { + "fn": "designated.WHS", + "value": false, + "text": "is not an UNESCO World Heritage Site", + "category": "Heritage and conservation" + }, + "flood": { + "fn": "flood", + "value": false, + "text": "is not in a Flood Risk Zone", + "category": "Flooding" + }, + "monument": { + "fn": "monument", + "value": false, + "text": "is not the site of a Scheduled Monument", + "category": "Heritage and conservation" + }, + "nature.ASNW": { + "fn": "nature.ASNW", + "value": false, + "text": "is not in an Ancient Semi-Natural Woodland (ASNW)", + "category": "Ecology" + }, + "nature.ramsarSite": { + "fn": "nature.ramsarSite", + "value": false, + "text": "is not in a Ramsar Site", + "category": "Ecology" + }, + "nature.SAC": { + "fn": "nature.SAC", + "value": false, + "text": "is not in a Special Area of Conservation (SAC)", + "category": "Ecology" + }, + "nature.SPA": { + "fn": "nature.SPA", + "value": false, + "text": "is not in a Special Protection Area (SPA)", + "category": "Ecology" + }, + "nature.SSSI": { + "fn": "nature.SSSI", + "value": false, + "text": "is not a Site of Special Scientific Interest (SSSI)", + "category": "Ecology" + }, + "registeredPark": { + "fn": "registeredPark", + "value": false, + "text": "is not in a Historic Park or Garden", + "category": "Heritage and conservation" + }, + "tpo": { + "fn": "tpo", + "value": false, + "text": "is not in a Tree Preservation Order (TPO) Zone", + "category": "Trees" + }, + "designated": { "value": true }, + "listed.grade.I": { "fn": "listed.grade.I", "value": false }, + "listed.grade.II": { "fn": "listed.grade.II", "value": false }, + "listed.grade.II*": { "fn": "listed.grade.II*", "value": false } + }, + "metadata": { + "article4": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "article-4-direction", + "dataset": "article-4-direction-area", + "description": "Orders made by the local planning authority to remove all or some of the permitted development rights on a site in order to protect it", + "name": "Article 4 direction area", + "plural": "Article 4 direction areas", + "prefix": "", + "text": "A local planning authority may create an [article 4 direction](https://www.gov.uk/guidance/when-is-permission-required#article-4-direction) to alter or remove [permitted development rights](https://www.gov.uk/government/publications/permitted-development-rights-for-householders-technical-guidance) from a building or area.\n\nEach [article 4 direction](/dataset/article-4-direction) may apply to one or more article 4 direction areas.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["heritage"], + "entity-count": { "dataset": "article-4-direction-area", "count": 2438 }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "article-4-directions", + "github-discussion": 30, + "entity-minimum": 7010000000, + "entity-maximum": 7019999999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "3.0" + }, + "article4.caz": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "central-activities-zone", + "dataset": "central-activities-zone", + "description": "", + "name": "Central activities zone", + "plural": "Central activities zones", + "prefix": "", + "text": "The [Greater London Authority](https://www.london.gov.uk/) (GLA) designates a central area of London with [implications for planning](https://www.london.gov.uk/what-we-do/planning/implementing-london-plan/london-plan-guidance-and-spgs/central-activities-zone)\nThis dataset combines data provided by the GLA with the boundary from the individual London boroughs.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["development"], + "entity-count": { "dataset": "central-activities-zone", "count": 10 }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "central-activty-zones", + "github-discussion": "", + "entity-minimum": 2200000, + "entity-maximum": 2299999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "brownfieldSite": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "brownfield-site", + "dataset": "brownfield-site", + "description": "", + "name": "Brownfield site", + "plural": "Brownfield sites", + "prefix": "", + "text": "This is an experimental dataset of the boundaries of brownfield sites found on [data.gov.uk](https://www.data.gov.uk/search?q=brownfield)\nand local planning authority web sites.\nWe expect to combine this dataset with the [brownfield land](/dataset/brownfield-land) dataset in the near future.", + "typology": "geography", + "wikidata": "Q896586", + "wikipedia": "Brownfield_land", + "entities": "", + "themes": ["development"], + "entity-count": { "dataset": "brownfield-site", "count": 339 }, + "paint-options": { "colour": "#745729" }, + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "brownfield-land", + "github-discussion": 28, + "entity-minimum": 1800000, + "entity-maximum": 1899999, + "phase": "alpha", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "designated.AONB": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "area-of-outstanding-natural-beauty", + "dataset": "area-of-outstanding-natural-beauty", + "description": "Land protected by law to conserve and enhance its natural beauty", + "name": "Area of outstanding natural beauty", + "plural": "Areas of outstanding natural beauty", + "prefix": "", + "text": "An area of outstanding natural beauty (AONB) as designated by [Natural England](https://www.gov.uk/government/organisations/natural-england).\n\nNatural England provides [guidance](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications) to help local authorities decide on planning applications in protected sites and areas.", + "typology": "geography", + "wikidata": "Q174945", + "wikipedia": "Area_of_Outstanding_Natural_Beauty", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "area-of-outstanding-natural-beauty", + "count": 34 + }, + "paint-options": { "colour": "#d53880" }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "areas-of-outstanding-natural-beauty", + "github-discussion": 31, + "entity-minimum": 1000000, + "entity-maximum": 1099999, + "phase": "live", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "greenBelt": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "green-belt", + "dataset": "green-belt", + "description": "", + "name": "Green belt", + "plural": "Green belt", + "prefix": "", + "text": "Boundaries for land designated by a local planning authority as being [green belt](https://www.gov.uk/guidance/green-belt),\ngrouped using the [greenbelt core](/dataset/greenbelt-core) category.\nThis data is compiled by the Department for Levelling Up, Housing and Communities for the purposes of gathering [green belt statistics](https://www.gov.uk/government/collections/green-belt-statistics).", + "typology": "geography", + "wikidata": "Q2734873", + "wikipedia": "Green_belt_(United_Kingdom)", + "entities": "", + "themes": ["environment"], + "entity-count": { "dataset": "green-belt", "count": 185 }, + "paint-options": { "colour": "#85994b" }, + "attribution": "os-open-data", + "attribution-text": "Your use of OS OpenData is subject to the terms at http://os.uk/opendata/licence\nContains Ordnance Survey data © Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "greenbelt", + "github-discussion": 45, + "entity-minimum": 610000, + "entity-maximum": 610999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "designated.nationalPark": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "national-park", + "dataset": "national-park", + "description": "", + "name": "National park", + "plural": "National parks", + "prefix": "statistical-geography", + "text": "The administrative boundaries of [national park authorities](/dataset/national-park-authority) in England as provided by the ONS for the purposes of producing statistics.", + "typology": "geography", + "wikidata": "Q60256727", + "wikipedia": "National_park", + "entities": "", + "themes": ["heritage"], + "entity-count": { "dataset": "national-park", "count": 10 }, + "paint-options": { "colour": "#3DA52C" }, + "attribution": "ons-boundary", + "attribution-text": "Source: Office for National Statistics licensed under the Open Government Licence v.3.0\nContains OS data © Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "national-parks-and-the-broads", + "github-discussion": "", + "entity-minimum": 520000, + "entity-maximum": 520999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "designated.WHS": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "historic-england", + "dataset": "world-heritage-site-buffer-zone", + "description": "", + "name": "World heritage site buffer zone", + "plural": "World heritage site buffer zones", + "prefix": "", + "text": "A [World Heritage Site](/dataset/world-heritage-site) may have a [buffer zone](https://whc.unesco.org/en/series/25/) with implications for planning.", + "typology": "geography", + "wikidata": "Q9259", + "wikipedia": "World_Heritage_Site", + "entities": "", + "themes": ["heritage"], + "entity-count": { + "dataset": "world-heritage-site-buffer-zone", + "count": 9 + }, + "paint-options": { "colour": "#EB1EE5", "opacity": 0.2 }, + "attribution": "historic-england", + "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "world-heritage-sites", + "github-discussion": "", + "entity-minimum": 16110000, + "entity-maximum": 16129999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "flood": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "flood-risk-zone", + "dataset": "flood-risk-zone", + "description": "Area identified as being at risk of flooding from rivers or the sea", + "name": "Flood risk zone", + "plural": "Flood risk zones", + "prefix": "", + "text": "Flood zones are a guide produced by the Environment Agency to demonstrate the probability of river and sea flooding in areas across England. Flood zones are based on the likelihood of an area flooding, with flood zone 1 areas least likely to flood and flood zone 3 areas more likely to flood. \n\nThe flood zones were produced to help developers, councils and communities understand the flood risks present in specific locations or regions. Despite being a very useful indicator of an area’s flood risk, the zones cannot tell you whether a location will definitely flood or to what severity.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["environment"], + "entity-count": { "dataset": "flood-risk-zone", "count": 550621 }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "flood-risk-zones", + "github-discussion": 46, + "entity-minimum": 65000000, + "entity-maximum": 65999999, + "phase": "live", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "listed": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "listed-building", + "dataset": "listed-building-outline", + "description": "boundary of a listed building", + "name": "Listed building outline", + "plural": "Listed building outlines", + "prefix": "", + "text": "The geospatial boundary for [listed buildings](https://historicengland.org.uk/listing/what-is-designation/listed-buildings) as designated by [Historic England](https://historicengland.org.uk/) as collected from local planning authorities.\n\nWe are [working with a group of local planning authorities](/about/) to help them publish their data to inform planning decisions, and to develop a [data specification for listed building outlines](https://www.digital-land.info/guidance/specifications/listed-building).\n\nWe expect to eventually merge this dataset with the [listed building](/dataset/listed-building) dataset.", + "typology": "geography", + "wikidata": "Q570600", + "wikipedia": "Listed_building", + "entities": "", + "themes": ["heritage"], + "entity-count": { "dataset": "listed-building-outline", "count": 34225 }, + "paint-options": { "colour": "#F9C744" }, + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "listed-buildings", + "github-discussion": 44, + "entity-minimum": 42100000, + "entity-maximum": 43099999, + "phase": "alpha", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "monument": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "historic-england", + "dataset": "scheduled-monument", + "description": "", + "name": "Scheduled monument", + "plural": "Scheduled monuments", + "prefix": "", + "text": "Historic buildings or sites such as Roman remains, burial mounds, castles, bridges, earthworks, the remains of deserted villages and industrial sites can be designated scheduled monuments by the Secretary of State for [Digital, Culture, Media and Sport](https://www.gov.uk/government/organisations/department-for-digital-culture-media-sport). \n\nThis list of scheduled monuments is kept and maintained by [Historic England](https://historicengland.org.uk/).", + "typology": "geography", + "wikidata": "Q219538", + "wikipedia": "Scheduled_monument", + "entities": "", + "themes": ["heritage"], + "entity-count": { "dataset": "scheduled-monument", "count": 19987 }, + "paint-options": { "colour": "#0F9CDA" }, + "attribution": "historic-england", + "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "scheduled-monuments", + "github-discussion": "", + "entity-minimum": 13900000, + "entity-maximum": 13999999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.ASNW": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "ancient-woodland", + "dataset": "ancient-woodland", + "description": "An area that’s been wooded continuously since at least 1600 AD", + "name": "Ancient woodland", + "plural": "Ancient woodlands", + "prefix": "", + "text": "An area designated as ancient woodland by Natural England.\n\nNatural England and Forestry Commission [Guidance](https://www.gov.uk/guidance/ancient-woodland-and-veteran-trees-protection-surveys-licences) is used in planning decisions.", + "typology": "geography", + "wikidata": "Q3078732", + "wikipedia": "Ancient_woodland", + "entities": "", + "themes": ["environment"], + "entity-count": { "dataset": "ancient-woodland", "count": 44261 }, + "paint-options": { "colour": "#00703c", "opacity": 0.2 }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "ancient-woodlands", + "github-discussion": 32, + "entity-minimum": 110000000, + "entity-maximum": 129999999, + "phase": "live", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.ramsarSite": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "ramsar", + "dataset": "ramsar", + "description": "", + "name": "Ramsar site", + "plural": "Ramsar sites", + "prefix": "", + "text": "An internationally protected site listed as a wetland of international importance.\nRamsar sites are designated by [UNESCO](https://en.unesco.org/) and managed by [Natural England](https://www.gov.uk/government/organisations/natural-england).\n\nNatural England provides [guidance ](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications) to help local authorities decide on planning applications in protected sites and areas.", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["environment"], + "entity-count": { "dataset": "ramsar", "count": 73 }, + "paint-options": { "colour": "#7fcdff" }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "ramsar", + "github-discussion": 41, + "entity-minimum": 612000, + "entity-maximum": 619999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.SAC": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "special-area-of-conservation", + "dataset": "special-area-of-conservation", + "description": "", + "name": "Special area of conservation", + "plural": "Special areas of conservation", + "prefix": "", + "text": "Special areas of conservation (SACs) are area of land which have been designated by\n[DEFRA](https://www.gov.uk/government/organisations/department-for-environment-food-rural-affairs),\nwith advice from the [Joint Nature Conservation Committee](https://jncc.gov.uk/),\nto protect specific habitats and species.\n\nDEFRA and [Natural England](https://www.gov.uk/government/organisations/natural-england) publish\n[guidance](https://www.gov.uk/guidance/protected-sites-and-areas-how-to-review-planning-applications)\non how to review planning applications in protected sites and areas.", + "typology": "geography", + "wikidata": "Q1191622", + "wikipedia": "Special_Area_of_Conservation", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "special-area-of-conservation", + "count": 260 + }, + "paint-options": { "colour": "#7A8705" }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "special-areas-of-conservation", + "github-discussion": "", + "entity-minimum": 14800000, + "entity-maximum": 14899999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.SPA": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "special-protection-area", + "dataset": "special-protection-area", + "description": "", + "name": "Special protection area", + "plural": "Special protection areas", + "prefix": "", + "text": "[Special protection areas](https://naturalengland-defra.opendata.arcgis.com/maps/Defra::special-protection-areas-england/about) is an area designated \nfor the protection of birds and wildlife. This dataset is provided by [Natural England](https://www.gov.uk/government/organisations/natural-england).", + "typology": "geography", + "wikidata": "", + "wikipedia": "", + "entities": "", + "themes": ["environment"], + "entity-count": { "dataset": "special-protection-area", "count": 88 }, + "paint-options": "", + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "special-protection-areas", + "github-discussion": "", + "entity-minimum": 14900000, + "entity-maximum": 14999999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "nature.SSSI": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "site-of-special-scientific-interest", + "dataset": "site-of-special-scientific-interest", + "description": "", + "name": "Site of special scientific interest", + "plural": "Sites of special scientific interest", + "prefix": "", + "text": "Sites of special scientific interest (SSSI) are nationally protected sites that have features such as wildlife or geology. \n\nSSSIs are designated by [Natural England](https://www.gov.uk/government/organisations/natural-england).\nThere is [guidance](https://www.gov.uk/guidance/protected-areas-sites-of-special-scientific-interest) to help local authorities decide on planning applications in protected SSSIs.", + "typology": "geography", + "wikidata": "Q422211", + "wikipedia": "Site_of_Special_Scientific_Interest", + "entities": "", + "themes": ["environment"], + "entity-count": { + "dataset": "site-of-special-scientific-interest", + "count": 4128 + }, + "paint-options": { "colour": "#308fac" }, + "attribution": "natural-england", + "attribution-text": "© Natural England copyright. Contains Ordnance Survey data © Crown copyright and database right 2024.", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "sites-of-special-scientific-interest", + "github-discussion": "", + "entity-minimum": 14500000, + "entity-maximum": 14599999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "registeredPark": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "historic-england", + "dataset": "park-and-garden", + "description": "", + "name": "Historic parks and gardens", + "plural": "Parks and gardens", + "prefix": "", + "text": "Historic parks and gardens as listed by [Historic England](https://historicengland.org.uk/) in the [Register of Parks and Gardens of Special Historic Interest](https://historicengland.org.uk/listing/what-is-designation/registered-parks-and-gardens/).", + "typology": "geography", + "wikidata": "Q6975250", + "wikipedia": "Register_of_Historic_Parks_and_Gardens_of_Special_Historic_Interest_in_England", + "entities": "", + "themes": ["environment", "heritage"], + "entity-count": { "dataset": "park-and-garden", "count": 1715 }, + "paint-options": { "colour": "#0EB951" }, + "attribution": "historic-england", + "attribution-text": "© Historic England 2024. Contains Ordnance Survey data © Crown copyright and database right 2024.\nThe Historic England GIS Data contained in this material was obtained on [date].\nThe most publicly available up to date Historic England GIS Data can be obtained from [HistoricEngland.org.uk](https://historicengland.org.uk).", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "", + "github-discussion": "", + "entity-minimum": 11100000, + "entity-maximum": 11199999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "1.0" + }, + "tpo": { + "entry-date": "", + "start-date": "", + "end-date": "", + "collection": "tree-preservation-order", + "dataset": "tree-preservation-zone", + "description": "An area covered by a tree preservation order", + "name": "Tree preservation zone", + "plural": "Trees preservation zones", + "prefix": "", + "text": "A Tree Preservation Order (TPO) can be placed on single trees, groups of trees and even whole woodlands. Tree Preservation Orders are made by local planning authorities following [guidance](https://www.gov.uk/guidance/tree-preservation-orders-and-trees-in-conservation-areas) provided by the [Ministry of Housing, Communities and Local Governments](https://www.gov.uk/government/organisations/ministry-of-housing-communities-local-government).\n\nEach [tree preservation order](/dataset/tree-preservation-order) may apply to a number of tree preservation order zones, and a number of individual [trees](/dataset/tree).\n\nThis dataset contains data from [a small group of local planning authorities](/about/) who we are working with to develop a [data specification for tree preservation orders](https://www.digital-land.info/guidance/specifications/tree-preservation-order).", + "typology": "geography", + "wikidata": "Q10884", + "wikipedia": "Tree", + "entities": "", + "themes": ["environment"], + "entity-count": { "dataset": "tree-preservation-zone", "count": 13062 }, + "paint-options": "", + "attribution": "crown-copyright", + "attribution-text": "© Crown copyright and database right 2024", + "licence": "ogl3", + "licence-text": "Licensed under the [Open Government Licence v.3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).", + "consideration": "tree-preservation-orders", + "github-discussion": 43, + "entity-minimum": 19100000, + "entity-maximum": 29099999, + "phase": "beta", + "realm": "dataset", + "replacement-dataset": "", + "version": "2.0" + } + } +}