@worksafevictoria/wcl7.5 1.1.0-beta.42 → 1.1.0-beta.44
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/.env +1 -3
- package/package.json +2 -2
- package/src/components/Global/Cookies/index.vue +134 -141
- package/src/components/Global/GlobalNotice/index.vue +23 -2
- package/src/components/SubComponents/FormInstance/models/overrides/address.js +21 -12
- package/src/components/SubComponents/FormInstance/tests/address.test.js +48 -48
- package/src/components/SubComponents/ResourceGroup/index.vue +112 -110
- package/vite.config.js +28 -16
package/.env
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
CONTENT_API_URL=https://content-staging-v2.api.worksafe.vic.gov.au
|
|
2
2
|
IS_STORYBOOK=TRUE
|
|
3
3
|
SHOW_COOKIE=true
|
|
4
|
-
GOOGLE__URL=https://cse.google.com/cse.js?cx=53b1506aa03c64160
|
|
5
|
-
CARETAKER=false
|
|
6
|
-
SHOW_GLOBAL_NOTICE=true
|
|
4
|
+
GOOGLE__URL=https://cse.google.com/cse.js?cx=53b1506aa03c64160
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worksafevictoria/wcl7.5",
|
|
3
|
-
"version": "1.1.0-beta.
|
|
3
|
+
"version": "1.1.0-beta.44",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"axios": "^1.6.0",
|
|
45
45
|
"bootstrap": "^5.3.2",
|
|
46
46
|
"bootstrap-vue": "^2.23.1",
|
|
47
|
-
"bootstrap-vue-next": "^0.
|
|
47
|
+
"bootstrap-vue-next": "^0.25.10",
|
|
48
48
|
"date-fns": "^2.30.0",
|
|
49
49
|
"formiojs": "4.13.13",
|
|
50
50
|
"storybook-addon-deep-controls": "^0.6.2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<container id="mainCookieContainer"
|
|
2
|
+
<container id="mainCookieContainer">
|
|
3
3
|
<row class="cookie-container">
|
|
4
4
|
<column class="cookie-container__col">
|
|
5
5
|
<h3 id="cookie_header" class="cookie-header hidden-on-xs">
|
|
@@ -222,32 +222,23 @@ export default {
|
|
|
222
222
|
},
|
|
223
223
|
showCookie() {
|
|
224
224
|
//Check first if cookies have been turned on in the environment variable
|
|
225
|
-
|
|
226
|
-
return 'true'
|
|
227
|
-
} else {
|
|
228
|
-
return 'false'
|
|
229
|
-
}
|
|
225
|
+
return process.env.SHOW_COOKIE === false ? false : true
|
|
230
226
|
}
|
|
231
227
|
},
|
|
232
228
|
mounted() {
|
|
233
|
-
// required, as unable to check localStorage until window loaded
|
|
234
|
-
window.addEventListener('load', this.checkCookie())
|
|
235
229
|
// detect screen size to display smaller content
|
|
236
230
|
this.screenWidth = window.innerWidth
|
|
237
|
-
this
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
this.
|
|
231
|
+
this.updateScreenWidth()
|
|
232
|
+
// required, as unable to check localStorage until window loaded
|
|
233
|
+
this.checkCookie()
|
|
234
|
+
window.addEventListener('resize', this.updateScreenWidth)
|
|
235
|
+
|
|
241
236
|
},
|
|
242
237
|
unmounted() {
|
|
243
|
-
window.removeEventListener('load', this.checkCookie
|
|
238
|
+
window.removeEventListener('load', this.checkCookie)
|
|
239
|
+
window.removeEventListener('resize', this.updateScreenWidth)
|
|
244
240
|
},
|
|
245
241
|
methods: {
|
|
246
|
-
onScreenResize() {
|
|
247
|
-
window.addEventListener('resize', () => {
|
|
248
|
-
this.updateScreenWidth()
|
|
249
|
-
})
|
|
250
|
-
},
|
|
251
242
|
updateScreenWidth() {
|
|
252
243
|
this.screenWidth = window.innerWidth
|
|
253
244
|
},
|
|
@@ -259,59 +250,56 @@ export default {
|
|
|
259
250
|
const analyticsCookieName = 'analyticsCookies'
|
|
260
251
|
const marketingCookieName = 'marketingCookies'
|
|
261
252
|
var cookieElement = document.getElementById('mainCookieContainer')
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
localStorage.setItem(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
} else if (clickResponse === 'save') {
|
|
269
|
-
const acb = document.getElementById('modal2CB')
|
|
270
|
-
const mcb = document.getElementById('modal3CB')
|
|
271
|
-
localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
272
|
-
if (acb.checked) {
|
|
253
|
+
|
|
254
|
+
if (cookieElement) {
|
|
255
|
+
localStorage.setItem('cookieBannerDisplayed', 'true') // Mark the banner as displayed
|
|
256
|
+
|
|
257
|
+
if (clickResponse === 'accept') {
|
|
258
|
+
// localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
273
259
|
localStorage.setItem(analyticsCookieName, 'granted')
|
|
274
|
-
} else {
|
|
275
|
-
localStorage.setItem(analyticsCookieName, 'denied')
|
|
276
|
-
}
|
|
277
|
-
if (mcb.checked) {
|
|
278
260
|
localStorage.setItem(marketingCookieName, 'granted')
|
|
261
|
+
|
|
262
|
+
} else if (clickResponse === 'save') {
|
|
263
|
+
// localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
264
|
+
const acb = document.getElementById('modal2CB')
|
|
265
|
+
const mcb = document.getElementById('modal3CB')
|
|
266
|
+
|
|
267
|
+
localStorage.setItem(analyticsCookieName, acb.checked ? 'granted' : 'denied')
|
|
268
|
+
localStorage.setItem(marketingCookieName, mcb.checked ? 'granted' : 'denied')
|
|
279
269
|
} else {
|
|
270
|
+
// clickResponse === 'reject'
|
|
271
|
+
// localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
272
|
+
localStorage.setItem(analyticsCookieName, 'denied')
|
|
280
273
|
localStorage.setItem(marketingCookieName, 'denied')
|
|
281
274
|
}
|
|
282
|
-
|
|
283
|
-
cookieElement.classList.remove('show')
|
|
284
|
-
} else {
|
|
285
|
-
localStorage.setItem('cookieBannerDisplayed', 'false')
|
|
286
|
-
localStorage.setItem(analyticsCookieName, 'denied')
|
|
287
|
-
localStorage.setItem(marketingCookieName, 'denied')
|
|
275
|
+
|
|
288
276
|
cookieElement.classList.add('hide')
|
|
289
277
|
cookieElement.classList.remove('show')
|
|
290
278
|
}
|
|
291
279
|
},
|
|
292
280
|
// function to update consent in GTM
|
|
293
281
|
fireGTM() {
|
|
294
|
-
if (this.$gtm) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
282
|
+
// if (this.$gtm) {
|
|
283
|
+
// // gather attrs
|
|
284
|
+
// let aConsent = localStorage.getItem('analyticsCookies')
|
|
285
|
+
// let mConsent = localStorage.getItem('marketingCookies')
|
|
286
|
+
// let attrs1 = {
|
|
287
|
+
// ad_storage: mConsent
|
|
288
|
+
// }
|
|
289
|
+
// // fire the event - marketing
|
|
290
|
+
// this.$gtm.push({
|
|
291
|
+
// event: 'gtm_consent_update',
|
|
292
|
+
// ...attrs1
|
|
293
|
+
// })
|
|
294
|
+
// let attrs2 = {
|
|
295
|
+
// analytics_storage: aConsent
|
|
296
|
+
// }
|
|
297
|
+
// // fire the event - analytics
|
|
298
|
+
// this.$gtm.push({
|
|
299
|
+
// event: 'gtm_consent_update',
|
|
300
|
+
// ...attrs2
|
|
301
|
+
// })
|
|
302
|
+
// }
|
|
315
303
|
},
|
|
316
304
|
//function to remove from local storage based on partial match - called from checkCookie
|
|
317
305
|
removeLocalStorage: function(cookieName) {
|
|
@@ -328,107 +316,112 @@ export default {
|
|
|
328
316
|
},
|
|
329
317
|
// function to remove cookies according to response from overlay or modal
|
|
330
318
|
checkCookie: function() {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
this.showCookie === 'true' &&
|
|
334
|
-
!localStorage.getItem('cookieBannerDisplayed')
|
|
335
|
-
) {
|
|
336
|
-
cookieElement.classList.remove('hide')
|
|
337
|
-
cookieElement.classList.add('show')
|
|
338
|
-
} else {
|
|
339
|
-
// need to remove cookies in rejected categories, but first hide cookie overlay
|
|
340
|
-
cookieElement.classList.add('hide')
|
|
341
|
-
cookieElement.classList.remove('show')
|
|
319
|
+
const cookieElement = document.getElementById('mainCookieContainer');
|
|
320
|
+
const bannerDisplayed = localStorage.getItem('cookieBannerDisplayed');
|
|
342
321
|
|
|
343
|
-
// get list of categorised cookies
|
|
344
|
-
const analyticsArr = analyticsCookies
|
|
345
|
-
const marketingArr = marketingCookies
|
|
346
322
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
var checkMarketing = false
|
|
323
|
+
if (this.showCookie && bannerDisplayed !== 'true') {
|
|
324
|
+
// Show the banner if it's not been displayed yet
|
|
325
|
+
console.log('** Show the banner if its not been displayed yet:-')
|
|
326
|
+
cookieElement.classList.remove('hide')
|
|
327
|
+
cookieElement.classList.add('show')
|
|
328
|
+
} else {
|
|
329
|
+
// Hide the banner if user has already made a selection
|
|
330
|
+
console.log('** Hide the banner if user has already made a selection:-')
|
|
331
|
+
// need to remove cookies in rejected categories, but first hide cookie overlay
|
|
332
|
+
cookieElement.classList.add('hide')
|
|
333
|
+
cookieElement.classList.remove('show')
|
|
359
334
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
checkAnalytics = true
|
|
364
|
-
}
|
|
335
|
+
// get list of categorised cookies
|
|
336
|
+
const analyticsArr = analyticsCookies
|
|
337
|
+
const marketingArr = marketingCookies
|
|
365
338
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
339
|
+
// get list of cookies to process
|
|
340
|
+
var pairs = document.cookie.split(';')
|
|
341
|
+
var cookieArr = []
|
|
342
|
+
for (var i = 0; i < pairs.length; i++) {
|
|
343
|
+
var pair = pairs[i].split('=')
|
|
344
|
+
var nameVar = [pair[0].trim()]
|
|
345
|
+
cookieArr.push(nameVar[0])
|
|
346
|
+
}
|
|
347
|
+
// identify which categories to process, initialising variables to false
|
|
348
|
+
// will only be set to true if user has rejected any cookies
|
|
349
|
+
var checkAnalytics = false
|
|
350
|
+
var checkMarketing = false
|
|
351
|
+
|
|
352
|
+
// get value of consent cookies to determine if cookies have to be removed
|
|
353
|
+
var analyticsValue = localStorage.getItem('analyticsCookies')
|
|
354
|
+
if (analyticsValue !== null && analyticsValue === 'denied') {
|
|
355
|
+
checkAnalytics = true
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
var marketingValue = localStorage.getItem('marketingCookies')
|
|
359
|
+
if (marketingValue !== null && marketingValue === 'denied') {
|
|
360
|
+
checkMarketing = true
|
|
361
|
+
}
|
|
370
362
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
363
|
+
// Remove analytics cookies stored as cookies or localStorage
|
|
364
|
+
if (checkAnalytics) {
|
|
365
|
+
analyticsArr.forEach((cookieName) => {
|
|
366
|
+
if (cookieName.name.slice(-1) === '*') {
|
|
367
|
+
var tmpVar = cookieName.name.slice(0, -1)
|
|
368
|
+
this.removeLocalStorage(tmpVar)
|
|
369
|
+
var tmpArr = cookieArr.filter((x) => x.match(cookieName.name))
|
|
370
|
+
tmpArr.forEach((tmpName) => {
|
|
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)
|
|
379
382
|
document.cookie =
|
|
380
|
-
|
|
383
|
+
cookieName.name +
|
|
381
384
|
'=;expires=' +
|
|
382
385
|
new Date(0).toUTCString() +
|
|
383
386
|
';domain=' +
|
|
384
387
|
cookieName.domain +
|
|
385
388
|
';path=' +
|
|
386
389
|
cookieName.path
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
390
|
+
}
|
|
391
|
+
})
|
|
392
|
+
}
|
|
393
|
+
// Remove marketing cookies stored as cookies or localStorage
|
|
394
|
+
if (checkMarketing) {
|
|
395
|
+
marketingArr.forEach((cookieName) => {
|
|
396
|
+
if (cookieName.name.slice(-1) === '*') {
|
|
397
|
+
var tmpVar = cookieName.name.slice(0, -1)
|
|
398
|
+
this.removeLocalStorage(tmpVar)
|
|
399
|
+
var tmpArr = cookieArr.filter((x) => x.match(cookieName.name))
|
|
400
|
+
tmpArr.forEach((tmpName) => {
|
|
401
|
+
document.cookie =
|
|
402
|
+
tmpName +
|
|
403
|
+
'=;expires=' +
|
|
404
|
+
new Date(0).toUTCString() +
|
|
405
|
+
';domain=' +
|
|
406
|
+
cookieName.domain +
|
|
407
|
+
';path=' +
|
|
408
|
+
cookieName.path
|
|
409
|
+
})
|
|
410
|
+
} else {
|
|
411
|
+
localStorage.removeItem(cookieName.name)
|
|
409
412
|
document.cookie =
|
|
410
|
-
|
|
413
|
+
cookieName.name +
|
|
411
414
|
'=;expires=' +
|
|
412
415
|
new Date(0).toUTCString() +
|
|
413
416
|
';domain=' +
|
|
414
417
|
cookieName.domain +
|
|
415
418
|
';path=' +
|
|
416
419
|
cookieName.path
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
document.cookie =
|
|
421
|
-
cookieName.name +
|
|
422
|
-
'=;expires=' +
|
|
423
|
-
new Date(0).toUTCString() +
|
|
424
|
-
';domain=' +
|
|
425
|
-
cookieName.domain +
|
|
426
|
-
';path=' +
|
|
427
|
-
cookieName.path
|
|
428
|
-
}
|
|
429
|
-
})
|
|
420
|
+
}
|
|
421
|
+
})
|
|
422
|
+
}
|
|
430
423
|
}
|
|
431
|
-
|
|
424
|
+
|
|
432
425
|
}
|
|
433
426
|
}
|
|
434
427
|
}
|
|
@@ -69,6 +69,12 @@ export default {
|
|
|
69
69
|
displayGlobal: false,
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
+
computed: {
|
|
73
|
+
showGlobalNotice() {
|
|
74
|
+
//Check first if SHOW_GLOBAL_NOTICE have been turned on in the environment variable
|
|
75
|
+
return process.env.SHOW_GLOBAL_NOTICE === false ? false : true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
72
78
|
mounted() {
|
|
73
79
|
window.addEventListener('load', this.checkPage())
|
|
74
80
|
},
|
|
@@ -89,12 +95,16 @@ export default {
|
|
|
89
95
|
this.setCookie()
|
|
90
96
|
this.displayGlobal = false
|
|
91
97
|
} else if (typeof window !== 'undefined') {
|
|
98
|
+
console.log('**else this.showGlobalNotice:-', this.showGlobalNotice)
|
|
99
|
+
console.log('**else tocalStorage.getItem(globalModalHidden):-', localStorage.getItem('globalModalHidden'))
|
|
100
|
+
|
|
92
101
|
this.displayGlobal =
|
|
93
|
-
|
|
102
|
+
this.showGlobalNotice === true &&
|
|
94
103
|
!localStorage.getItem('globalModalHidden')
|
|
95
104
|
} else {
|
|
96
|
-
this.displayGlobal = process.env.SHOW_GLOBAL_NOTICE ===
|
|
105
|
+
this.displayGlobal = process.env.SHOW_GLOBAL_NOTICE === true
|
|
97
106
|
}
|
|
107
|
+
console.log('**this.displayGlobal:- ', this.displayGlobal)
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
110
|
}
|
|
@@ -104,6 +114,17 @@ export default {
|
|
|
104
114
|
@import '../../../includes/scss/all';
|
|
105
115
|
|
|
106
116
|
// modal and modal backdrop styles required in order to display the overlay behind the modal
|
|
117
|
+
#global-notice-modal {
|
|
118
|
+
.modal-dialog-centered {
|
|
119
|
+
border-radius: 6px !important;
|
|
120
|
+
// box-shadow: 0 0 16px 8px rgba(0, 0, 0, 0.24) !important;
|
|
121
|
+
left: 50%;
|
|
122
|
+
margin-left: -200px;
|
|
123
|
+
margin-top: -240px;
|
|
124
|
+
top: 50%;
|
|
125
|
+
width: 400px !important;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
107
128
|
|
|
108
129
|
.modal {
|
|
109
130
|
background: rgba(0,0,0,0.5)
|
|
@@ -26,7 +26,8 @@ export class AddresseFormElement extends BaseFormElement {
|
|
|
26
26
|
key,
|
|
27
27
|
type: 'textfield',
|
|
28
28
|
input: true,
|
|
29
|
-
customConditional:
|
|
29
|
+
customConditional:
|
|
30
|
+
"show = _.get(instance, 'parent.manualMode', false);",
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -40,23 +41,27 @@ export class AddresseFormElement extends BaseFormElement {
|
|
|
40
41
|
|
|
41
42
|
getCustomProperties() {
|
|
42
43
|
const autoCompletePath = '/places/api/v1/place/autocomplete/json'
|
|
43
|
-
|
|
44
|
+
// Uses WorkSafe PROD API for storybook site (ensure site is white listed)
|
|
45
|
+
const baseUrl =
|
|
46
|
+
window.origin.toLowerCase().indexOf('worksafe') === -1
|
|
47
|
+
? 'https://www.worksafe.vic.gov.au'
|
|
48
|
+
: window.origin
|
|
44
49
|
return {
|
|
45
50
|
provider: 'custom',
|
|
46
51
|
enableManualMode: this.webformElement['#flexbox'] !== '0',
|
|
47
52
|
providerOptions: {
|
|
48
53
|
params: {
|
|
49
54
|
types: this.isFullAddressSearch() ? 'address' : '(regions)',
|
|
50
|
-
components: 'country:au'
|
|
55
|
+
components: 'country:au',
|
|
51
56
|
},
|
|
52
57
|
url: `${baseUrl}${autoCompletePath}`,
|
|
53
58
|
queryProperty: 'input',
|
|
54
59
|
displayValueProperty: 'description',
|
|
55
|
-
responseProperty: 'predictions'
|
|
60
|
+
responseProperty: 'predictions',
|
|
56
61
|
},
|
|
57
62
|
switchToManualModeLabel: "Can't find address? Switch to manual mode.",
|
|
58
63
|
input: true,
|
|
59
|
-
components: this.getManualFields()
|
|
64
|
+
components: this.getManualFields(),
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -70,7 +75,7 @@ export class AddresseFormElement extends BaseFormElement {
|
|
|
70
75
|
if (isAutoComplete) {
|
|
71
76
|
const getVal = (key) =>
|
|
72
77
|
value?.geocode?.address_components.find(
|
|
73
|
-
(item) => item?.types?.[0] === key
|
|
78
|
+
(item) => item?.types?.[0] === key,
|
|
74
79
|
)?.long_name
|
|
75
80
|
const address1 = getComponents('address')
|
|
76
81
|
const city = getComponents('city')
|
|
@@ -84,12 +89,12 @@ export class AddresseFormElement extends BaseFormElement {
|
|
|
84
89
|
[city?.key]: getVal('locality'),
|
|
85
90
|
[state?.key]: getVal('administrative_area_level_1'),
|
|
86
91
|
[postcode?.key]: getVal('postal_code'),
|
|
87
|
-
[country?.key]: getVal('country')
|
|
88
|
-
}
|
|
92
|
+
[country?.key]: getVal('country'),
|
|
93
|
+
},
|
|
89
94
|
}
|
|
90
95
|
} else if (value.mode === 'manual') {
|
|
91
96
|
return {
|
|
92
|
-
[this.getKey()]: value.address
|
|
97
|
+
[this.getKey()]: value.address,
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
100
|
}
|
|
@@ -106,7 +111,11 @@ export class AddresseFormElement extends BaseFormElement {
|
|
|
106
111
|
value.geocode.formatted_address !== value.address.description)
|
|
107
112
|
) {
|
|
108
113
|
const geocodePath = '/places/api/v1/geocode/json'
|
|
109
|
-
|
|
114
|
+
// Uses WorkSafe PROD API for storybook site (ensure site is white listed)
|
|
115
|
+
const baseUrl =
|
|
116
|
+
window.origin.toLowerCase().indexOf('worksafe') === -1
|
|
117
|
+
? 'https://www.worksafe.vic.gov.au'
|
|
118
|
+
: window.origin
|
|
110
119
|
const qs = `?place_id=${value.address.place_id}`
|
|
111
120
|
const url = `${baseUrl}${geocodePath}${qs}`
|
|
112
121
|
|
|
@@ -114,11 +123,11 @@ export class AddresseFormElement extends BaseFormElement {
|
|
|
114
123
|
const results = response?.data?.results
|
|
115
124
|
if (Array.isArray(results) && results.length > 0) {
|
|
116
125
|
const postcode = results[0].address_components.find((item) =>
|
|
117
|
-
item.types.find((type) => type === 'postal_code')
|
|
126
|
+
item.types.find((type) => type === 'postal_code'),
|
|
118
127
|
)?.short_name
|
|
119
128
|
const fullAddress = value.address.description.replace(
|
|
120
129
|
/,(?=[^,]*$)/,
|
|
121
|
-
`, ${postcode}
|
|
130
|
+
`, ${postcode}`,
|
|
122
131
|
)
|
|
123
132
|
value.address.description = fullAddress
|
|
124
133
|
value.geocode = results[0]
|
|
@@ -18,7 +18,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
18
18
|
key: 'address',
|
|
19
19
|
label: 'Address',
|
|
20
20
|
tableView: false,
|
|
21
|
-
type: 'textfield'
|
|
21
|
+
type: 'textfield',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
customConditional:
|
|
@@ -27,7 +27,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
27
27
|
key: 'address_2',
|
|
28
28
|
label: 'Address 2',
|
|
29
29
|
tableView: false,
|
|
30
|
-
type: 'textfield'
|
|
30
|
+
type: 'textfield',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
customConditional:
|
|
@@ -36,7 +36,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
36
36
|
key: 'city',
|
|
37
37
|
label: 'Suburb',
|
|
38
38
|
tableView: false,
|
|
39
|
-
type: 'textfield'
|
|
39
|
+
type: 'textfield',
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
customConditional:
|
|
@@ -45,7 +45,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
45
45
|
key: 'state_province',
|
|
46
46
|
label: 'State',
|
|
47
47
|
tableView: false,
|
|
48
|
-
type: 'textfield'
|
|
48
|
+
type: 'textfield',
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
customConditional:
|
|
@@ -54,7 +54,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
54
54
|
key: 'postal_code',
|
|
55
55
|
label: 'Postcode',
|
|
56
56
|
tableView: false,
|
|
57
|
-
type: 'textfield'
|
|
57
|
+
type: 'textfield',
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
customConditional:
|
|
@@ -63,8 +63,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
63
63
|
key: 'country',
|
|
64
64
|
label: 'Country',
|
|
65
65
|
tableView: false,
|
|
66
|
-
type: 'textfield'
|
|
67
|
-
}
|
|
66
|
+
type: 'textfield',
|
|
67
|
+
},
|
|
68
68
|
],
|
|
69
69
|
customClass: 'custom-formio-1',
|
|
70
70
|
defaultValue: {
|
|
@@ -73,7 +73,7 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
73
73
|
city: '',
|
|
74
74
|
country: '',
|
|
75
75
|
postal_code: '',
|
|
76
|
-
state_province: ''
|
|
76
|
+
state_province: '',
|
|
77
77
|
},
|
|
78
78
|
disabled: false,
|
|
79
79
|
enableManualMode: true,
|
|
@@ -89,13 +89,13 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
89
89
|
params: { components: 'country:au', types: 'address' },
|
|
90
90
|
queryProperty: 'input',
|
|
91
91
|
responseProperty: 'predictions',
|
|
92
|
-
url: '
|
|
92
|
+
url: 'https://www.worksafe.vic.gov.au/places/api/v1/place/autocomplete/json',
|
|
93
93
|
},
|
|
94
94
|
switchToManualModeLabel: "Can't find address? Switch to manual mode.",
|
|
95
95
|
type: 'address',
|
|
96
|
-
validate: { required: false }
|
|
97
|
-
}
|
|
98
|
-
])
|
|
96
|
+
validate: { required: false },
|
|
97
|
+
},
|
|
98
|
+
]),
|
|
99
99
|
)
|
|
100
100
|
})
|
|
101
101
|
|
|
@@ -108,8 +108,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
108
108
|
city: 'sd',
|
|
109
109
|
state_province: 'sd',
|
|
110
110
|
postal_code: 'sd',
|
|
111
|
-
country: 'sds'
|
|
112
|
-
}
|
|
111
|
+
country: 'sds',
|
|
112
|
+
},
|
|
113
113
|
})
|
|
114
114
|
expect(submission).toEqual({
|
|
115
115
|
address1: {
|
|
@@ -118,8 +118,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
118
118
|
city: 'sd',
|
|
119
119
|
country: 'sds',
|
|
120
120
|
postal_code: 'sd',
|
|
121
|
-
state_province: 'sd'
|
|
122
|
-
}
|
|
121
|
+
state_province: 'sd',
|
|
122
|
+
},
|
|
123
123
|
})
|
|
124
124
|
})
|
|
125
125
|
|
|
@@ -131,12 +131,12 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
131
131
|
matched_substrings: [
|
|
132
132
|
{
|
|
133
133
|
length: 3,
|
|
134
|
-
offset: 0
|
|
134
|
+
offset: 0,
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
length: 3,
|
|
138
|
-
offset: 4
|
|
139
|
-
}
|
|
138
|
+
offset: 4,
|
|
139
|
+
},
|
|
140
140
|
],
|
|
141
141
|
place_id: 'ChIJe_yY7VRD1moR4FaCIXpujzc',
|
|
142
142
|
reference: 'ChIJe_yY7VRD1moR4FaCIXpujzc',
|
|
@@ -145,102 +145,102 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
145
145
|
main_text_matched_substrings: [
|
|
146
146
|
{
|
|
147
147
|
length: 3,
|
|
148
|
-
offset: 0
|
|
148
|
+
offset: 0,
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
length: 3,
|
|
152
|
-
offset: 4
|
|
153
|
-
}
|
|
152
|
+
offset: 4,
|
|
153
|
+
},
|
|
154
154
|
],
|
|
155
|
-
secondary_text: 'Brunswick VIC, Australia'
|
|
155
|
+
secondary_text: 'Brunswick VIC, Australia',
|
|
156
156
|
},
|
|
157
157
|
terms: [
|
|
158
158
|
{
|
|
159
159
|
offset: 0,
|
|
160
|
-
value: '715'
|
|
160
|
+
value: '715',
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
offset: 4,
|
|
164
|
-
value: 'Sydney Road'
|
|
164
|
+
value: 'Sydney Road',
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
offset: 17,
|
|
168
|
-
value: 'Brunswick'
|
|
168
|
+
value: 'Brunswick',
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
171
|
offset: 27,
|
|
172
|
-
value: 'VIC'
|
|
172
|
+
value: 'VIC',
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
offset: 32,
|
|
176
|
-
value: 'Australia'
|
|
177
|
-
}
|
|
176
|
+
value: 'Australia',
|
|
177
|
+
},
|
|
178
178
|
],
|
|
179
|
-
types: ['street_address', 'geocode']
|
|
179
|
+
types: ['street_address', 'geocode'],
|
|
180
180
|
},
|
|
181
181
|
geocode: {
|
|
182
182
|
address_components: [
|
|
183
183
|
{
|
|
184
184
|
long_name: '715',
|
|
185
185
|
short_name: '715',
|
|
186
|
-
types: ['street_number']
|
|
186
|
+
types: ['street_number'],
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
long_name: 'Sydney Road',
|
|
190
190
|
short_name: 'Sydney Rd',
|
|
191
|
-
types: ['route']
|
|
191
|
+
types: ['route'],
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
long_name: 'Brunswick',
|
|
195
195
|
short_name: 'Brunswick',
|
|
196
|
-
types: ['locality', 'political']
|
|
196
|
+
types: ['locality', 'political'],
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
long_name: 'Moreland City',
|
|
200
200
|
short_name: 'Moreland',
|
|
201
|
-
types: ['administrative_area_level_2', 'political']
|
|
201
|
+
types: ['administrative_area_level_2', 'political'],
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
long_name: 'Victoria',
|
|
205
205
|
short_name: 'VIC',
|
|
206
|
-
types: ['administrative_area_level_1', 'political']
|
|
206
|
+
types: ['administrative_area_level_1', 'political'],
|
|
207
207
|
},
|
|
208
208
|
{
|
|
209
209
|
long_name: 'Australia',
|
|
210
210
|
short_name: 'AU',
|
|
211
|
-
types: ['country', 'political']
|
|
211
|
+
types: ['country', 'political'],
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
long_name: '3056',
|
|
215
215
|
short_name: '3056',
|
|
216
|
-
types: ['postal_code']
|
|
217
|
-
}
|
|
216
|
+
types: ['postal_code'],
|
|
217
|
+
},
|
|
218
218
|
],
|
|
219
219
|
formatted_address: '715 Sydney Rd, Brunswick VIC 3056, Australia',
|
|
220
220
|
geometry: {
|
|
221
221
|
location: {
|
|
222
222
|
lat: -37.7598676,
|
|
223
|
-
lng: 144.9631721
|
|
223
|
+
lng: 144.9631721,
|
|
224
224
|
},
|
|
225
225
|
location_type: 'ROOFTOP',
|
|
226
226
|
viewport: {
|
|
227
227
|
northeast: {
|
|
228
228
|
lat: -37.75852881970849,
|
|
229
|
-
lng: 144.9646129302915
|
|
229
|
+
lng: 144.9646129302915,
|
|
230
230
|
},
|
|
231
231
|
southwest: {
|
|
232
232
|
lat: -37.76122678029149,
|
|
233
|
-
lng: 144.9619149697085
|
|
234
|
-
}
|
|
235
|
-
}
|
|
233
|
+
lng: 144.9619149697085,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
236
|
},
|
|
237
237
|
place_id: 'ChIJe_yY7VRD1moR4FaCIXpujzc',
|
|
238
238
|
plus_code: {
|
|
239
239
|
compound_code: '6XR7+37 Brunswick VIC, Australia',
|
|
240
|
-
global_code: '4RJ66XR7+37'
|
|
240
|
+
global_code: '4RJ66XR7+37',
|
|
241
241
|
},
|
|
242
|
-
types: ['street_address']
|
|
243
|
-
}
|
|
242
|
+
types: ['street_address'],
|
|
243
|
+
},
|
|
244
244
|
})
|
|
245
245
|
expect(submission).toEqual({
|
|
246
246
|
address1: {
|
|
@@ -248,8 +248,8 @@ describe(`Form ${testComponent} parser`, () => {
|
|
|
248
248
|
city: 'Brunswick',
|
|
249
249
|
country: 'Australia',
|
|
250
250
|
postal_code: '3056',
|
|
251
|
-
state_province: 'Victoria'
|
|
252
|
-
}
|
|
251
|
+
state_province: 'Victoria',
|
|
252
|
+
},
|
|
253
253
|
})
|
|
254
254
|
})
|
|
255
255
|
})
|
|
@@ -1,120 +1,122 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<template
|
|
17
|
-
v-if="enableBundleFilter && bundle.length > 1"
|
|
18
|
-
v-slot:gridHeaderRight
|
|
2
|
+
<div>
|
|
3
|
+
<card-grid
|
|
4
|
+
:title="title"
|
|
5
|
+
:title-tag="titleTag"
|
|
6
|
+
:cards="displayedCards"
|
|
7
|
+
:rtl="rtl"
|
|
8
|
+
:force-lg-columns-per-row="columns"
|
|
9
|
+
:force-md-columns-per-row="columns"
|
|
10
|
+
:force-sm-columns-per-row="columns"
|
|
11
|
+
:is-selectable="false"
|
|
12
|
+
:row-spacing="'large'"
|
|
13
|
+
:class="[`card_group--${background}`, `card_group--${cardResourseType}`]"
|
|
14
|
+
:background-variant="background"
|
|
15
|
+
@selected="selectedCard"
|
|
19
16
|
>
|
|
20
|
-
<
|
|
21
|
-
v-if="enableBundleFilter"
|
|
22
|
-
:
|
|
23
|
-
class="card_group__switcher"
|
|
24
|
-
:get-option-alias="getBundleAlias"
|
|
25
|
-
@switched="onSwitcher"
|
|
26
|
-
@reset="onSwitcher"
|
|
27
|
-
/>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<template v-if="filters.taxonomies.length > 0" v-slot:gridPreContent>
|
|
31
|
-
<directory-filters
|
|
32
|
-
class="card_group__filter"
|
|
33
|
-
:filters="filters"
|
|
34
|
-
:results="allCards.total"
|
|
35
|
-
:is-filtering="loader"
|
|
36
|
-
@onFilter="onFilter"
|
|
37
|
-
@onReset="reset"
|
|
38
|
-
/>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<template v-slot:cardItem="{ card }">
|
|
42
|
-
<card-grid-item
|
|
43
|
-
v-if="card"
|
|
44
|
-
:show-divider="false"
|
|
45
|
-
:header-size="'large'"
|
|
46
|
-
class="card_group__card"
|
|
47
|
-
:class="{
|
|
48
|
-
[`card_group__card--${card.colour}`]: card.pillText,
|
|
49
|
-
[`card_group__card--none`]: !card.pillText,
|
|
50
|
-
[`card_group__card--${cardResourseType}`]:
|
|
51
|
-
'card_group__card--resourse-group',
|
|
52
|
-
}"
|
|
53
|
-
:card-header-title="card.title"
|
|
54
|
-
:caret="getCaret(card)"
|
|
55
|
-
:description="card.description"
|
|
56
|
-
:card-padding="'none'"
|
|
57
|
-
:caret-position="'bottom'"
|
|
58
|
-
:rtl="card.rtl"
|
|
59
|
-
:border-type="background === 'white' ? 'thick' : 'none'"
|
|
60
|
-
:pill-text="card.pillText"
|
|
61
|
-
:link="card.link ? card.link : false"
|
|
62
|
-
:taxonomies="{
|
|
63
|
-
industry: card.industry,
|
|
64
|
-
topic: card.topic,
|
|
65
|
-
language: card.language,
|
|
66
|
-
}"
|
|
17
|
+
<template
|
|
18
|
+
v-if="enableBundleFilter && bundle.length > 1"
|
|
19
|
+
v-slot:gridHeaderRight
|
|
67
20
|
>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
21
|
+
<switcher
|
|
22
|
+
v-if="enableBundleFilter"
|
|
23
|
+
:options="bundle"
|
|
24
|
+
class="card_group__switcher"
|
|
25
|
+
:get-option-alias="getBundleAlias"
|
|
26
|
+
@switched="onSwitcher"
|
|
27
|
+
@reset="onSwitcher"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
71
30
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
31
|
+
<template v-if="filters.taxonomies.length > 0" v-slot:gridPreContent>
|
|
32
|
+
<directory-filters
|
|
33
|
+
class="card_group__filter"
|
|
34
|
+
:filters="filters"
|
|
35
|
+
:results="allCards.total"
|
|
36
|
+
:is-filtering="loader"
|
|
37
|
+
@onFilter="onFilter"
|
|
38
|
+
@onReset="reset"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
75
41
|
|
|
76
|
-
|
|
77
|
-
<
|
|
78
|
-
v-if="
|
|
79
|
-
|
|
42
|
+
<template v-slot:cardItem="{ card }">
|
|
43
|
+
<card-grid-item
|
|
44
|
+
v-if="card"
|
|
45
|
+
:show-divider="false"
|
|
46
|
+
:header-size="'large'"
|
|
47
|
+
class="card_group__card"
|
|
48
|
+
:class="{
|
|
49
|
+
[`card_group__card--${card.colour}`]: card.pillText,
|
|
50
|
+
[`card_group__card--none`]: !card.pillText,
|
|
51
|
+
[`card_group__card--${cardResourseType}`]:
|
|
52
|
+
'card_group__card--resourse-group',
|
|
53
|
+
}"
|
|
54
|
+
:card-header-title="card.title"
|
|
55
|
+
:caret="getCaret(card)"
|
|
56
|
+
:description="card.description"
|
|
57
|
+
:card-padding="'none'"
|
|
58
|
+
:caret-position="'bottom'"
|
|
59
|
+
:rtl="card.rtl"
|
|
60
|
+
:border-type="background === 'white' ? 'thick' : 'none'"
|
|
61
|
+
:pill-text="card.pillText"
|
|
62
|
+
:link="card.link ? card.link : false"
|
|
63
|
+
:taxonomies="{
|
|
64
|
+
industry: card.industry,
|
|
65
|
+
topic: card.topic,
|
|
66
|
+
language: card.language,
|
|
67
|
+
}"
|
|
80
68
|
>
|
|
81
|
-
<
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</template>
|
|
69
|
+
<template v-slot:cardTop>
|
|
70
|
+
<card-top :card="card" :resource-type="cardResourseType" />
|
|
71
|
+
</template>
|
|
85
72
|
|
|
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
|
-
|
|
73
|
+
<template v-slot:cardDescription>
|
|
74
|
+
<card-body :card="card" :resource-type="cardResourseType" />
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<!-- footer - download button -->
|
|
78
|
+
<template
|
|
79
|
+
v-if="cardResourseType === 'resource-group'"
|
|
80
|
+
v-slot:cardFooter
|
|
81
|
+
>
|
|
82
|
+
<card-footer :card="card" :resource-type="cardResourseType" />
|
|
83
|
+
</template>
|
|
84
|
+
</card-grid-item>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<template
|
|
88
|
+
v-if="
|
|
89
|
+
loader ||
|
|
90
|
+
(displayedCards.length === 0 && !loader) ||
|
|
91
|
+
$slots.cardGroupFooter ||
|
|
92
|
+
(!loader && showLoadMore && hasMorePages)
|
|
93
|
+
"
|
|
94
|
+
v-slot:cardGridFooter
|
|
95
|
+
>
|
|
96
|
+
<column v-if="loader" sm="12">
|
|
97
|
+
<strong>Loading... </strong>
|
|
98
|
+
<b-spinner class="float-right"></b-spinner>
|
|
99
|
+
</column>
|
|
100
|
+
<column v-if="displayedCards.length === 0 && !loading" sm="12">
|
|
101
|
+
<strong>{{ emptyCardsText }}</strong>
|
|
102
|
+
</column>
|
|
103
|
+
<column v-if="$slots.cardGroupFooter" sm="12">
|
|
104
|
+
<slot name="cardGroupFooter"></slot>
|
|
105
|
+
</column>
|
|
106
|
+
<column v-if="!loader && showLoadMore" sm="12" class="text-center">
|
|
107
|
+
<cta-button
|
|
108
|
+
type="dark"
|
|
109
|
+
:focus-outline="'light'"
|
|
110
|
+
:text-only="true"
|
|
111
|
+
:is-centred="true"
|
|
112
|
+
:class="'card_group__loadmore mb-0'"
|
|
113
|
+
@clicked="handleLoadMore"
|
|
114
|
+
>Load more</cta-button
|
|
115
|
+
>
|
|
116
|
+
</column>
|
|
117
|
+
</template>
|
|
118
|
+
</card-grid>
|
|
119
|
+
</div>
|
|
118
120
|
</template>
|
|
119
121
|
|
|
120
122
|
<script>
|
package/vite.config.js
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
import { fileURLToPath, URL } from 'node:url'
|
|
2
2
|
import svgLoader from 'vite-svg-loader'
|
|
3
|
-
import { defineConfig } from 'vite'
|
|
3
|
+
import { defineConfig, loadEnv } from 'vite'
|
|
4
4
|
import vue from '@vitejs/plugin-vue'
|
|
5
5
|
|
|
6
6
|
// https://vitejs.dev/config/
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
export default defineConfig(({ command, mode }) => {
|
|
8
|
+
// Load env file based on `mode` in the current working directory.
|
|
9
|
+
// Set the third parameter to '' to load all env regardless of the `VITE_` prefix.
|
|
10
|
+
const env = loadEnv(mode, process.cwd(), '')
|
|
11
|
+
|
|
12
|
+
return{
|
|
13
|
+
css: {
|
|
14
|
+
preprocessorOptions: {
|
|
15
|
+
scss: {
|
|
16
|
+
api: 'modern-compiler', // or "modern", "legacy"
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
plugins: [
|
|
21
|
+
vue(), svgLoader()
|
|
22
|
+
],
|
|
23
|
+
resolve: {
|
|
24
|
+
alias: {
|
|
25
|
+
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
define: {
|
|
29
|
+
SHOW_COOKIE: JSON.stringify(env.SHOW_COOKIE),
|
|
30
|
+
'process.env.CONTENT_API_URL': `"${process.env.CONTENT_API_URL}"`,
|
|
31
|
+
'process.env.IS_STORYBOOK': `"${process.env.IS_STORYBOOK}"`,
|
|
32
|
+
'process.env.CARETAKER': `"${process.env.CARETAKER}"`,
|
|
33
|
+
'process.env.GOOGLE__URL': `"${process.env.GOOGLE__URL}"`
|
|
14
34
|
}
|
|
15
|
-
},
|
|
16
|
-
define: {
|
|
17
|
-
'process.env.SHOW_COOKIE': `"${process.env.SHOW_COOKIE}"`,
|
|
18
|
-
'process.env.CONTENT_API_URL': `"${process.env.CONTENT_API_URL}"`,
|
|
19
|
-
'process.env.IS_STORYBOOK': `"${process.env.IS_STORYBOOK}"`,
|
|
20
|
-
'process.env.CARETAKER': `"${process.env.CARETAKER}"`,
|
|
21
|
-
'process.env.SHOW_GLOBAL_NOTICE': `"${process.env.SHOW_GLOBAL_NOTICE}"`,
|
|
22
|
-
'process.env.GOOGLE__URL': `"${process.env.GOOGLE__URL}"`
|
|
23
35
|
}
|
|
24
36
|
})
|