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 @@
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 @@ +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 %} +