diff --git a/readme.md b/readme.md index 7d1fdcf6..8fbba153 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# Check planning and housing data for England +# Submit and update planning and housing data for England Project is a web application for validating and submitting planning and housing data for England. diff --git a/src/middleware/datasetOverview.middleware.js b/src/middleware/datasetOverview.middleware.js index c239554a..ac2a747e 100644 --- a/src/middleware/datasetOverview.middleware.js +++ b/src/middleware/datasetOverview.middleware.js @@ -62,7 +62,7 @@ const fetchEntityCount = fetchOne({ }) export const prepareDatasetOverviewTemplateParams = (req, res, next) => { - const { orgInfo, specification, columnSummary, entityCount, sources, dataset } = req + const { orgInfo, specification, columnSummary, entityCount, sources, dataset, issues } = req const mappingFields = columnSummary[0].mapping_field?.split(';') ?? [] const nonMappingFields = columnSummary[0].non_mapping_field?.split(';') ?? [] @@ -106,6 +106,7 @@ export const prepareDatasetOverviewTemplateParams = (req, res, next) => { req.templateParams = { organisation: orgInfo, dataset, + issueCount: issues.length ?? 0, stats: { numberOfFieldsSupplied: numberOfFieldsSupplied ?? 0, numberOfFieldsMatched: numberOfFieldsMatched ?? 0, @@ -127,10 +128,8 @@ const getDatasetOverview = renderTemplate( ) export default [ - parallel([ - fetchOrgInfo, - fetchDatasetInfo - ]), + fetchOrgInfo, + fetchDatasetInfo, parallel([ fetchColumnSummary, fetchResourceStatus, diff --git a/src/middleware/datasetTaskList.middleware.js b/src/middleware/datasetTaskList.middleware.js index 07ce42c3..8a5d9f23 100644 --- a/src/middleware/datasetTaskList.middleware.js +++ b/src/middleware/datasetTaskList.middleware.js @@ -113,9 +113,8 @@ const getDatasetTaskListError = renderTemplate({ export default [ fetchResourceStatus, - parallel([ - fetchOrgInfoWithStatGeo, - fetchDatasetInfo]), + fetchOrgInfoWithStatGeo, + fetchDatasetInfo, fetchIf(isResourceAccessible, fetchLatestResource), parallel([ fetchIf(isResourceAccessible, fetchLpaDatasetIssues), diff --git a/src/middleware/issueDetails.middleware.js b/src/middleware/issueDetails.middleware.js index e84e402e..ce5befd3 100644 --- a/src/middleware/issueDetails.middleware.js +++ b/src/middleware/issueDetails.middleware.js @@ -286,10 +286,8 @@ export const getIssueDetails = renderTemplate({ export default [ validateIssueDetailsQueryParams, - parallel([ - fetchOrgInfo, - fetchDatasetInfo - ]), + fetchOrgInfo, + fetchDatasetInfo, fetchIf(isResourceIdInParams, fetchLatestResource, takeResourceIdFromParams), fetchIssues, reformatIssuesToBeByEntryNumber, diff --git a/src/middleware/overview.middleware.js b/src/middleware/overview.middleware.js index 52df17d3..10bb11d2 100644 --- a/src/middleware/overview.middleware.js +++ b/src/middleware/overview.middleware.js @@ -1,6 +1,6 @@ import performanceDbApi, { lpaOverviewQuery } from '../services/performanceDbApi.js' import { fetchOrgInfo, logPageError } from './common.middleware.js' -import { fetchMany, FetchOptions, parallel, renderTemplate } from './middleware.builders.js' +import { fetchMany, FetchOptions, renderTemplate } from './middleware.builders.js' import { dataSubjects } from '../utils/utils.js' import config from '../../config/index.js' import _ from 'lodash' @@ -154,10 +154,8 @@ export const getOverview = renderTemplate({ }) export default [ - parallel([ - fetchOrgInfo, - fetchLatestResources] - ), + fetchOrgInfo, + fetchLatestResources, fetchEntityCounts, fetchLpaOverview, prepareOverviewTemplateParams, diff --git a/src/routes/schemas.js b/src/routes/schemas.js index ef2e15e8..7c9ed66b 100644 --- a/src/routes/schemas.js +++ b/src/routes/schemas.js @@ -73,6 +73,7 @@ export const OrgGetStarted = v.strictObject({ export const OrgDatasetOverview = v.strictObject({ organisation: OrgField, dataset: DatasetNameField, + issueCount: v.integer(), stats: v.strictObject({ numberOfRecords: v.integer(), numberOfFieldsSupplied: v.integer(), diff --git a/src/views/accessibility.html b/src/views/accessibility.html index ddf2bd04..65113ad3 100644 --- a/src/views/accessibility.html +++ b/src/views/accessibility.html @@ -1,12 +1,12 @@ {% extends "layouts/main.html" %} -{% set pageName = 'Accessibility statement for check planning and housing data for England' %} +{% set pageName = 'Accessibility statement for Submit and update planning and housing data for England' %} {% set markdownContent %} -# Accessibility statement for check planning and housing data for England +# Accessibility statement for Submit and update planning and housing data for England -This accessibility statement applies to the check planning and housing data for England service (publish.development.digital-land.info). +This accessibility statement applies to the Submit and update planning and housing data for England service (publish.development.digital-land.info). This service is run by the Ministry of Housing, Communities and Local Government (MHCLG). We want as many people as possible to be able to use this service. For example, that means you should be able to: diff --git a/src/views/cookies.html b/src/views/cookies.html index fce09ec2..b626585d 100644 --- a/src/views/cookies.html +++ b/src/views/cookies.html @@ -1,12 +1,12 @@ {% extends "layouts/main.html" %} -{% set pageName = 'Accessibility statement for check planning and housing data for England' %} +{% set pageName = 'Accessibility statement for Submit and update planning and housing data for England' %} {% set markdownContent %} -# Check planning and housing data for England cookies notice +# Submit and update planning and housing data for England cookies notice -The Check planning and housing data for England service puts cookies onto your computer to collect information about how you use the service. This helps us to: +The Submit and update planning and housing data for England service puts cookies onto your computer to collect information about how you use the service. This helps us to: @@ -21,16 +21,16 @@ Essential cookies are needed for the service to work. We do not need to ask for permission to use them. -## How cookies are used on the Check planning and housing data for England service +## How cookies are used on the Submit and update planning and housing data for England service ### Our cookie banner (essential) -When you first visit the Check planning and housing data for England service, you will see a banner asking if you accept cookies. We’ll store a cookie to remember which option you selected. You can always change your mind and change your choice on this page. +When you first visit the Submit and update planning and housing data for England service, you will see a banner asking if you accept cookies. We’ll store a cookie to remember which option you selected. You can always change your mind and change your choice on this page. Next time you visit the site, we will remember your preference and not show the banner again. -To do this, the Check planning and housing data for England service sets the following cookies: +To do this, the Submit and update planning and housing data for England service sets the following cookies: diff --git a/src/views/errorPages/400.html b/src/views/errorPages/400.html index e8fd715e..883d3738 100644 --- a/src/views/errorPages/400.html +++ b/src/views/errorPages/400.html @@ -11,7 +11,7 @@

{{pageName}}

If you pasted the web address, check you copied the entire address.

-

If the web address is correct or vou selected a link or button send an email +

If the web address is correct or you selected a link or button send an email to digitalland@communities.gov.uk.

diff --git a/src/views/errorPages/404.html b/src/views/errorPages/404.html index 7a5abb8b..dc158056 100644 --- a/src/views/errorPages/404.html +++ b/src/views/errorPages/404.html @@ -11,7 +11,7 @@

{{pageName}}

If you pasted the web address, check you copied the entire address.

-

If the web address is correct or vou selected a link or button send an email +

If the web address is correct or you selected a link or button send an email to digitalland@communities.gov.uk.

diff --git a/src/views/privacy-notice.html b/src/views/privacy-notice.html index 6bc060d6..a96aa7d6 100644 --- a/src/views/privacy-notice.html +++ b/src/views/privacy-notice.html @@ -1,15 +1,15 @@ {% extends "layouts/main.html" %} -{% set pageName = 'Accessibility statement for check planning and housing data for England' %} +{% set pageName = 'Accessibility statement for Submit and update planning and housing data for England' %} {% set markdownContent %} -# Check planning and housing data for England privacy notice +# Submit and update planning and housing data for England privacy notice ## Who we are -Check planning and housing data for England ([check.planning.data.go.uk](check.planning.data.go.uk)) is provided by the Ministry of Housing, Communities and Local Government (MHCLG). +Submit and update planning and housing data for England ([submit.planning.data.gov.uk](https://submit.planning.data.gov.uk)) is provided by the Ministry of Housing, Communities and Local Government (MHCLG). MHCLG is the data controller for the service. diff --git a/test/unit/middleware/datasetOverview.middleware.test.js b/test/unit/middleware/datasetOverview.middleware.test.js index 2380faa0..3060d6df 100644 --- a/test/unit/middleware/datasetOverview.middleware.test.js +++ b/test/unit/middleware/datasetOverview.middleware.test.js @@ -41,12 +41,22 @@ describe('Dataset Overview Middleware', () => { sources: [ { endpoint_url: 'endpoint1', documentation_url: 'doc-url1', status: '200', endpoint_entry_date: 'LU1', latest_log_entry_date: 'LA1' }, { endpoint_url: 'endpoint2', documentation_url: 'doc-url2', status: '404', exception: 'exception', endpoint_entry_date: 'LU2', latest_log_entry_date: 'LA2' } + ], + issues: [ + { + issue: 'Example issue 1', + issue_type: 'Example issue type 1', + field: 'Example issue field 1', + num_issues: 1, + status: 'Error' + } ] } prepareDatasetOverviewTemplateParams(reqWithResults, res, () => {}) expect(reqWithResults.templateParams).toEqual({ organisation: { name: 'mock-org' }, dataset: reqWithResults.dataset, + issueCount: 1, stats: { numberOfFieldsSupplied: 1, numberOfFieldsMatched: 1,