Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to GOV.UK Frontend 3.0.0 #769

Merged
merged 9 commits into from
Jul 19, 2019
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
14 changes: 7 additions & 7 deletions __tests__/spec/sanity-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,37 @@ describe('The Prototype Kit', () => {
describe('extensions', () => {
it('should allow known assets to be loaded from node_modules', (done) => {
request(app)
.get('/extension-assets/govuk-frontend/all.js')
.get('/extension-assets/govuk-frontend/govuk/all.js')
.expect('Content-Type', /application\/javascript; charset=UTF-8/)
.expect(200)
.end(function (err, res) {
if (err) {
done(err)
} else {
assert.strictEqual('' + res.text, readFile('node_modules/govuk-frontend/all.js'))
assert.strictEqual('' + res.text, readFile('node_modules/govuk-frontend/govuk/all.js'))
done()
}
})
})

it('should allow known assets to be loaded from node_modules', (done) => {
request(app)
.get('/assets/images/favicon.ico')
.get('/govuk/assets/images/favicon.ico')
.expect('Content-Type', /image\/x-icon/)
.expect(200)
.end(function (err, res) {
if (err) {
done(err)
} else {
assert.strictEqual('' + res.body, readFile('node_modules/govuk-frontend/assets/images/favicon.ico'))
assert.strictEqual('' + res.body, readFile('node_modules/govuk-frontend/govuk/assets/images/favicon.ico'))
done()
}
})
})

it('should not expose everything', function (done) {
request(app)
.get('/assets/common.js')
.get('/govuk/assets/common.js')
.expect(404)
.end(function (err, res) {
if (err) {
Expand All @@ -99,14 +99,14 @@ describe('The Prototype Kit', () => {
describe('misconfigured prototype kit - while upgrading kit developer did not copy over changes in /app folder', () => {
it('should still allow known assets to be loaded from node_modules', (done) => {
request(app)
.get('/node_modules/govuk-frontend/all.js')
.get('/node_modules/govuk-frontend/govuk/all.js')
.expect('Content-Type', /application\/javascript; charset=UTF-8/)
.expect(200)
.end(function (err, res) {
if (err) {
done(err)
} else {
assert.strictEqual('' + res.text, readFile('node_modules/govuk-frontend/all.js'))
assert.strictEqual('' + res.text, readFile('node_modules/govuk-frontend/govuk/all.js'))
done()
}
})
Expand Down
3 changes: 3 additions & 0 deletions app/assets/sass/application.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// global styles for <a> and <p> tags
$govuk-global-styles: true;

// We can't mount GOV.UK Frontend's assets at root as it's done automatically by the extensions framework.
$govuk-assets-path: '/govuk/assets/';

// Import GOV.UK Frontend and any extension styles if extensions have been configured
@import "lib/extensions/extensions";

Expand Down
8 changes: 4 additions & 4 deletions app/assets/sass/patterns/_step-by-step-navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.app-step-nav-header {
position: relative;
padding: 10px;
background: govuk-colour("grey-4");
background: govuk-colour("light-grey", $legacy: "grey-4");
border-top: solid 1px $govuk-border-colour;
border-bottom: solid 1px $govuk-border-colour;
@include govuk-media-query($from: tablet) {
Expand Down Expand Up @@ -297,7 +297,7 @@

.app-step-nav__header {
padding: 15px 0;
border-top: solid 2px govuk-colour("grey-3");
border-top: solid 2px govuk-colour("light-grey", $legacy: "grey-3");
}

.app-step-nav--active .app-step-nav__header {
Expand Down Expand Up @@ -491,7 +491,7 @@
.app-step-nav__help {
position: relative;
padding: 15px 0;
border-top: solid 2px govuk-colour("grey-3");
border-top: solid 2px govuk-colour("light-grey", $legacy: "grey-3");
}

.app-step-nav__help:after {
Expand Down Expand Up @@ -532,7 +532,7 @@
.app-step-nav__substep {
position: relative;
padding-top: 15px;
border-top: solid 2px govuk-colour("grey-3");
border-top: solid 2px govuk-colour("light-grey", $legacy: "grey-3");
}

.app-step-nav__substep:after {
Expand Down
6 changes: 3 additions & 3 deletions app/assets/sass/unbranded.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
//
// If you need to enable compatibility mode or the legacy palette, do that
// *before* these imports.
@import "node_modules/govuk-frontend/settings/colours-palette";
@import "node_modules/govuk-frontend/settings/colours-applied";
@import "node_modules/govuk-frontend/govuk/settings/colours-palette";
@import "node_modules/govuk-frontend/govuk/settings/colours-applied";

// Style links and paragraphs by default
$govuk-global-styles: true;
Expand All @@ -21,4 +21,4 @@ $govuk-font-family: "HelveticaNeue", "Helvetica Neue", "Arial", "Helvetica", san
// the GOV.UK footer.
$govuk-canvas-background-colour: $govuk-body-background-colour;

@import "node_modules/govuk-frontend/all";
@import "node_modules/govuk-frontend/govuk/all";
55 changes: 29 additions & 26 deletions app/views/layout.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{% extends "template.njk" %}
{#- We can't mount GOV.UK Frontend's assets at root as it's done automatically by the extensions framework. -#}
{%- set assetPath = '/govuk/assets' -%}

{% from "accordion/macro.njk" import govukAccordion %}
{% 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 "error-message/macro.njk" import govukErrorMessage %}
{% from "error-summary/macro.njk" import govukErrorSummary %}
{% from "fieldset/macro.njk" import govukFieldset %}
{% from "file-upload/macro.njk" import govukFileUpload %}
{% from "input/macro.njk" import govukInput %}
{% from "inset-text/macro.njk" import govukInsetText %}
{% from "panel/macro.njk" import govukPanel %}
{% from "phase-banner/macro.njk" import govukPhaseBanner %}
{% from "radios/macro.njk" import govukRadios %}
{% from "select/macro.njk" import govukSelect %}
{% from "skip-link/macro.njk" import govukSkipLink %}
{% from "summary-list/macro.njk" import govukSummaryList %}
{% from "table/macro.njk" import govukTable %}
{% from "tabs/macro.njk" import govukTabs %}
{% from "tag/macro.njk" import govukTag %}
{% from "textarea/macro.njk" import govukTextarea %}
{% from "warning-text/macro.njk" import govukWarningText %}
{% extends "govuk/template.njk" %}

{% from "govuk/components/accordion/macro.njk" import govukAccordion %}
{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/character-count/macro.njk" import govukCharacterCount %}
{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %}
{% from "govuk/components/date-input/macro.njk" import govukDateInput %}
{% from "govuk/components/details/macro.njk" import govukDetails %}
{% from "govuk/components/error-message/macro.njk" import govukErrorMessage %}
{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %}
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{% from "govuk/components/file-upload/macro.njk" import govukFileUpload %}
{% from "govuk/components/input/macro.njk" import govukInput %}
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{% from "govuk/components/panel/macro.njk" import govukPanel %}
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/select/macro.njk" import govukSelect %}
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %}
{% from "govuk/components/summary-list/macro.njk" import govukSummaryList %}
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/tabs/macro.njk" import govukTabs %}
{% from "govuk/components/tag/macro.njk" import govukTag %}
{% from "govuk/components/textarea/macro.njk" import govukTextarea %}
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %}

{% block head %}
{% include "includes/head.html" %}
Expand Down
5 changes: 4 additions & 1 deletion app/views/layout_unbranded.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "template.njk" %}
{#- We can't mount GOV.UK Frontend's assets at root as it's done automatically by the extensions framework. -#}
{%- set assetPath = '/govuk/assets' -%}

{% extends "govuk/template.njk" %}

{% block headIcons %}
<link rel="shortcut icon" href="{{ asset_path }}images/unbranded.ico?0.18.3" type="image/x-icon" />
Expand Down
9 changes: 6 additions & 3 deletions docs/assets/sass/docs.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@import "node_modules/govuk-frontend/all";
// We can't mount GOV.UK Frontend's assets at root as it's done automatically by the extensions framework.
$govuk-assets-path: '/govuk/assets/';

@import "node_modules/govuk-frontend/govuk/all";

img{
max-width: 100%;
Expand Down Expand Up @@ -33,7 +36,7 @@ img{
padding: govuk-spacing(3);
overflow: auto;
border: 1px solid $govuk-border-colour;
background-color: govuk-colour("grey-4");
background-color: govuk-colour("light-grey", $legacy: "grey-4");
max-width: 38em;
@include govuk-responsive-margin(5, "bottom");
}
Expand Down Expand Up @@ -94,7 +97,7 @@ img{

p code {
border: 1px solid $govuk-border-colour;
background-color: govuk-colour("grey-4");
background-color: govuk-colour("light-grey", $legacy: "grey-4");
padding: 0 govuk-spacing(2);
}

Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You can change the service name by editing the file '/app/config.js'.

Import the header component macro place it in the `{% block header %}`and provide `navigation` items as shown below.

{% from 'header/macro.njk' import govukHeader %}
{% from 'govuk/components/header/macro.njk' import govukHeader %}

{% block header %}
{{ govukHeader({
Expand Down Expand Up @@ -47,7 +47,7 @@ Import the phase-banner component and supply tag and feedback text. The phase ba

### How to include an Alpha banner

{% from 'phase-banner/macro.njk' import govukPhaseBanner %}
{% from 'govuk/components/phase-banner/macro.njk' import govukPhaseBanner %}

{{ govukPhaseBanner({
tag: {
Expand All @@ -58,7 +58,7 @@ Import the phase-banner component and supply tag and feedback text. The phase ba

### How to include a Beta banner

{% from 'phase-banner/macro.njk' import govukPhaseBanner %}
{% from 'govuk/components/phase-banner/macro.njk' import govukPhaseBanner %}

{{ govukPhaseBanner({
tag: {
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/using-notify.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ example:
<input class="govuk-input" id="email-address" name="emailAddress" type="text">
</div>

<button class="govuk-button">Continue</button>
<button class="govuk-button" data-module="govuk-button">Continue</button>

</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/views/examples/branching/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 class="govuk-fieldset__heading">
</fieldset>
</div>

<button class="govuk-button">Continue</button>
<button class="govuk-button" data-module="govuk-button">Continue</button>

</form>

Expand Down
2 changes: 1 addition & 1 deletion docs/views/examples/pass-data/vehicle-features.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1 class="govuk-fieldset__heading">
</fieldset>
</div>

<button class="govuk-button">Continue</button>
<button class="govuk-button" data-module="govuk-button">Continue</button>

</form>

Expand Down
2 changes: 1 addition & 1 deletion docs/views/examples/pass-data/vehicle-registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1 class="govuk-label-wrapper">
<input class="govuk-input" id="registration-number" name="vehicle-registration" value="{{ data['vehicle-registration'] }}" type="text">
</div>

<button class="govuk-button">Continue</button>
<button class="govuk-button" data-module="govuk-button">Continue</button>

</form>

Expand Down
2 changes: 1 addition & 1 deletion docs/views/examples/pass-data/vehicle-type.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1 class="govuk-fieldset__heading">
</fieldset>
</div>

<button class="govuk-button">Continue</button>
<button class="govuk-button" data-module="govuk-button">Continue</button>

</form>

Expand Down
2 changes: 1 addition & 1 deletion docs/views/includes/scripts.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Javascript -->
<script src="/public/javascripts/jquery-1.11.3.js"></script>
<script src="/extension-assets/govuk-frontend/all.js"></script>
<script src="/extension-assets/govuk-frontend/govuk/all.js"></script>
<script src="/public/javascripts/docs.js"></script>

{% if useAutoStoreData %}
Expand Down
49 changes: 26 additions & 23 deletions docs/views/layout.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
{% extends "template.njk" %}
{#- We can't mount GOV.UK Frontend's assets at root as it's done automatically by the extensions framework. -#}
{%- set assetPath = '/govuk/assets' -%}

{% from "back-link/macro.njk" import govukBackLink %}
{% from "breadcrumbs/macro.njk" import govukBreadcrumbs %}
{% from "button/macro.njk" import govukButton %}
{% from "checkboxes/macro.njk" import govukCheckboxes %}
{% from "date-input/macro.njk" import govukDateInput %}
{% from "details/macro.njk" import govukDetails %}
{% from "error-message/macro.njk" import govukErrorMessage %}
{% from "error-summary/macro.njk" import govukErrorSummary %}
{% from "fieldset/macro.njk" import govukFieldset %}
{% from "file-upload/macro.njk" import govukFileUpload %}
{% from "input/macro.njk" import govukInput %}
{% from "inset-text/macro.njk" import govukInsetText %}
{% from "panel/macro.njk" import govukPanel %}
{% from "phase-banner/macro.njk" import govukPhaseBanner %}
{% from "radios/macro.njk" import govukRadios %}
{% from "select/macro.njk" import govukSelect %}
{% from "skip-link/macro.njk" import govukSkipLink %}
{% from "table/macro.njk" import govukTable %}
{% from "tabs/macro.njk" import govukTabs %}
{% from "tag/macro.njk" import govukTag %}
{% from "textarea/macro.njk" import govukTextarea %}
{% from "warning-text/macro.njk" import govukWarningText %}
{% extends "govuk/template.njk" %}

{% from "govuk/components/back-link/macro.njk" import govukBackLink %}
{% from "govuk/components/breadcrumbs/macro.njk" import govukBreadcrumbs %}
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/checkboxes/macro.njk" import govukCheckboxes %}
{% from "govuk/components/date-input/macro.njk" import govukDateInput %}
{% from "govuk/components/details/macro.njk" import govukDetails %}
{% from "govuk/components/error-message/macro.njk" import govukErrorMessage %}
{% from "govuk/components/error-summary/macro.njk" import govukErrorSummary %}
{% from "govuk/components/fieldset/macro.njk" import govukFieldset %}
{% from "govuk/components/file-upload/macro.njk" import govukFileUpload %}
{% from "govuk/components/input/macro.njk" import govukInput %}
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %}
{% from "govuk/components/panel/macro.njk" import govukPanel %}
{% from "govuk/components/phase-banner/macro.njk" import govukPhaseBanner %}
{% from "govuk/components/radios/macro.njk" import govukRadios %}
{% from "govuk/components/select/macro.njk" import govukSelect %}
{% from "govuk/components/skip-link/macro.njk" import govukSkipLink %}
{% from "govuk/components/table/macro.njk" import govukTable %}
{% from "govuk/components/tabs/macro.njk" import govukTabs %}
{% from "govuk/components/tag/macro.njk" import govukTag %}
{% from "govuk/components/textarea/macro.njk" import govukTextarea %}
{% from "govuk/components/warning-text/macro.njk" import govukWarningText %}

{% block head %}
{% include "includes/head.html" %}
Expand Down
5 changes: 4 additions & 1 deletion docs/views/layout_unbranded.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% extends "template.njk" %}
{#- We can't mount GOV.UK Frontend's assets at root as it's done automatically by the extensions framework. -#}
{%- set assetPath = '/govuk/assets' -%}

{% extends "govuk/template.njk" %}

{% block headIcons %}
<link rel="shortcut icon" href="{{ asset_path }}images/unbranded.ico?0.18.3" type="image/x-icon" />
Expand Down
2 changes: 1 addition & 1 deletion docs/views/templates/check-your-answers.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h2 class="govuk-heading-m">Now send your application</h2>

<input type="hidden" name="answers-checked" value="true">

<button type="submit" class="govuk-button">
<button type="submit" class="govuk-button" data-module="govuk-button">
Accept and send
</button>

Expand Down
2 changes: 1 addition & 1 deletion docs/views/templates/question.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="govuk-heading-xl">Heading or question goes here</h1>

<p>[See <a href="https://design-system.service.gov.uk">the GOV.UK Design System</a> for examples]</p>

<button class="govuk-button">Continue</button>
<button class="govuk-button" data-module="govuk-button">Continue</button>

</form>

Expand Down
7 changes: 6 additions & 1 deletion docs/views/templates/start-with-step-by-step.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ <h1 class="govuk-heading-xl">
<li>do something else</li>
</ul>

<a href="#" role="button" class="govuk-button govuk-button--start govuk-!-margin-top-2 govuk-!-margin-bottom-8">Start now</a>
<a href="#" role="button" draggable="false" class="govuk-button govuk-button--start govuk-!-margin-top-2 govuk-!-margin-bottom-8" data-module="govuk-button">
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" role="presentation" focusable="false">
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"></path>
</svg>
</a>

</div>

Expand Down
Loading