From dfcc58e830e198efb0209ff383cdd5badc8fc96b Mon Sep 17 00:00:00 2001 From: Matt Poole Date: Fri, 17 Jul 2026 15:14:53 +0100 Subject: [PATCH 1/4] show endpoint count and how we process --- src/middleware/dataview.middleware.js | 9 ++++++++- src/routes/schemas.js | 1 + src/views/organisations/dataset-overview.html | 2 +- src/views/organisations/dataview.html | 12 ++++++++++++ test/unit/middleware/dataview.middleware.test.js | 1 + 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/middleware/dataview.middleware.js b/src/middleware/dataview.middleware.js index 71f424eda..2a520de50 100644 --- a/src/middleware/dataview.middleware.js +++ b/src/middleware/dataview.middleware.js @@ -8,6 +8,7 @@ import { fetchLocalPlanningGroups, fetchProvisionsByOrgsAndDatasets, fetchOrgInfo, + fetchSources, noop, processAuthoritativeMiddlewares, processSpecificationMiddlewares, @@ -92,7 +93,11 @@ const fetchOutOfBoundsExpectations = expectationFetcher({ }) export const prepareTemplateParams = (req, res, next) => { - const { orgInfo, dataset, tableParams, pagination, dataRange, tasks, authority, alternateSources, uniqueDatasetFields, provisions, expectationOutOfBounds } = req + const { orgInfo, dataset, tableParams, pagination, dataRange, tasks, authority, alternateSources, uniqueDatasetFields, provisions, expectationOutOfBounds, sources } = req + + // Match the overview page: 'some' authority uses alternative/pre-populated + // sources, not the LPA's own endpoints, so it reports no endpoints. + const endpointCount = authority === 'some' ? 0 : (sources?.length ?? 0) const outOfBoundsCount = (expectationOutOfBounds?.length ?? 0) > 0 ? 1 : 0 const taskCount = authority !== 'some' ? (tasks?.count ?? 0) + outOfBoundsCount : 1 @@ -112,6 +117,7 @@ export const prepareTemplateParams = (req, res, next) => { authority, dataset, taskCount, + endpointCount, tableParams, pagination, dataRange, @@ -138,6 +144,7 @@ export default [ fetchDatasetInfo, fetchResources, + fetchSources, fetchTasksFromPlatformApi, isFeatureEnabled('expectationOutOfBoundsTask') ? fetchOutOfBoundsExpectations : noop, diff --git a/src/routes/schemas.js b/src/routes/schemas.js index e263badcf..2eb625150 100644 --- a/src/routes/schemas.js +++ b/src/routes/schemas.js @@ -213,6 +213,7 @@ export const OrgDataView = v.strictObject({ organisation: OrgField, dataset: DatasetNameField, taskCount: v.integer(), + endpointCount: v.integer(), authority: v.string(), tableParams, pagination: PaginationParams, diff --git a/src/views/organisations/dataset-overview.html b/src/views/organisations/dataset-overview.html index 28f5335d0..4caf081cc 100644 --- a/src/views/organisations/dataset-overview.html +++ b/src/views/organisations/dataset-overview.html @@ -213,7 +213,7 @@

Dataset details

{% if authority !== 'some' %}

Active endpoints

-

You have {{ endpointCount }} endpoint{% if endpointCount != 1 %}s{% endif %} we are currently checking for data.

+

You have {{ endpointCount }} endpoint{% if endpointCount != 1 %}s{% endif %} we are currently checking for data.{% if endpointCount > 1 %} The information within dataset details includes data from all {{ endpointCount }} endpoints.{% endif %}

{% for endpointSummaryCard in endpointSummaryCards %} {{ govukSummaryList(endpointSummaryCard) }} {% endfor %} diff --git a/src/views/organisations/dataview.html b/src/views/organisations/dataview.html index a1d82125b..5ef5efb36 100644 --- a/src/views/organisations/dataview.html +++ b/src/views/organisations/dataview.html @@ -59,6 +59,18 @@ +
+
+
+

About this data

+

We accept data in different formats and standardise it, so that we can combine it with data from other sources. This means the data we show might be in a different format to the data you provided. For example, we standardise all dates as YYYY-MM-DD.

+ {% if endpointCount > 1 %} +

The information within this data is from all {{ endpointCount }} of your endpoints.

+ {% endif %} +
+
+
+
{{ table(tableParams) }} diff --git a/test/unit/middleware/dataview.middleware.test.js b/test/unit/middleware/dataview.middleware.test.js index 1bd515852..77ad1b948 100644 --- a/test/unit/middleware/dataview.middleware.test.js +++ b/test/unit/middleware/dataview.middleware.test.js @@ -206,6 +206,7 @@ describe('dataview.middleware.test.js', () => { dataset: { name: 'Mock Dataset', dataset: 'mock-dataset' }, authority: 'mock-authority', taskCount: 0, + endpointCount: 0, tableParams: { columns: ['foo'], fields: ['foo'] }, pagination: {}, dataRange: { From c7d669a29fef3736506502a94f99623beb951058 Mon Sep 17 00:00:00 2001 From: Matt Poole Date: Fri, 17 Jul 2026 15:54:59 +0100 Subject: [PATCH 2/4] disable flaky ssl test that relied on external source --- test/acceptance/request_check.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/acceptance/request_check.test.js b/test/acceptance/request_check.test.js index 2896c2c7e..e3dde7807 100644 --- a/test/acceptance/request_check.test.js +++ b/test/acceptance/request_check.test.js @@ -284,7 +284,11 @@ test.describe('Request Check', () => { await resultsPage.expectPageHasTabs(false) }) - test('request check of a @url that should cause a SSL error and display custom content', async ({ page }) => { + // TODO: skipped because serverErrorFile's SSL certificate has been renewed and now + // validates, so it no longer triggers the SSL error this test relies on. We need a + // reliable way to force an SSL failure (e.g. a badssl.com endpoint or a locally-served + // bad cert) before re-enabling. See https://github.com/digital-land/submit/pull/1231 + test.skip('request check of a @url that should cause a SSL error and display custom content', async ({ page }) => { log('request check of a @url that should cause a SSL error and display custom content', true) const startPage = await navigateToCheck(page) From 14a0964519ef001b89d2f9ff6dd1e3fa761af0e1 Mon Sep 17 00:00:00 2001 From: Matt Poole Date: Fri, 17 Jul 2026 15:58:22 +0100 Subject: [PATCH 3/4] change to bad ssl link --- test/acceptance/request_check.test.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/acceptance/request_check.test.js b/test/acceptance/request_check.test.js index e3dde7807..4461cea86 100644 --- a/test/acceptance/request_check.test.js +++ b/test/acceptance/request_check.test.js @@ -22,7 +22,7 @@ const navigateToCheck = async (page) => { const okFile = 'https://raw.githubusercontent.com/digital-land/PublishExamples/refs/heads/main/Article4Direction/Files/Article4DirectionArea/article4directionareas-ok.csv' const errorFile = 'https://raw.githubusercontent.com/digital-land/PublishExamples/refs/heads/main/Article4Direction/Files/Article4DirectionArea/article4directionareas-errors.csv' // TODO: this file should cause a SSL Certificate error when served to the async. It currently does but is temporary (A link that causes a Server Timeout Error or SSL Error is required) -const serverErrorFile = 'https://www.tendringdc.gov.uk/sites/default/files/documents/planning/CAD%20csv.csv' +const serverErrorFile = 'http://expired.badssl.com' const htmlFile = 'https://en.wikipedia.org/wiki/John_Doe' let lastTimestamp = 0 @@ -284,11 +284,7 @@ test.describe('Request Check', () => { await resultsPage.expectPageHasTabs(false) }) - // TODO: skipped because serverErrorFile's SSL certificate has been renewed and now - // validates, so it no longer triggers the SSL error this test relies on. We need a - // reliable way to force an SSL failure (e.g. a badssl.com endpoint or a locally-served - // bad cert) before re-enabling. See https://github.com/digital-land/submit/pull/1231 - test.skip('request check of a @url that should cause a SSL error and display custom content', async ({ page }) => { + test('request check of a @url that should cause a SSL error and display custom content', async ({ page }) => { log('request check of a @url that should cause a SSL error and display custom content', true) const startPage = await navigateToCheck(page) From 5dd92e06794b72e8211710a3b98d29d0129720d0 Mon Sep 17 00:00:00 2001 From: Matt Poole Date: Fri, 17 Jul 2026 16:46:17 +0100 Subject: [PATCH 4/4] remove todo comment --- test/acceptance/request_check.test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/acceptance/request_check.test.js b/test/acceptance/request_check.test.js index 4461cea86..103e364d8 100644 --- a/test/acceptance/request_check.test.js +++ b/test/acceptance/request_check.test.js @@ -21,7 +21,6 @@ const navigateToCheck = async (page) => { const okFile = 'https://raw.githubusercontent.com/digital-land/PublishExamples/refs/heads/main/Article4Direction/Files/Article4DirectionArea/article4directionareas-ok.csv' const errorFile = 'https://raw.githubusercontent.com/digital-land/PublishExamples/refs/heads/main/Article4Direction/Files/Article4DirectionArea/article4directionareas-errors.csv' -// TODO: this file should cause a SSL Certificate error when served to the async. It currently does but is temporary (A link that causes a Server Timeout Error or SSL Error is required) const serverErrorFile = 'http://expired.badssl.com' const htmlFile = 'https://en.wikipedia.org/wiki/John_Doe'