@defra-fish/gafl-webapp-service 1.61.0-rc.17 → 1.61.0-rc.19

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/gafl-webapp-service",
3
- "version": "1.61.0-rc.17",
3
+ "version": "1.61.0-rc.19",
4
4
  "description": "The websales frontend for the GAFL service",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,8 +36,8 @@
36
36
  "prepare": "gulp --gulpfile build/gulpfile.cjs"
37
37
  },
38
38
  "dependencies": {
39
- "@defra-fish/business-rules-lib": "1.61.0-rc.17",
40
- "@defra-fish/connectors-lib": "1.61.0-rc.17",
39
+ "@defra-fish/business-rules-lib": "1.61.0-rc.19",
40
+ "@defra-fish/connectors-lib": "1.61.0-rc.19",
41
41
  "@defra/hapi-gapi": "^2.0.0",
42
42
  "@hapi/boom": "^9.1.2",
43
43
  "@hapi/catbox-redis": "^6.0.2",
@@ -52,7 +52,7 @@
52
52
  "debug": "^4.3.3",
53
53
  "disinfect": "^1.1.0",
54
54
  "find": "^0.3.0",
55
- "govuk-frontend": "^5.2.0",
55
+ "govuk-frontend": "^5.10.2",
56
56
  "hapi-i18n": "^3.0.1",
57
57
  "joi": "^17.6.0",
58
58
  "moment": "^2.29.1",
@@ -79,5 +79,5 @@
79
79
  "./gafl-jest-matchers.js"
80
80
  ]
81
81
  },
82
- "gitHead": "e35e018372742acfe0cb41e31abd14d3b0c7f742"
82
+ "gitHead": "74d6ad7d56ff5dd9ec7b5567b08d726352dd275a"
83
83
  }
@@ -5,6 +5,7 @@
5
5
  <meta name="robots" content="noindex">
6
6
  {% endif %}
7
7
 
8
+ {% from "cookie-banner/macro.njk" import govukCookieBanner %}
8
9
  {% from "header/macro.njk" import govukHeader %}
9
10
  {% from "button/macro.njk" import govukButton %}
10
11
  {% from "back-link/macro.njk" import govukBackLink %}
@@ -13,115 +14,112 @@
13
14
  {% set htmlLang = "cy" %}
14
15
  {% endif %}
15
16
 
17
+ {% set govukRebrand = true %}
18
+
16
19
  {% macro csrf() %}
17
20
  <div><input type="hidden" name="{{CSRF_TOKEN_NAME}}" value="{{CSRF_TOKEN_VALUE}}"></div>
18
21
  {% endmacro %}
19
22
 
23
+ {% set cbHtml %}
24
+ <p class="govuk-body">{{ mssgs.analytics_banner_preamble_1 }}</p>
25
+ <p class="govuk-body">{{ mssgs.analytics_banner_preamble_2 }}</p>
26
+ {% endset %}
27
+
20
28
  {% block head %}
21
- <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
22
- <link href="/public/stylesheets/main.css" rel="stylesheet" type="text/css" />
23
- <meta http-equiv="Cache-Control" content="no-store" />
24
- <meta http-equiv="Pragma" content="no-cache">
25
- <meta http-equiv="Expires" content="-1">
29
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
30
+ <link href="/public/stylesheets/main.css" rel="stylesheet" type="text/css" />
31
+ <meta http-equiv="Cache-Control" content="no-store" />
32
+ <meta http-equiv="Pragma" content="no-cache">
33
+ <meta http-equiv="Expires" content="-1">
26
34
  {% endblock %}
27
35
 
28
36
  {% block header %}
29
- {% if displayAnalytics %}
30
- {% if not analyticsMessageDisplayed %}
31
- <form method="POST" novalidate action='{{ uri.analyticsFormAction }}'>
32
- {% if not analyticsSelected %}
33
- <div id="cookie-banner" class="cookie-banner no-print" role="region" aria-label="cookie banner">
34
- <div id="cookie-message" class="cookie-message no-print" role="region" aria-label="cookie message">
35
- <div class="govuk-width-container">
36
- <h2 class="govuk-cookie-banner__heading govuk-heading-m">
37
- {{ mssgs.analytics_banner_title }}
38
- </h2>
39
- <div class="govuk-cookie-banner__content">
40
- <p class="govuk-body">
41
- {{ mssgs.analytics_banner_preamble_1 }}
42
- </p>
43
- <p class="govuk-body">
44
- {{ mssgs.analytics_banner_preamble_2 }}
45
- </p>
46
- </div>
47
- <div class="govuk-button-group">
48
- {{ govukButton({
49
- attributes: { id: 'accept' },
50
- preventDoubleClick: true,
51
- name: "analyticsResponse",
52
- text: mssgs.analytics_banner_accept,
53
- value: 'accept'
54
- }) }}
55
- {{ govukButton({
56
- attributes: { id: 'reject' },
57
- preventDoubleClick: true,
58
- name: "analyticsResponse",
59
- text: mssgs.analytics_banner_reject,
60
- value: 'reject'
61
- }) }}
62
- <a class="govuk-link" href="{{ _uri.cookies }}">{{ mssgs.analytics_banner_view_cookies_link }}</a>
63
- </div>
64
- </div>
65
- </div>
66
- </div>
67
- {% endif %}
68
- {% if analyticsSelected %}
69
- {% if acceptedTracking %}
70
- <div id="cookie-accept" class="cookie-message" role="region" aria-label="cookie accept">
71
- <div class="govuk-width-container">
72
- <div class="govuk-cookie-banner__content">
73
- <p class="govuk-body" id="cookie-acceptance">
74
- {{ mssgs.analytics_banner_acceptance_1 }} <a class="govuk-link" href="{{ _uri.cookies }}">{{ mssgs.analytics_banner_cookies_link }}</a> {{ mssgs.analytics_banner_acceptance_2 }}
75
- </p>
76
- </div>
77
- <div class="govuk-button-group">
78
- {{ govukButton({
79
- attributes: { id: 'hide' },
80
- preventDoubleClick: true,
81
- name: "hide",
82
- text: mssgs.analytics_banner_hide,
83
- value: true
84
- }) }}
85
- </div>
86
- </div>
87
- </div>
88
- </div>
89
- {% else %}
90
- <div id="cookie-reject" class="cookie-banner no-print" role="region">
91
- <div class="govuk-width-container">
92
- <div class="govuk-cookie-banner__content">
93
- <p class="govuk-body">
94
- {{ mssgs.analytics_banner_rejection_1 }} <a class="govuk-link" href="{{ _uri.cookies }}">{{ mssgs.analytics_banner_cookies_link }}</a> {{ mssgs.analytics_banner_rejection_2 }}
95
- </p>
96
- </div>
97
- <div class="govuk-button-group">
98
- {{ govukButton({
99
- attributes: { id: 'hide' },
100
- preventDoubleClick: true,
101
- name: "hideMessage",
102
- text: mssgs.analytics_banner_hide,
103
- value: true
104
- }) }}
105
- </div>
106
- </div>
107
- </div>
108
- {% endif %}
109
- {% endif %}
37
+ <form action="{{ uri.analyticsFormAction }}" method="POST">
38
+ {{ csrf() }}
110
39
 
111
- {{ csrf() }}
112
- </form>
40
+ {% if displayAnalytics and not analyticsMessageDisplayed %}
41
+ {% if not analyticsSelected %}
42
+ {{ govukCookieBanner({
43
+ rebrand: true,
44
+ ariaLabel: mssgs.analytics_banner_title,
45
+ messages: [
46
+ {
47
+ headingText: mssgs.analytics_banner_title,
48
+ html: cbHtml,
49
+ actions: [
50
+ {
51
+ text: mssgs.analytics_banner_accept,
52
+ type: "submit",
53
+ name: "analyticsResponse",
54
+ id: "analytics-accept",
55
+ value: "accept"
56
+ },
57
+ {
58
+ text: mssgs.analytics_banner_reject,
59
+ type: "submit",
60
+ name: "analyticsResponse",
61
+ id: "analytics-reject",
62
+ value: "reject"
63
+ },
64
+ {
65
+ text: mssgs.analytics_banner_view_cookies_link,
66
+ href: _uri.cookies,
67
+ id: "analytics-view"
68
+ }
69
+ ]
70
+ }
71
+ ]
72
+ }) }}
73
+ {% else %}
74
+ {% if acceptedTracking %}
75
+ {% set messageHtml %}
76
+ <p class="govuk-body">
77
+ {{ mssgs.analytics_banner_acceptance_1 }}
78
+ <a class="govuk-link" href="{{ _uri.cookies }}">{{ mssgs.analytics_banner_cookies_link }}</a>
79
+ {{ mssgs.analytics_banner_acceptance_2 }}
80
+ </p>
81
+ {% endset %}
82
+ {% else %}
83
+ {% set messageHtml %}
84
+ <p class="govuk-body">
85
+ {{ mssgs.analytics_banner_rejection_1 }}
86
+ <a class="govuk-link" href="{{ _uri.cookies }}">{{ mssgs.analytics_banner_cookies_link }}</a>
87
+ {{ mssgs.analytics_banner_rejection_2 }}
88
+ </p>
89
+ {% endset %}
113
90
  {% endif %}
91
+
92
+ {{ govukCookieBanner({
93
+ rebrand: true,
94
+ ariaLabel: mssgs.analytics_banner_title,
95
+ messages: [
96
+ {
97
+ html: messageHtml,
98
+ actions: [
99
+ {
100
+ text: mssgs.analytics_banner_hide,
101
+ type: 'submit',
102
+ name: 'hideMessage',
103
+ id: 'hide-message',
104
+ value: "true"
105
+ }
106
+ ]
107
+ }
108
+ ]
109
+ }) }}
110
+ {% endif %}
114
111
  {% endif %}
115
112
 
116
113
  {{ govukHeader({
117
- assetsPath: assetPath + '/images',
118
- homepageUrl: "https://www.gov.uk/",
119
- serviceUrl: "/",
120
- classes: "no-print",
121
- containerClasses: "govuk-width-container",
122
- serviceName: mssgs.header_service_name if not TELESALES else "Get a rod fishing licence (TELESALES)",
123
- useTudorCrown: true
114
+ rebrand: true,
115
+ assetsPath: assetPath + '/images',
116
+ homepageUrl: "https://www.gov.uk/",
117
+ serviceUrl: "/",
118
+ classes: "no-print",
119
+ containerClasses: "govuk-width-container",
120
+ serviceName: mssgs.header_service_name if not TELESALES else "Get a rod fishing licence (TELESALES)"
124
121
  }) }}
122
+ </form>
125
123
  {% endblock %}
126
124
 
127
125
  {% block beforeContent %}
@@ -245,6 +243,7 @@
245
243
  </div>
246
244
  </footer>
247
245
  {% endblock %}
246
+
248
247
  {% block bodyEnd %}
249
248
  <script type="module" src="/public/javascript/govuk-frontend-min.js"></script>
250
249
  <script nonce="{{nonce}}" type="module">