@defra/lis-infra-ui-services 0.28.0 → 0.29.0-lreg-665.alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/autocomplete.scss +1 -1
- package/src/components/search-form.scss +5 -1
- package/src/components/service-navigation.scss +4 -1
- package/src/components/sortable-paginated-table.scss +1 -1
- package/src/components/sub-navigation.scss +1 -1
- package/src/nunjucks/routes/error/error-pages.test.js +28 -0
- package/src/nunjucks/routes/error/not-authorised.njk +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Modelled on govuk_publishing_components' gem-c-search (large, on-white
|
|
2
2
|
// variant): https://github.com/alphagov/govuk_publishing_components
|
|
3
|
-
|
|
3
|
+
// Only govuk-frontend's settings, tools and helpers are used here, never its
|
|
4
|
+
// full entry point: that emits every govuk rule again wherever it resolves to
|
|
5
|
+
// a second copy of the package (a symlinked install does), and the repeat
|
|
6
|
+
// lands after this package's rules and overrides them.
|
|
7
|
+
@use 'govuk-frontend/dist/govuk/base' as *;
|
|
4
8
|
|
|
5
9
|
$lis-search-form-input-size: 50px;
|
|
6
10
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* Pushes the Sign out item to the end of the service navigation bar.
|
|
2
|
-
base.njk renders it with the app-service-navigation__item--right class.
|
|
2
|
+
base.njk renders it with the app-service-navigation__item--right class.
|
|
3
|
+
govuk-frontend lays the list out as a flex row from tablet up, so an auto
|
|
4
|
+
margin is all it takes. This file deliberately uses nothing from
|
|
5
|
+
govuk-frontend: see the note in search-form.scss. */
|
|
3
6
|
.app-service-navigation__item--right {
|
|
4
7
|
margin-left: auto;
|
|
5
8
|
}
|
|
@@ -85,6 +85,34 @@ describe('error pages', () => {
|
|
|
85
85
|
expect(html).not.toContain('Sign in')
|
|
86
86
|
})
|
|
87
87
|
|
|
88
|
+
test('not authorised offers a sign out button when signOutHref is given', () => {
|
|
89
|
+
// Arrange
|
|
90
|
+
const context = { signOutHref: '/signout' }
|
|
91
|
+
|
|
92
|
+
// Act
|
|
93
|
+
const html = render('error/not-authorised.njk', context)
|
|
94
|
+
|
|
95
|
+
// Assert
|
|
96
|
+
expect(html).toContain(
|
|
97
|
+
'<a href="/signout" role="button" draggable="false" class="govuk-button" data-module="govuk-button">Sign out</a>'
|
|
98
|
+
)
|
|
99
|
+
expect(html).not.toContain('Sign in')
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
test('not authorised prefers sign out over sign in when both are given', () => {
|
|
103
|
+
// Arrange
|
|
104
|
+
const context = { signInHref: '/auth/login', signOutHref: '/signout' }
|
|
105
|
+
|
|
106
|
+
// Act
|
|
107
|
+
const html = render('error/not-authorised.njk', context)
|
|
108
|
+
|
|
109
|
+
// Assert
|
|
110
|
+
expect(html).toContain('href="/signout"')
|
|
111
|
+
expect(html).toContain('Sign out')
|
|
112
|
+
expect(html).not.toContain('Sign in')
|
|
113
|
+
expect(html).not.toContain('/auth/login')
|
|
114
|
+
})
|
|
115
|
+
|
|
88
116
|
test('not authorised shows the heading and the support link', () => {
|
|
89
117
|
// Arrange
|
|
90
118
|
const context = {
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
<h1 class="govuk-heading-l">Sorry, you are not authorised to view this page</h1>
|
|
7
7
|
<p class="govuk-body">Check your details are correct and try again.</p>
|
|
8
8
|
<p class="govuk-body">If you think this is incorrect <a class="govuk-link" href="{{ errorPages.contactHref }}">contact our support team</a>.</p>
|
|
9
|
-
{% if
|
|
9
|
+
{% if signOutHref %}
|
|
10
|
+
<a href="{{ signOutHref }}" role="button" draggable="false" class="govuk-button" data-module="govuk-button">Sign out</a>
|
|
11
|
+
{% elif signInHref %}
|
|
10
12
|
<a href="{{ signInHref }}" role="button" draggable="false" class="govuk-button" data-module="govuk-button">Sign in</a>
|
|
11
13
|
{% endif %}
|
|
12
14
|
</div>
|