Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/filters/aOrAn.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function aOrAn (word) {
// returns 'a' or 'an' depending on the first letter of the input word - does not quite work for all words such as hour
return word && typeof word === 'string' ? (['a', 'e', 'i', 'o', 'u'].includes(word.trim().toLowerCase()[0]) ? 'an' : 'a') : 'a'
}
2 changes: 2 additions & 0 deletions src/filters/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { schemaIssues } from './schemaIssues.js'
import { endpointSubmissionFormToolDeepLink } from './endpointSubmissionFormDeepLink.js'
import { isFeatureEnabled } from '../utils/features.js'
import { getNavigationLinks } from './getNavigationLinks.js'
import { aOrAn } from './aOrAn.js'
/** maps dataset status (as returned by `fetchLpaOverview` middleware to a
* CSS class used by the govuk-tag component
*/
Expand Down Expand Up @@ -47,6 +48,7 @@ const addFilters = (nunjucksEnv) => {
nunjucksEnv.addFilter('getFullServiceName', getFullServiceName)
nunjucksEnv.addFilter('statusToTagClass', statusToTagClass)
nunjucksEnv.addFilter('pluralise', pluralize)
nunjucksEnv.addFilter('aOrAn', aOrAn)
nunjucksEnv.addFilter('checkToolDeepLink', checkToolDeepLink)
nunjucksEnv.addFilter('endpointSubmissionFormToolDeepLink', endpointSubmissionFormToolDeepLink)
nunjucksEnv.addFilter('getDatasetGuidanceUrl', getDatasetGuidanceUrl)
Expand Down
8 changes: 8 additions & 0 deletions src/filters/getNavigationLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ const navigationLinks = {
guidance: {
href: '/guidance',
text: 'Guidance'
},
community: {
href: '/community',
text: 'Community'
},
extract: {
href: '/extract',
text: 'Extract your data'
}
}

Expand Down
11 changes: 11 additions & 0 deletions src/routes/community.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import express from 'express'
import nunjucks from 'nunjucks'

const router = express.Router()

router.get('/', (req, res) => {
const communityPage = nunjucks.render('community.html', {})
res.send(communityPage)
})

export default router
11 changes: 11 additions & 0 deletions src/routes/extract.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import express from 'express'
import nunjucks from 'nunjucks'

const router = express.Router()

router.get('/', (req, res) => {
const extractPage = nunjucks.render('extract.html', {})
res.send(extractPage)
})

export default router
5 changes: 4 additions & 1 deletion src/serverSetup/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import manage from '../routes/manage.js'
import privacy from '../routes/privacy.js'
import cookies from '../routes/cookies.js'
import guidance from '../routes/guidance.js'
import community from '../routes/community.js'
import extract from '../routes/extract.js'

export function setupRoutes (app) {
app.use('/', manage)
app.use('/check', checkFormWizard)
app.use('/organisations', organisations)
app.use('/guidance', guidance)

app.use('/community', community)
app.use('/extract', extract)
app.use('/api', polling)

app.use('/accessibility', accessibility)
Expand Down
2 changes: 1 addition & 1 deletion src/views/accessibility.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "layouts/main.html" %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set pageName = 'Accessibility statement for Check and provide planning and housing data for England' %}

{% set markdownContent %}
Expand Down
10 changes: 10 additions & 0 deletions src/views/community.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "layouts/main.html" %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set pageName = 'Community' %}

{% block main %}
<div class="govuk-width-container govuk-!-padding-top-6 govuk-!-padding-bottom-6">
<h1 class="govuk-heading-xl">Community</h1>
<p class="govuk-body">You can <a href="https://design.planning.data.gov.uk/get-involved-in-designing-data">get involved with community events and discussions</a> to help improve this service.</p>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion src/views/cookies.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% set pageName = 'Cookie notice for Check and provide planning and housing data for England' %}
{% set serviceType = 'manage' %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set markdownContent %}

# Check and provide planning and housing data for England cookies notice
Expand Down
2 changes: 1 addition & 1 deletion src/views/error.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% from "govuk/components/button/macro.njk" import govukButton %}

{% set pageName = "Error" %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% extends "layouts/main.html" %}
{% block content %}
<h1 class="govuk-heading-xl">Error</h1>
Expand Down
25 changes: 25 additions & 0 deletions src/views/extract.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends "layouts/main.html" %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set pageName = 'Extract' %}

{% block main %}
<div class="govuk-width-container govuk-!-padding-top-6 govuk-!-padding-bottom-6">
<h1 class="govuk-heading-xl">Extract your data</h1>
<p class="govuk-body">Extract is a tool that turns your maps, PDFs and historic planning records into standardised
planning data.</p>
<p class="govuk-body">When you upload a document, the tool will:</p>
<ul class="govuk-list govuk-list--bullet">
<li>extract key information (like dates, locations and decisions) and format it into datasets</li>
<li>trace boundaries drawn on maps and outline boundary areas</li>
<li>match the boundary areas to coordinates</li>
</ul>
<p class="govuk-body">You can review and correct the data that the tool extracts before you export it.</p>
<p class="govuk-body">We currently support:</p>
<ul class="govuk-list govuk-list--bullet">
<li>article 4 directions</li>
<li>conservation areas</li>
<li>tree preservation orders</li>
</ul>
<p class="govuk-body"><a href="https://extract.ai.gov.uk/" class="govuk-link">Find out more about Extract</a></p>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion src/views/includes/_issue-guidance.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2 class="govuk-heading-l">
How to fix this issue
</h2>

<p class="govuk-body">Your dataset is missing the <strong>{{ issueSpecification.field }}</strong> column.</p>
<p class="govuk-body">Your data is missing {{ issueSpecification.field | aOrAn }} <strong>{{ issueSpecification.field }}</strong>.</p>
<p class="govuk-body">The <a href="{{ dataset.dataset | getDatasetGuidanceUrl }}" target="_blank" rel="noopener noreferrer">{{ dataset.name }}</a> guidance explains how to fix the issue:</p>
{{ govukInsetText({
html: issueSpecificationInsetHtml
Expand Down
101 changes: 13 additions & 88 deletions src/views/landing.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{% extends "layouts/main.html" %}
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from 'govuk/components/phase-banner/macro.njk' import govukPhaseBanner %}

{% set serviceType = 'Manage' %}
{% set pageName = '' %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set mainClasses = 'govuk-!-padding-0' %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% block main %}
<div class="app-masthead">
<div class="govuk-width-container">
Expand All @@ -17,108 +17,33 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop">
<h1 class="govuk-heading-xl app-masthead__title">{{ serviceName }}</h1>

<p class="app-masthead__description govuk-body-l govuk-!-margin-bottom-4">
The Planning Data platform is a single national platform that indexes the
data and makes it available in a standardised
format.
Use this service to:
</p>

<ul class="govuk-list govuk-list--bullet govuk-list--spaced app-masthead__description govuk-body-l govuk-!-margin-bottom-4">
<li>check your data is ready to publish</li>
<li>provide your data to the planning data platform</li>
</ul>
<p class="app-masthead__description govuk-body-l govuk-!-margin-bottom-4">
You can use the service to check your data and provide it to us.
We’ll add it to the Planning Data Platform.
You must publish your data on your website before you provide it.
Planning data aims to make land and housing data easier to find, use and trust. We take the data you provide
and standardise it in a consistent format.
</p>

<p class="app-masthead__description govuk-body-l govuk-!-margin-bottom-4">
Your data does not need to be complete or perfect to start.
Any data we have from you means we can begin to index it and provide it on the platform.
Start with what you have and improve it over time.
<a href="/guidance" class="govuk-link app-masthead__link">Find out how to check and provide your data</a>
</p>

<p class="app-masthead__description govuk-body-l govuk-!-margin-bottom-4">
<a href="/guidance" class="govuk-link app-masthead__link">Read the guidance to help you check and provide your data</a>
</p>

<a href="/organisations" role="button" draggable="false"
class="govuk-button govuk-button--inverse govuk-!-margin-top-6 govuk-!-margin-bottom-0 govuk-button--start"
data-module="govuk-button">
Check and provide data
Start now
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19"
viewBox="0 0 33 40" aria-hidden="true" focusable="false">
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"></path>
</svg>
</a>
</div>

<div class="govuk-grid-column-one-third-from-desktop">&nbsp;</div>
<div class="govuk-grid-column-one-third-from-desktop"></div>
</div>
</div>
</div>
{{ super() }}
{% endblock %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l">Check your data</h2>

<p class="govuk-body">The check tool can help you understand which issues you need to fix straightaway, and which issues you can fix later.</p>

<p class="govuk-body">The tool will accept any of these formats:</p>
<ul class="govuk-list govuk-list--bullet">
<li>CSV</li>
<li>GeoJSON</li>
<li>GML</li>
<li>GeoPackage</li>
</ul>

<p class="govuk-body">Alternatively you can use your endpoint URL (the URL of the data file or feed itself).</p>
<p class="govuk-body">You do not need to publish your data on your website before you check it.</p>
</div>
</div>

<div class="govuk-grid-row">
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--xl" />

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l">Provide your data</h2>

<p class="govuk-body">Once you have published your data on your website, you can provide your data to the platform. We'll need your:</p>

<ul class="govuk-list govuk-list--bullet">
<li>full name</li>
<li>work email address</li>
<li>endpoint URL</li>
<li>webpage URL: the URL of the page on your website which contains information about the dataset and the link to your data</li>
</ul>
</div>
</div>

<div class="govuk-grid-row">
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--xl" />

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l">View your data</h2>

<p class="govuk-body">
<a href="/organisations" class="govuk-link">Visit your organisation’s dashboard</a> anytime to clearly see the data you’ve supplied and the datasets you still need to provide.
</p>

<p class="govuk-body">For any live data, we’ll let you know what you can do to improve it.</p>
</div>
</div>

<div class="govuk-grid-row">
<hr class="govuk-section-break govuk-section-break--visible govuk-section-break--xl" />

<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l">Contribute to the data design process</h2>

<p class="govuk-body">Information about how you can help with designing data and get involved in community events and discussions.</p>

<p class="govuk-body"><a href="{{ dataDesignUrl }}" class="govuk-link">Contribute to the data design process</a></p>
</div>

</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion src/views/organisations/dataset-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{% from "components/alternativeSourceNotice.html" import alternativeSourceNotice %}
{% from "components/alternativePrePopulatedSourceNotice.html" import alternativePrePopulatedSourceNotice %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}

{% set serviceType = 'Manage' %}
{% set pageName %}
Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/datasetTaskList.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% from 'govuk/components/task-list/macro.njk' import govukTaskList %}
{% from "../components/dataset-navigation.html" import datasetNavigation %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set pageName %}{{organisation.name}} - {{dataset.dataset | datasetSlugToReadableName(true)}} - Task list{% endset %}
{% set serviceType = 'Manage' %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/dataview.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% from "components/alternativeSourceNotice.html" import alternativeSourceNotice %}
{% from "components/alternativePrePopulatedSourceNotice.html" import alternativePrePopulatedSourceNotice %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set serviceType = 'Submit'%}
{% set pageName %}{{organisation.name}} - {{dataset.dataset | datasetSlugToReadableName(true)}} - Dataset table{% endset %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/find.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set serviceType = 'Manage' %}
{% set pageName = "Find your organisation" %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/get-started.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set serviceType = 'Manage' %}
{% set pageName %}
{{organisation.name}} - {{dataset.dataset | datasetSlugToReadableName(true)}} - Get started
Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/http-error.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set pageName %}{{organisation.name}} - {{dataset.dataset | datasetSlugToReadableName(true)}} - Task list{% endset %}
{% set serviceType = 'manage' %}
{% set resubmitUrl %}/organisations/{{ organisation.organisation | urlencode }}/{{ dataset.dataset | urlencode }}/get-started{% endset %}
Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/issueDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% set isExpectation = issueType === 'expectation' %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set serviceType = 'Submit'%}
{% if issueEntitiesCount > 1 %}
{% set pageName %}{{organisation.name}} - {{dataset.dataset | datasetSlugToReadableName(true)}} - Issues (Page {{pageNumber}} of {{issueEntitiesCount}}){% endset %}
Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/issueTable.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% from "govuk/components/pagination/macro.njk" import govukPagination %}
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set serviceType = 'Submit'%}
{% if issueEntitiesCount > 1 %}
{% set pageName %}{{organisation.name}} - {{dataset.dataset | datasetSlugToReadableName(true)}} - Issues (Page {{pageNumber}} of {{issueEntitiesCount}}){% endset %}
Expand Down
2 changes: 1 addition & 1 deletion src/views/organisations/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% from "components/deadlineNotice.html" import deadlineNotice %}
{% from "components/deadlineNoticeContent.html" import noticeHeading, noticeCardHint %}

{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set pageName = organisation.name + " overview" %}
{% set serviceType = 'Manage' %}

Expand Down
2 changes: 1 addition & 1 deletion src/views/privacy-notice.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "layouts/main.html" %}

{% set pageName = 'Privacy notice for Check and provide planning and housing data for England' %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance']) %}
{% set navigationItems = currentPath | getNavigationLinks(['organisations', 'guidance', 'community', 'extract']) %}
{% set markdownContent %}

# Check and provide planning and housing data for England privacy notice
Expand Down
2 changes: 1 addition & 1 deletion test/PageObjectModels/landingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class LandingPage extends BasePage {
}

async clickStartNow () {
await this.page.click('text=Check and provide data')
await this.page.click('text=Start now')
return await super.verifyAndReturnPage(OrganisationsPage)
}
}
Loading