From 33e8577b8af79521b2ec32d2af9c38cc53385010 Mon Sep 17 00:00:00 2001 From: igloosi Date: Wed, 26 Sep 2018 14:10:25 +0100 Subject: [PATCH 001/112] Update GOV.UK Frontend dependency to 2.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de8c7b45d4..7cae793bae 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express-session": "^1.13.0", "express-writer": "0.0.4", "govuk-elements-sass": "^3.1.3", - "govuk-frontend": "^2.0.0", + "govuk-frontend": "^2.1.0", "govuk_frontend_toolkit": "^7.5.0", "govuk_template_jinja": "^0.24.1", "gulp": "^3.9.1", From 193c6898354fca4fbc4e1f29260df469cbbc33b3 Mon Sep 17 00:00:00 2001 From: igloosi Date: Wed, 26 Sep 2018 14:20:53 +0100 Subject: [PATCH 002/112] Use header macro instead of HTML We have done the work to allow attributes to be added to navigation items, which means we can now use the macro instead of plain HTML --- docs/views/layout.html | 70 ++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/docs/views/layout.html b/docs/views/layout.html index 8d43b0630a..8fb806011f 100644 --- a/docs/views/layout.html +++ b/docs/views/layout.html @@ -40,49 +40,33 @@ {% block header %} {% include "includes/cookie-banner.html" %} {# Set serviceName in config.js. #} -{# TODO: Use the macro when data attributes can be passed to individual items: #} -{# https://github.com/alphagov/govuk-frontend/issues/904 #} - + {{ govukHeader({ + serviceName: serviceName, + serviceUrl: "/", + navigation: [ + { + href: "/docs/install", + text: "Install", + attributes: { + "data-install": "Install" + } + }, + { + href: "/docs/tutorials-and-examples", + text: "Tutorials and examples", + attributes: { + "data-tutorials": "Tutorials and examples" + } + }, + { + href: "docs/about", + text: "About", + attributes: { + "data-about": "About" + } + } + ] + }) }} {% endblock %} {% block footer %} From c293f48daaf012e758e66931a16e9575c78dca40 Mon Sep 17 00:00:00 2001 From: igloosi Date: Wed, 26 Sep 2018 14:24:23 +0100 Subject: [PATCH 003/112] Document in CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0336547782..89166e35d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Unreleased + +New features: + +- [#600 Update GOV.UK Frontend to v2.1.0](https://github.com/alphagov/govuk-prototype-kit/pull/600) + # 8.0.0 Breaking changes: From b3dda98383ec034f09c77c3bd8970639dc51084e Mon Sep 17 00:00:00 2001 From: igloosi Date: Wed, 26 Sep 2018 14:32:25 +0100 Subject: [PATCH 004/112] Release v8.1.0 --- CHANGELOG.md | 2 +- VERSION.txt | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89166e35d5..f53bdea77a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# 8.1.0 New features: diff --git a/VERSION.txt b/VERSION.txt index ae9a76b924..8104cabd36 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -8.0.0 +8.1.0 diff --git a/package.json b/package.json index 7cae793bae..172b3ba939 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "express-prototype", "description": "GOVUK prototyping app in Express", - "version": "8.0.0", + "version": "8.1.0", "private": true, "engines": { "node": "^8.9.1" From ce8ad138a48d524f4875a3c3729b34a057da193d Mon Sep 17 00:00:00 2001 From: igloosi Date: Tue, 2 Oct 2018 09:56:14 +0100 Subject: [PATCH 005/112] Set stylesheet media to all In GOV.UK Frontend components no longer have separate print stylesheet; print styles are built into the component partials By setting media to all we allow those styles to apply in print situations. --- app/views/includes/head.html | 2 +- docs/views/includes/head.html | 4 ++-- docs/views/layout_unbranded.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/includes/head.html b/app/views/includes/head.html index 88e56ebeee..6d9e5d8d8a 100644 --- a/app/views/includes/head.html +++ b/app/views/includes/head.html @@ -1,2 +1,2 @@ - + diff --git a/docs/views/includes/head.html b/docs/views/includes/head.html index f78e30e92f..33dbf59c86 100644 --- a/docs/views/includes/head.html +++ b/docs/views/includes/head.html @@ -1,6 +1,6 @@ - + - + diff --git a/docs/views/layout_unbranded.html b/docs/views/layout_unbranded.html index 9dbff9e7f8..77387dc65f 100644 --- a/docs/views/layout_unbranded.html +++ b/docs/views/layout_unbranded.html @@ -10,7 +10,7 @@ {% endblock %} {% block head %} - + {% endblock %} {% block header %}{% endblock %} From 11b31c77e82dec0d099b6e90268932dea96b1ce8 Mon Sep 17 00:00:00 2001 From: igloosi Date: Tue, 2 Oct 2018 09:59:46 +0100 Subject: [PATCH 006/112] Document in CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f53bdea77a..a4c79a7368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Unreleased + +Bug fixes: + +- [#605 Set stylesheet media to "all" to allow print styles](https://github.com/alphagov/govuk-prototype-kit/pull/605) + # 8.1.0 New features: From ba4d5c026d1c3070429a10f574dee3ee2dec2de0 Mon Sep 17 00:00:00 2001 From: Joe Lanman Date: Wed, 3 Oct 2018 11:18:17 +0100 Subject: [PATCH 007/112] fix About link in nav --- docs/views/layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/views/layout.html b/docs/views/layout.html index 8fb806011f..a5b3ce79a7 100644 --- a/docs/views/layout.html +++ b/docs/views/layout.html @@ -59,7 +59,7 @@ } }, { - href: "docs/about", + href: "/docs/about", text: "About", attributes: { "data-about": "About" From ae83a744c3631b25940509db2c342eccac651b43 Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Mon, 8 Oct 2018 15:54:05 +0100 Subject: [PATCH 008/112] Use form POST request when clearing session data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This builds on the work done in #588. Previously the ‘clear data’ feature used two GET requests – one to display the confirmation screen, and a second to actually clear the session data. This is not ideal because GET requests are meant to be nullipotent (to have no side effects), and links from the docs part of the kit were still pointing to the old URL, which bypassed the confirmation screen. This adds a form to the confirmation screen which POSTs to itself (/prototype-admin/clear-data), and changes the old data-clearing route to match. --- app/views/layout.html | 2 +- lib/prototype-admin/clear-data-success.html | 23 ++++++++++++ lib/prototype-admin/clear-data.html | 39 ++++++++++++++------- lib/prototype-admin/clears-data.html | 36 ------------------- server.js | 4 +-- 5 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 lib/prototype-admin/clear-data-success.html delete mode 100644 lib/prototype-admin/clears-data.html diff --git a/app/views/layout.html b/app/views/layout.html index a4884221cd..f04a84127b 100644 --- a/app/views/layout.html +++ b/app/views/layout.html @@ -52,7 +52,7 @@ text: "GOV.UK Prototype Kit " + releaseVersion }, { - href: "/prototype-admin/clears-data", + href: "/prototype-admin/clear-data", text: "Clear data" } ] diff --git a/lib/prototype-admin/clear-data-success.html b/lib/prototype-admin/clear-data-success.html new file mode 100644 index 0000000000..14750f8484 --- /dev/null +++ b/lib/prototype-admin/clear-data-success.html @@ -0,0 +1,23 @@ +{% extends "layout.html" %} + +{% block pageTitle %} + Clear data +{% endblock %} + +{% block content %} + +

+ Data cleared +

+ +

+ The session data has been cleared. +

+ +

+ + Prototype home page + +

+ +{% endblock %} diff --git a/lib/prototype-admin/clear-data.html b/lib/prototype-admin/clear-data.html index 14750f8484..10d56395ee 100644 --- a/lib/prototype-admin/clear-data.html +++ b/lib/prototype-admin/clear-data.html @@ -1,23 +1,36 @@ + {% extends "layout.html" %} {% block pageTitle %} - Clear data + Clear data? | GOV.UK Prototype Kit {% endblock %} -{% block content %} +{% block beforeContent %} + {{ govukBackLink({ + "text": "Back", + "href": "javascript: window.history.go(-1)" + }) + }} +{% endblock %} -

- Data cleared -

+{% block content %} -

- The session data has been cleared. -

+
+
+
+

+ Clear data? +

+ {{ govukWarningText({ + text: "This will clear all of the data entered in this session", + iconFallbackText: "Warning" + }) }} -

- - Prototype home page - -

+ {{ govukButton({ + text: "Clear the data" + }) }} +
+
+
{% endblock %} diff --git a/lib/prototype-admin/clears-data.html b/lib/prototype-admin/clears-data.html deleted file mode 100644 index 0e6a77906b..0000000000 --- a/lib/prototype-admin/clears-data.html +++ /dev/null @@ -1,36 +0,0 @@ - -{% extends "layout.html" %} - -{% block pageTitle %} - Clear data? | GOV.UK Prototype Kit -{% endblock %} - -{% block beforeContent %} - {{ govukBackLink({ - "text": "Back", - "href": "javascript: window.history.go(-1)" - }) - }} -{% endblock %} - -{% block content %} - -
-
-

- Clear data? -

- {{ govukWarningText({ - text: "This will clear all of the data entered in this session", - iconFallbackText: "Warning" - }) }} - - - {{ govukButton({ - text: "Clear the data", - href: "/prototype-admin/clear-data" - }) }} -
-
- -{% endblock %} diff --git a/server.js b/server.js index 1eb52695dc..17226fa63c 100644 --- a/server.js +++ b/server.js @@ -227,9 +227,9 @@ if (useAutoStoreData === 'true') { } // Clear all data in session if you open /prototype-admin/clear-data -app.get('/prototype-admin/clear-data', function (req, res) { +app.post('/prototype-admin/clear-data', function (req, res) { req.session.data = {} - res.render('prototype-admin/clear-data') + res.render('prototype-admin/clear-data-success') }) // Redirect root to /docs when in promo mode. From fb5464f0657c1ad94183db371d67b8df4c413f8e Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Mon, 8 Oct 2018 16:49:49 +0100 Subject: [PATCH 009/112] Use consistent page titles --- lib/prototype-admin/clear-data-success.html | 2 +- lib/prototype-admin/clear-data.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/prototype-admin/clear-data-success.html b/lib/prototype-admin/clear-data-success.html index 14750f8484..cc80f50364 100644 --- a/lib/prototype-admin/clear-data-success.html +++ b/lib/prototype-admin/clear-data-success.html @@ -1,7 +1,7 @@ {% extends "layout.html" %} {% block pageTitle %} - Clear data + Data cleared - GOV.UK Prototype Kit {% endblock %} {% block content %} diff --git a/lib/prototype-admin/clear-data.html b/lib/prototype-admin/clear-data.html index 10d56395ee..005fa65f3c 100644 --- a/lib/prototype-admin/clear-data.html +++ b/lib/prototype-admin/clear-data.html @@ -2,7 +2,7 @@ {% extends "layout.html" %} {% block pageTitle %} - Clear data? | GOV.UK Prototype Kit + Clear data? - GOV.UK Prototype Kit {% endblock %} {% block beforeContent %} From 396c582dc8833cf57596a05149b23caa7da3ec0e Mon Sep 17 00:00:00 2001 From: Oliver Byford Date: Mon, 8 Oct 2018 16:52:46 +0100 Subject: [PATCH 010/112] Document in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c79a7368..f3dca20df8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ Bug fixes: - [#605 Set stylesheet media to "all" to allow print styles](https://github.com/alphagov/govuk-prototype-kit/pull/605) +- [#608 Clearing session data now uses a POST request rather than a destructive GET request](https://github.com/alphagov/govuk-prototype-kit/pull/608) # 8.1.0 From 736e420f396a58a6aa9e050a36d68bb399e2d69d Mon Sep 17 00:00:00 2001 From: igloosi Date: Thu, 11 Oct 2018 10:32:41 +0100 Subject: [PATCH 011/112] Update GOV.UK Frontend dependency Update to v2.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 172b3ba939..a6f9f5926e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "express-session": "^1.13.0", "express-writer": "0.0.4", "govuk-elements-sass": "^3.1.3", - "govuk-frontend": "^2.1.0", + "govuk-frontend": "^2.2.0", "govuk_frontend_toolkit": "^7.5.0", "govuk_template_jinja": "^0.24.1", "gulp": "^3.9.1", From ed4b6a5816e646d8381e13427c8632f4c91a133a Mon Sep 17 00:00:00 2001 From: igloosi Date: Thu, 11 Oct 2018 10:36:43 +0100 Subject: [PATCH 012/112] Import character-count component Make it available in the app views --- app/views/layout.html | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layout.html b/app/views/layout.html index f04a84127b..59b25cca85 100644 --- a/app/views/layout.html +++ b/app/views/layout.html @@ -3,6 +3,7 @@ {% from "back-link/macro.njk" import govukBackLink %} {% from "breadcrumbs/macro.njk" import govukBreadcrumbs %} {% from "button/macro.njk" import govukButton %} +{% from "character-count/macro.njk" import govukCharacterCount %} {% from "checkboxes/macro.njk" import govukCheckboxes %} {% from "date-input/macro.njk" import govukDateInput %} {% from "details/macro.njk" import govukDetails %} From 4362c7e701f3982586037f20097a2cf3376fdb76 Mon Sep 17 00:00:00 2001 From: igloosi Date: Thu, 11 Oct 2018 10:41:20 +0100 Subject: [PATCH 013/112] Document in CHANGELOG --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3dca20df8..c187211c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,15 @@ # Unreleased +New Features: + +- [#609 Update GOV.UK Frontend to v2.2.0](https://github.com/alphagov/govuk-prototype-kit/pull/609) + +Also includes a new character-count component + Bug fixes: - [#605 Set stylesheet media to "all" to allow print styles](https://github.com/alphagov/govuk-prototype-kit/pull/605) + - [#608 Clearing session data now uses a POST request rather than a destructive GET request](https://github.com/alphagov/govuk-prototype-kit/pull/608) # 8.1.0 From 5ec6251ad55832f722b1fb4f2cf5c158629c7326 Mon Sep 17 00:00:00 2001 From: igloosi Date: Thu, 11 Oct 2018 10:45:46 +0100 Subject: [PATCH 014/112] Release 8.2.0 --- CHANGELOG.md | 2 +- VERSION.txt | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c187211c92..1d8d99c30e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Unreleased +# 8.2.0 New Features: diff --git a/VERSION.txt b/VERSION.txt index 8104cabd36..fbb9ea12de 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -8.1.0 +8.2.0 diff --git a/package.json b/package.json index a6f9f5926e..92174c0b54 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "express-prototype", "description": "GOVUK prototyping app in Express", - "version": "8.1.0", + "version": "8.2.0", "private": true, "engines": { "node": "^8.9.1" From b639cc7bda54495d85daf6fcd2ea23ceb31168dc Mon Sep 17 00:00:00 2001 From: igloosi Date: Tue, 16 Oct 2018 10:56:11 +0100 Subject: [PATCH 015/112] Heroku review app config Required config to enable review apps on Heroku --- app.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 app.json diff --git a/app.json b/app.json new file mode 100644 index 0000000000..a85e811f33 --- /dev/null +++ b/app.json @@ -0,0 +1,21 @@ +{ + "name": "govuk-prototype-kit", + "scripts": {}, + "env": { + "USE_AUTH": { + "required": true + } + }, + "formation": { + "web": { + "quantity": 1 + } + }, + "addons": [], + "buildpacks": [ + { + "url": "heroku/nodejs" + } + ] + } + \ No newline at end of file From 31e4cdf54730875a8a1a1684774a12342e356f2e Mon Sep 17 00:00:00 2001 From: Deniz Genc Date: Fri, 26 Oct 2018 15:26:45 +0100 Subject: [PATCH 016/112] Fixed path for page templates in tutorials-and-examples The site referred to docs/views/examples, which was incorrect. --- docs/views/tutorials-and-examples.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/views/tutorials-and-examples.html b/docs/views/tutorials-and-examples.html index 9ba5c5bf73..10c515beab 100644 --- a/docs/views/tutorials-and-examples.html +++ b/docs/views/tutorials-and-examples.html @@ -122,7 +122,7 @@

Page templates

Use these as the basis for your prototypes. We recommend making copies of the files rather than directly editing them.

- You can find them in your prototype folder, in /docs/views/examples + You can find them in your prototype folder, in /docs/views/templates