@worksafevictoria/wcl7.5 1.5.0 → 1.7.0
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/.storybook/preview.js +20 -13
- package/bin/deploy.sh +1 -1
- package/lib/utility.js +10 -8
- package/package.json +6 -5
- package/src/assets/icons/AppFooter/x-ws-footer.svg +10 -0
- package/src/assets/icons/AppFooter/x-ww-footer.svg +28 -0
- package/src/assets/icons/SocialShare/x-icon-white.svg +28 -0
- package/src/assets/styles/modal.scss +51 -0
- package/src/components/Common/CardGrid/index.vue +56 -51
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +7 -4
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +15 -19
- package/src/components/Common/CardGridItem/index.vue +77 -63
- package/src/components/Containers/Carousel/index.vue +14 -7
- package/src/components/Containers/HomepageHeader/index.stories.js +60 -36
- package/src/components/Containers/HomepageHeader/index.vue +2 -26
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +15 -15
- package/src/components/Containers/HomepageHeaderNew/index.vue +97 -68
- package/src/components/Containers/SectionGroup/index.vue +1 -1
- package/src/components/Containers/Subheader/index.vue +5 -1
- package/src/components/Global/AppFooter/FooterSocialShare/index.vue +1 -1
- package/src/components/Global/AppFooter/index.vue +14 -7
- package/src/components/Global/AppFooter/styles.scss +3 -0
- package/src/components/Global/AppHeaderNew/styles.scss +10 -15
- package/src/components/Global/BackToTop/index.vue +8 -8
- package/src/components/Global/Cookies/index.stories.js +16 -10
- package/src/components/Global/Cookies/index.vue +280 -243
- package/src/components/Global/Cookies/styles.scss +54 -54
- package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +50 -133
- package/src/components/Global/DirectoryFilters/index.vue +3 -0
- package/src/components/Global/GlobalNotice/index.vue +79 -100
- package/src/components/Global/SocialShare/index.vue +1 -1
- package/src/components/Global/Strip/index.vue +1 -1
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +8 -4
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +23 -23
- package/src/components/Paragraphs/Accordion/index.stories.js +21 -18
- package/src/components/Paragraphs/Accordion/index.vue +52 -48
- package/src/components/Paragraphs/BrowseContent/index.vue +1 -1
- package/src/components/Paragraphs/BrowseContent/setup.vue +284 -0
- package/src/components/Paragraphs/Chart/Constants.js +952 -952
- package/src/components/Paragraphs/Chart/index.vue +232 -241
- package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.stories.js +34 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +321 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.stories.js +19 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +345 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/pagination.vue +179 -0
- package/src/components/Paragraphs/Directory/Records/CJ/index.vue +1 -1
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +1 -1
- package/src/components/Paragraphs/Directory/Records/PRS/index.stories.js +34 -0
- package/src/components/Paragraphs/Directory/Records/PRS/index.vue +5 -1
- package/src/components/Paragraphs/Directory/Records/index.storieshide.js +47 -0
- package/src/components/Paragraphs/Directory/Records/index.vue +52 -33
- package/src/components/Paragraphs/Directory/constants.js +23 -5
- package/src/components/Paragraphs/Directory/index.vue +14 -14
- package/src/components/Paragraphs/Directory/{Records/styles.scss → styles.scss} +5 -3
- package/src/components/Paragraphs/ListGroup/index.vue +5 -1
- package/src/components/Paragraphs/Map/Constants.js +4790 -0
- package/src/components/Paragraphs/Map/index.mdx +29 -0
- package/src/components/Paragraphs/Map/index.stories.js +15 -0
- package/src/components/Paragraphs/Map/index.vue +295 -0
- package/src/components/Paragraphs/Map/postcode_location.json +3543 -0
- package/src/components/Paragraphs/ScrollSpy/index.vue +23 -14
- package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
- package/src/components/Paragraphs/TabbedCards/index.vue +13 -14
- package/src/components/Paragraphs/Tabs/index.vue +19 -17
- package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +9 -9
- package/src/components/Paragraphs/TextMedia/index.vue +20 -16
- package/src/components/Paragraphs/VideoGrid/index.stories.js +43 -19
- package/src/components/Paragraphs/VideoGrid/index.vue +13 -13
- package/src/components/Paragraphs/Webform/index.stories.js +82 -69
- package/src/components/SubComponents/Breadcrumb/index.vue +4 -0
- package/src/components/SubComponents/CardGroup/index.vue +5 -1
- package/src/components/SubComponents/FormAddressPostcode/index.vue +35 -37
- package/src/components/SubComponents/FormInstance/components/handler/index.vue +25 -29
- package/src/components/SubComponents/FormInstance/components/renderer/index.vue +81 -30
- package/src/components/SubComponents/FormInstance/models/overrides/file.js +38 -40
- package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +22 -15
- package/src/components/SubComponents/FormInstance/services/registry-factory.js +1 -1
- package/src/components/SubComponents/FormInstance/stories/fileupload.stories.js +57 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/fileupload.json +25 -0
- package/src/components/SubComponents/FormInstance/style.scss +2 -2
- package/src/components/SubComponents/FormInstance/tests/address.test.js +4 -4
- package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +7 -7
- package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +15 -15
- package/src/components/SubComponents/FormInstance/tests/date.test.js +8 -8
- package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +9 -9
- package/src/components/SubComponents/FormInstance/tests/multiple.test.js +13 -13
- package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +120 -120
- package/src/components/SubComponents/FormInstance/tests/scale.test.js +6 -6
- package/src/components/SubComponents/FormInstance/tests/url.test.js +13 -10
- package/src/components/SubComponents/Pagination/index.vue +19 -18
- package/src/components/SubComponents/ResourceGroup/index.vue +5 -1
- package/src/components/SubComponents/Search/SearchListing/index.vue +20 -20
- package/src/components/SubComponents/Search/index.vue +42 -35
- package/src/components/SubComponents/VideoThumbnail/index.vue +48 -133
- package/src/includes/scss/vars/src/colors.module.scss +28 -1
- package/src/index.js +25 -3
- package/src/main.js +2 -10
- package/src/mock/carousel-items.js +71 -46
- package/src/mock/course-provider.js +273 -0
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</div>
|
|
19
19
|
</column>
|
|
20
20
|
<!-- Cookie buttons displayed when not xs -->
|
|
21
|
-
<column class="cookie-container__col
|
|
21
|
+
<column class="cookie-container__col hidden-on-xs">
|
|
22
22
|
<div class="cookie-buttons mt-md-3">
|
|
23
23
|
<button
|
|
24
24
|
id="moreBtn"
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
id="accept_all"
|
|
35
35
|
role="button"
|
|
36
36
|
class="cookieBtn yellow hasIcon"
|
|
37
|
-
style="order:1
|
|
37
|
+
style="order: 1"
|
|
38
38
|
aria-label="Accept all cookies"
|
|
39
|
-
@click="clickedCookie('accept'), fireGTM()"
|
|
39
|
+
@click="(clickedCookie('accept'), fireGTM())"
|
|
40
40
|
>
|
|
41
41
|
Accept all
|
|
42
42
|
</button>
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
id="reject_all"
|
|
45
45
|
role="button"
|
|
46
46
|
class="cookieBtn black hasIcon"
|
|
47
|
-
style="order:2
|
|
47
|
+
style="order: 2"
|
|
48
48
|
aria-label="Reject all cookies"
|
|
49
|
-
@click="clickedCookie('reject'), fireGTM(), checkCookie()"
|
|
49
|
+
@click="(clickedCookie('reject'), fireGTM(), checkCookie())"
|
|
50
50
|
>
|
|
51
51
|
Reject all
|
|
52
52
|
</button>
|
|
@@ -61,126 +61,155 @@
|
|
|
61
61
|
<a
|
|
62
62
|
id="acceptAllLink"
|
|
63
63
|
href="#"
|
|
64
|
-
@click="clickedCookie('accept'), fireGTM()"
|
|
64
|
+
@click="(clickedCookie('accept'), fireGTM())"
|
|
65
65
|
>Accept all</a
|
|
66
66
|
>
|
|
67
67
|
<a
|
|
68
68
|
id="rejectAllLink"
|
|
69
69
|
href="#"
|
|
70
|
-
@click="clickedCookie('reject'), fireGTM(), checkCookie()"
|
|
70
|
+
@click="(clickedCookie('reject'), fireGTM(), checkCookie())"
|
|
71
71
|
>Reject all</a
|
|
72
72
|
>
|
|
73
73
|
</div>
|
|
74
74
|
</row>
|
|
75
75
|
</row>
|
|
76
76
|
<!-- Modal -->
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
77
|
+
<b-modal
|
|
78
|
+
v-model="showCookieModal"
|
|
79
|
+
scrollable
|
|
80
|
+
@hidden="reset"
|
|
81
|
+
footer-border-variant="null"
|
|
82
|
+
no-header
|
|
83
|
+
size="md"
|
|
84
|
+
>
|
|
85
|
+
<template #default="{ close }">
|
|
86
|
+
<form ref="clearForm">
|
|
87
|
+
<container>
|
|
88
|
+
<row
|
|
89
|
+
><column>
|
|
90
|
+
<div class="modal-heading">
|
|
91
|
+
{{ cookieContent.modal.heading }}
|
|
92
|
+
</div>
|
|
93
|
+
</column></row
|
|
94
|
+
>
|
|
95
|
+
<row>
|
|
96
|
+
<column>
|
|
97
|
+
<h5>{{ cookieContent.modal.functional.heading }}</h5>
|
|
98
|
+
</column>
|
|
99
|
+
<column>
|
|
100
|
+
<fieldset style="float: right">
|
|
101
|
+
<label for="modal1CB" class="option">
|
|
102
|
+
Necessary<span class="sr-only">functional label</span>
|
|
103
|
+
<input
|
|
104
|
+
id="modal1CB"
|
|
105
|
+
type="checkbox"
|
|
106
|
+
value="functional"
|
|
107
|
+
checked
|
|
108
|
+
disabled
|
|
109
|
+
@keyup.enter="(e) => e.target.click()"
|
|
110
|
+
/>
|
|
111
|
+
</label>
|
|
112
|
+
</fieldset>
|
|
113
|
+
</column>
|
|
114
|
+
</row>
|
|
115
|
+
<row>
|
|
116
|
+
<column class="modal-description">{{
|
|
117
|
+
cookieContent.modal.functional.description
|
|
118
|
+
}}</column>
|
|
119
|
+
</row>
|
|
120
|
+
<hr />
|
|
121
|
+
<row>
|
|
122
|
+
<column>
|
|
123
|
+
<h5>{{ cookieContent.modal.analytics.heading }}</h5>
|
|
124
|
+
</column>
|
|
125
|
+
<column>
|
|
126
|
+
<fieldset style="float: right">
|
|
127
|
+
<label for="modal2CB" class="option"
|
|
128
|
+
><span class="sr-only">analytics checkbox</span>
|
|
129
|
+
<input
|
|
130
|
+
id="modal2CB"
|
|
131
|
+
type="checkbox"
|
|
132
|
+
name="modal2CB"
|
|
133
|
+
value="analytics"
|
|
134
|
+
@keyup.enter="(e) => e.target.click()"
|
|
135
|
+
/></label>
|
|
136
|
+
</fieldset>
|
|
137
|
+
</column>
|
|
138
|
+
</row>
|
|
139
|
+
<row>
|
|
140
|
+
<column class="modal-description">{{
|
|
141
|
+
cookieContent.modal.analytics.description
|
|
142
|
+
}}</column>
|
|
143
|
+
</row>
|
|
144
|
+
<hr />
|
|
145
|
+
<row>
|
|
146
|
+
<column>
|
|
147
|
+
<h5>{{ cookieContent.modal.marketing.heading }}</h5>
|
|
148
|
+
</column>
|
|
149
|
+
<column>
|
|
150
|
+
<fieldset style="float: right">
|
|
151
|
+
<label for="modal3CB" class="option"
|
|
152
|
+
><span class="sr-only">marketing checkbox</span>
|
|
153
|
+
<input
|
|
154
|
+
id="modal3CB"
|
|
155
|
+
type="checkbox"
|
|
156
|
+
name="modal3CB"
|
|
157
|
+
value="marketing"
|
|
158
|
+
@keyup.enter="(e) => e.target.click()"
|
|
159
|
+
/></label>
|
|
160
|
+
</fieldset>
|
|
161
|
+
</column>
|
|
162
|
+
</row>
|
|
163
|
+
<row>
|
|
164
|
+
<column class="modal-description">{{
|
|
165
|
+
cookieContent.modal.marketing.description
|
|
166
|
+
}}</column>
|
|
167
|
+
</row>
|
|
168
|
+
</container>
|
|
169
|
+
</form>
|
|
170
|
+
</template>
|
|
171
|
+
|
|
172
|
+
<template #footer="{ close }">
|
|
173
|
+
<div>
|
|
174
|
+
<button
|
|
175
|
+
id="modal_save"
|
|
176
|
+
type="button"
|
|
177
|
+
role="button"
|
|
178
|
+
class="cookieBtn yellow hasIcon"
|
|
179
|
+
style="order: 1"
|
|
180
|
+
aria-label="Save cookie settings"
|
|
181
|
+
@click="
|
|
182
|
+
() => {
|
|
183
|
+
clickedCookie('save')
|
|
184
|
+
fireGTM()
|
|
185
|
+
checkCookie()
|
|
186
|
+
close()
|
|
187
|
+
}
|
|
188
|
+
"
|
|
189
|
+
>
|
|
190
|
+
Save
|
|
191
|
+
</button>
|
|
192
|
+
<button
|
|
193
|
+
id="modal_accept"
|
|
194
|
+
type="button"
|
|
195
|
+
role="button"
|
|
196
|
+
class="cookieBtn black hasIcon"
|
|
197
|
+
style="order: 2"
|
|
198
|
+
data-bs-dismiss="cookieModal"
|
|
199
|
+
aria-label="Accept all cookies"
|
|
200
|
+
@click="
|
|
201
|
+
() => {
|
|
202
|
+
clickedCookie('accept')
|
|
203
|
+
fireGTM()
|
|
204
|
+
close()
|
|
205
|
+
}
|
|
206
|
+
"
|
|
207
|
+
>
|
|
208
|
+
Accept all
|
|
209
|
+
</button>
|
|
182
210
|
</div>
|
|
183
|
-
|
|
211
|
+
</template>
|
|
212
|
+
</b-modal>
|
|
184
213
|
</container>
|
|
185
214
|
</template>
|
|
186
215
|
|
|
@@ -189,23 +218,25 @@ import Container from './../../Containers/Container/index.vue'
|
|
|
189
218
|
import Row from './../../Containers/Row/index.vue'
|
|
190
219
|
import Column from './../../Containers/Column/index.vue'
|
|
191
220
|
import { analyticsCookies, marketingCookies } from './Constants'
|
|
221
|
+
import { BModal } from 'bootstrap-vue-next'
|
|
192
222
|
|
|
193
223
|
export default {
|
|
194
224
|
name: 'Cookies',
|
|
195
225
|
components: {
|
|
196
226
|
Container,
|
|
197
227
|
Row,
|
|
198
|
-
Column
|
|
228
|
+
Column,
|
|
229
|
+
'b-modal': BModal,
|
|
199
230
|
},
|
|
200
231
|
props: {
|
|
201
232
|
cookieHeader: {
|
|
202
233
|
type: String,
|
|
203
|
-
default: 'Accept and Reject Cookies'
|
|
234
|
+
default: 'Accept and Reject Cookies',
|
|
204
235
|
},
|
|
205
236
|
cookieContent: {
|
|
206
237
|
type: Object,
|
|
207
|
-
default: () => {}
|
|
208
|
-
}
|
|
238
|
+
default: () => {},
|
|
239
|
+
},
|
|
209
240
|
},
|
|
210
241
|
data() {
|
|
211
242
|
return {
|
|
@@ -213,7 +244,7 @@ export default {
|
|
|
213
244
|
analyticsCookies,
|
|
214
245
|
marketingCookies,
|
|
215
246
|
screenWidth: 0,
|
|
216
|
-
showCookieModal: false
|
|
247
|
+
showCookieModal: false,
|
|
217
248
|
}
|
|
218
249
|
},
|
|
219
250
|
computed: {
|
|
@@ -221,9 +252,10 @@ export default {
|
|
|
221
252
|
return this.item === null
|
|
222
253
|
},
|
|
223
254
|
showCookie() {
|
|
224
|
-
//
|
|
225
|
-
return process.env.SHOW_COOKIE ===
|
|
255
|
+
// Default to false, but set to true when SHOW_COOKIE is explicitly "true"
|
|
256
|
+
return this.$config?.public?.showCookie === "true" || process.env.SHOW_COOKIE === "true";
|
|
226
257
|
}
|
|
258
|
+
|
|
227
259
|
},
|
|
228
260
|
mounted() {
|
|
229
261
|
// detect screen size to display smaller content
|
|
@@ -232,7 +264,6 @@ export default {
|
|
|
232
264
|
// required, as unable to check localStorage until window loaded
|
|
233
265
|
this.checkCookie()
|
|
234
266
|
window.addEventListener('resize', this.updateScreenWidth)
|
|
235
|
-
|
|
236
267
|
},
|
|
237
268
|
unmounted() {
|
|
238
269
|
window.removeEventListener('load', this.checkCookie)
|
|
@@ -243,29 +274,36 @@ export default {
|
|
|
243
274
|
this.screenWidth = window.innerWidth
|
|
244
275
|
},
|
|
245
276
|
reset() {
|
|
246
|
-
this.$
|
|
277
|
+
this.$refs.clearForm.reset()
|
|
278
|
+
//this.$emit('input', null)
|
|
247
279
|
},
|
|
280
|
+
|
|
248
281
|
//function to set cookies based on response in overlay or modal
|
|
249
282
|
clickedCookie: (clickResponse) => {
|
|
250
283
|
const analyticsCookieName = 'analyticsCookies'
|
|
251
284
|
const marketingCookieName = 'marketingCookies'
|
|
252
285
|
var cookieElement = document.getElementById('mainCookieContainer')
|
|
253
|
-
|
|
286
|
+
|
|
254
287
|
if (cookieElement) {
|
|
255
288
|
localStorage.setItem('cookieBannerDisplayed', 'true') // Mark the banner as displayed
|
|
256
|
-
|
|
289
|
+
|
|
257
290
|
if (clickResponse === 'accept') {
|
|
258
291
|
// localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
259
292
|
localStorage.setItem(analyticsCookieName, 'granted')
|
|
260
293
|
localStorage.setItem(marketingCookieName, 'granted')
|
|
261
|
-
|
|
262
294
|
} else if (clickResponse === 'save') {
|
|
263
295
|
// localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
264
296
|
const acb = document.getElementById('modal2CB')
|
|
265
297
|
const mcb = document.getElementById('modal3CB')
|
|
266
298
|
|
|
267
|
-
localStorage.setItem(
|
|
268
|
-
|
|
299
|
+
localStorage.setItem(
|
|
300
|
+
analyticsCookieName,
|
|
301
|
+
acb.checked ? 'granted' : 'denied',
|
|
302
|
+
)
|
|
303
|
+
localStorage.setItem(
|
|
304
|
+
marketingCookieName,
|
|
305
|
+
mcb.checked ? 'granted' : 'denied',
|
|
306
|
+
)
|
|
269
307
|
} else {
|
|
270
308
|
// clickResponse === 'reject'
|
|
271
309
|
// localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
@@ -279,30 +317,30 @@ export default {
|
|
|
279
317
|
},
|
|
280
318
|
// function to update consent in GTM
|
|
281
319
|
fireGTM() {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
320
|
+
if (this.$gtm) {
|
|
321
|
+
// gather attrs
|
|
322
|
+
let aConsent = localStorage.getItem('analyticsCookies')
|
|
323
|
+
let mConsent = localStorage.getItem('marketingCookies')
|
|
324
|
+
let attrs1 = {
|
|
325
|
+
ad_storage: mConsent,
|
|
326
|
+
}
|
|
327
|
+
// fire the event - marketing
|
|
328
|
+
this.$gtm.push({
|
|
329
|
+
event: 'gtm_consent_update',
|
|
330
|
+
...attrs1,
|
|
331
|
+
})
|
|
332
|
+
let attrs2 = {
|
|
333
|
+
analytics_storage: aConsent,
|
|
334
|
+
}
|
|
335
|
+
// fire the event - analytics
|
|
336
|
+
this.$gtm.push({
|
|
337
|
+
event: 'gtm_consent_update',
|
|
338
|
+
...attrs2,
|
|
339
|
+
})
|
|
340
|
+
}
|
|
303
341
|
},
|
|
304
342
|
//function to remove from local storage based on partial match - called from checkCookie
|
|
305
|
-
removeLocalStorage: function(cookieName) {
|
|
343
|
+
removeLocalStorage: function (cookieName) {
|
|
306
344
|
var removeArr = []
|
|
307
345
|
for (var i = 0; i < localStorage.length; i++) {
|
|
308
346
|
var x = localStorage.key(i)
|
|
@@ -315,125 +353,124 @@ export default {
|
|
|
315
353
|
})
|
|
316
354
|
},
|
|
317
355
|
// function to remove cookies according to response from overlay or modal
|
|
318
|
-
checkCookie: function() {
|
|
319
|
-
const cookieElement = document.getElementById('mainCookieContainer')
|
|
320
|
-
const bannerDisplayed = localStorage.getItem('cookieBannerDisplayed')
|
|
321
|
-
|
|
356
|
+
checkCookie: function () {
|
|
357
|
+
const cookieElement = document.getElementById('mainCookieContainer')
|
|
358
|
+
const bannerDisplayed = localStorage.getItem('cookieBannerDisplayed')
|
|
322
359
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
cookieElement.classList.add('hide')
|
|
333
|
-
cookieElement.classList.remove('show')
|
|
360
|
+
if (this.showCookie && bannerDisplayed !== 'true') {
|
|
361
|
+
// Show the banner if it's not been displayed yet
|
|
362
|
+
cookieElement.classList.remove('hide')
|
|
363
|
+
cookieElement.classList.add('show')
|
|
364
|
+
} else {
|
|
365
|
+
// Hide the banner if user has already made a selection
|
|
366
|
+
// need to remove cookies in rejected categories, but first hide cookie overlay
|
|
367
|
+
cookieElement.classList.add('hide')
|
|
368
|
+
cookieElement.classList.remove('show')
|
|
334
369
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
370
|
+
// get list of categorised cookies
|
|
371
|
+
const analyticsArr = analyticsCookies
|
|
372
|
+
const marketingArr = marketingCookies
|
|
338
373
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
374
|
+
// get list of cookies to process
|
|
375
|
+
var pairs = document.cookie.split(';')
|
|
376
|
+
var cookieArr = []
|
|
377
|
+
for (var i = 0; i < pairs.length; i++) {
|
|
378
|
+
var pair = pairs[i].split('=')
|
|
379
|
+
var nameVar = [pair[0].trim()]
|
|
380
|
+
cookieArr.push(nameVar[0])
|
|
381
|
+
}
|
|
382
|
+
// identify which categories to process, initialising variables to false
|
|
383
|
+
// will only be set to true if user has rejected any cookies
|
|
384
|
+
var checkAnalytics = false
|
|
385
|
+
var checkMarketing = false
|
|
351
386
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
387
|
+
// get value of consent cookies to determine if cookies have to be removed
|
|
388
|
+
var analyticsValue = localStorage.getItem('analyticsCookies')
|
|
389
|
+
if (analyticsValue !== null && analyticsValue === 'denied') {
|
|
390
|
+
checkAnalytics = true
|
|
391
|
+
}
|
|
357
392
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
393
|
+
var marketingValue = localStorage.getItem('marketingCookies')
|
|
394
|
+
if (marketingValue !== null && marketingValue === 'denied') {
|
|
395
|
+
checkMarketing = true
|
|
396
|
+
}
|
|
362
397
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
document.cookie =
|
|
372
|
-
tmpName +
|
|
373
|
-
'=;expires=' +
|
|
374
|
-
new Date(0).toUTCString() +
|
|
375
|
-
';domain=' +
|
|
376
|
-
cookieName.domain +
|
|
377
|
-
';path=' +
|
|
378
|
-
cookieName.path
|
|
379
|
-
})
|
|
380
|
-
} else {
|
|
381
|
-
localStorage.removeItem(cookieName.name)
|
|
398
|
+
// Remove analytics cookies stored as cookies or localStorage
|
|
399
|
+
if (checkAnalytics) {
|
|
400
|
+
analyticsArr.forEach((cookieName) => {
|
|
401
|
+
if (cookieName.name.slice(-1) === '*') {
|
|
402
|
+
var tmpVar = cookieName.name.slice(0, -1)
|
|
403
|
+
this.removeLocalStorage(tmpVar)
|
|
404
|
+
var tmpArr = cookieArr.filter((x) => x.match(cookieName.name))
|
|
405
|
+
tmpArr.forEach((tmpName) => {
|
|
382
406
|
document.cookie =
|
|
383
|
-
|
|
407
|
+
tmpName +
|
|
384
408
|
'=;expires=' +
|
|
385
409
|
new Date(0).toUTCString() +
|
|
386
410
|
';domain=' +
|
|
387
411
|
cookieName.domain +
|
|
388
412
|
';path=' +
|
|
389
413
|
cookieName.path
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
414
|
+
})
|
|
415
|
+
} else {
|
|
416
|
+
localStorage.removeItem(cookieName.name)
|
|
417
|
+
document.cookie =
|
|
418
|
+
cookieName.name +
|
|
419
|
+
'=;expires=' +
|
|
420
|
+
new Date(0).toUTCString() +
|
|
421
|
+
';domain=' +
|
|
422
|
+
cookieName.domain +
|
|
423
|
+
';path=' +
|
|
424
|
+
cookieName.path
|
|
425
|
+
}
|
|
426
|
+
})
|
|
427
|
+
}
|
|
428
|
+
// Remove marketing cookies stored as cookies or localStorage
|
|
429
|
+
if (checkMarketing) {
|
|
430
|
+
marketingArr.forEach((cookieName) => {
|
|
431
|
+
if (cookieName.name.slice(-1) === '*') {
|
|
432
|
+
var tmpVar = cookieName.name.slice(0, -1)
|
|
433
|
+
this.removeLocalStorage(tmpVar)
|
|
434
|
+
var tmpArr = cookieArr.filter((x) => x.match(cookieName.name))
|
|
435
|
+
tmpArr.forEach((tmpName) => {
|
|
412
436
|
document.cookie =
|
|
413
|
-
|
|
437
|
+
tmpName +
|
|
414
438
|
'=;expires=' +
|
|
415
439
|
new Date(0).toUTCString() +
|
|
416
440
|
';domain=' +
|
|
417
441
|
cookieName.domain +
|
|
418
442
|
';path=' +
|
|
419
443
|
cookieName.path
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
|
|
444
|
+
})
|
|
445
|
+
} else {
|
|
446
|
+
localStorage.removeItem(cookieName.name)
|
|
447
|
+
document.cookie =
|
|
448
|
+
cookieName.name +
|
|
449
|
+
'=;expires=' +
|
|
450
|
+
new Date(0).toUTCString() +
|
|
451
|
+
';domain=' +
|
|
452
|
+
cookieName.domain +
|
|
453
|
+
';path=' +
|
|
454
|
+
cookieName.path
|
|
455
|
+
}
|
|
456
|
+
})
|
|
423
457
|
}
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
}
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
},
|
|
427
461
|
}
|
|
428
462
|
</script>
|
|
429
463
|
|
|
430
464
|
<style lang="scss" scoped>
|
|
465
|
+
/* Removed scoped */
|
|
431
466
|
@import './styles';
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
467
|
+
:deep(.modal-heading) {
|
|
468
|
+
font-size: 26px;
|
|
469
|
+
font-weight: 700;
|
|
470
|
+
line-height: 30px;
|
|
471
|
+
letter-spacing: 0px;
|
|
472
|
+
margin-bottom: 16px;
|
|
473
|
+
display: flex;
|
|
474
|
+
justify-content: flex-end !important;
|
|
438
475
|
}
|
|
439
476
|
</style>
|