@worksafevictoria/wcl7.5 1.5.0 → 1.6.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.
Files changed (81) hide show
  1. package/.storybook/preview.js +20 -13
  2. package/bin/deploy.sh +1 -1
  3. package/lib/utility.js +10 -8
  4. package/package.json +4 -4
  5. package/src/assets/icons/AppFooter/x-ws-footer.svg +10 -0
  6. package/src/assets/icons/AppFooter/x-ww-footer.svg +28 -0
  7. package/src/assets/icons/SocialShare/x-icon-white.svg +28 -0
  8. package/src/assets/styles/modal.scss +51 -0
  9. package/src/components/Common/CardGrid/index.vue +56 -51
  10. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +7 -4
  11. package/src/components/Common/CardGridItem/index.vue +77 -63
  12. package/src/components/Containers/Carousel/index.vue +14 -7
  13. package/src/components/Containers/HomepageHeader/index.stories.js +60 -36
  14. package/src/components/Containers/HomepageHeader/index.vue +2 -26
  15. package/src/components/Containers/HomepageHeaderNew/index.stories.js +15 -15
  16. package/src/components/Containers/HomepageHeaderNew/index.vue +97 -68
  17. package/src/components/Containers/SectionGroup/index.vue +1 -1
  18. package/src/components/Containers/Subheader/index.vue +5 -1
  19. package/src/components/Global/AppFooter/FooterSocialShare/index.vue +1 -1
  20. package/src/components/Global/AppFooter/index.vue +14 -7
  21. package/src/components/Global/AppHeaderNew/styles.scss +10 -15
  22. package/src/components/Global/BackToTop/index.vue +8 -8
  23. package/src/components/Global/Cookies/index.stories.js +16 -10
  24. package/src/components/Global/Cookies/index.vue +280 -243
  25. package/src/components/Global/Cookies/styles.scss +54 -54
  26. package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +50 -133
  27. package/src/components/Global/GlobalNotice/index.vue +79 -100
  28. package/src/components/Global/SocialShare/index.vue +1 -1
  29. package/src/components/Global/Strip/index.vue +1 -1
  30. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +8 -4
  31. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +23 -23
  32. package/src/components/Paragraphs/Accordion/index.stories.js +21 -18
  33. package/src/components/Paragraphs/Accordion/index.vue +52 -48
  34. package/src/components/Paragraphs/BrowseContent/index.vue +1 -1
  35. package/src/components/Paragraphs/BrowseContent/setup.vue +284 -0
  36. package/src/components/Paragraphs/Chart/Constants.js +485 -485
  37. package/src/components/Paragraphs/Chart/index.vue +232 -241
  38. package/src/components/Paragraphs/Directory/Records/HSCP/index.stories.js +33 -0
  39. package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +334 -0
  40. package/src/components/Paragraphs/Directory/Records/index.vue +63 -27
  41. package/src/components/Paragraphs/Directory/Records/styles.scss +1 -0
  42. package/src/components/Paragraphs/Directory/constants.js +23 -5
  43. package/src/components/Paragraphs/Directory/index.vue +14 -14
  44. package/src/components/Paragraphs/ListGroup/index.vue +5 -1
  45. package/src/components/Paragraphs/ScrollSpy/index.vue +23 -14
  46. package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
  47. package/src/components/Paragraphs/TabbedCards/index.vue +13 -14
  48. package/src/components/Paragraphs/Tabs/index.vue +19 -17
  49. package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +9 -9
  50. package/src/components/Paragraphs/TextMedia/index.vue +20 -16
  51. package/src/components/Paragraphs/VideoGrid/index.stories.js +43 -19
  52. package/src/components/Paragraphs/VideoGrid/index.vue +13 -13
  53. package/src/components/Paragraphs/Webform/index.stories.js +82 -69
  54. package/src/components/SubComponents/CardGroup/index.vue +5 -1
  55. package/src/components/SubComponents/FormAddressPostcode/index.vue +35 -37
  56. package/src/components/SubComponents/FormInstance/components/handler/index.vue +25 -29
  57. package/src/components/SubComponents/FormInstance/components/renderer/index.vue +63 -28
  58. package/src/components/SubComponents/FormInstance/models/overrides/file.js +33 -40
  59. package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +22 -15
  60. package/src/components/SubComponents/FormInstance/services/registry-factory.js +1 -1
  61. package/src/components/SubComponents/FormInstance/stories/fileupload.stories.js +57 -0
  62. package/src/components/SubComponents/FormInstance/stories/mocks/fileupload.json +25 -0
  63. package/src/components/SubComponents/FormInstance/style.scss +2 -2
  64. package/src/components/SubComponents/FormInstance/tests/address.test.js +4 -4
  65. package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +7 -7
  66. package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +15 -15
  67. package/src/components/SubComponents/FormInstance/tests/date.test.js +8 -8
  68. package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +9 -9
  69. package/src/components/SubComponents/FormInstance/tests/multiple.test.js +13 -13
  70. package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +120 -120
  71. package/src/components/SubComponents/FormInstance/tests/scale.test.js +6 -6
  72. package/src/components/SubComponents/FormInstance/tests/url.test.js +13 -10
  73. package/src/components/SubComponents/Pagination/index.vue +19 -18
  74. package/src/components/SubComponents/ResourceGroup/index.vue +5 -1
  75. package/src/components/SubComponents/Search/SearchListing/index.vue +20 -20
  76. package/src/components/SubComponents/Search/index.vue +35 -33
  77. package/src/components/SubComponents/VideoThumbnail/index.vue +48 -133
  78. package/src/includes/scss/vars/src/colors.module.scss +28 -1
  79. package/src/index.js +21 -3
  80. package/src/main.js +2 -10
  81. package/src/mock/carousel-items.js +71 -46
@@ -33,8 +33,8 @@
33
33
  [`card-grid-item__control-radio`]:
34
34
  isSelectable && buttonRole === 'radio',
35
35
  [`card-grid-item__selected-radio`]:
36
- selected && buttonRole === 'radio'
37
- }
36
+ selected && buttonRole === 'radio',
37
+ },
38
38
  ]"
39
39
  >
40
40
  <slot name="cardTop"></slot>
@@ -52,7 +52,7 @@
52
52
  :icon-is-bordered="iconIsBordered"
53
53
  :class="{
54
54
  [`text-left`]: iconPosition === 'top-left',
55
- rtl: rtl
55
+ rtl: rtl,
56
56
  }"
57
57
  >
58
58
  </card-grid-item-icon>
@@ -63,8 +63,8 @@
63
63
  {
64
64
  rtl: rtl,
65
65
  [`card-grid-item__caretContainer__control-radio`]:
66
- isSelectable && buttonRole === 'radio'
67
- }
66
+ isSelectable && buttonRole === 'radio',
67
+ },
68
68
  ]"
69
69
  >
70
70
  <b-card-title
@@ -74,7 +74,7 @@
74
74
  :class="{
75
75
  [`card-grid-item__header--${headerSize}`]: true,
76
76
  [`card-grid-item__header--align-${headerTextAlign}`]: true,
77
- 'card-grid-item__header--cursor': isCardTitleSelectable
77
+ 'card-grid-item__header--cursor': isCardTitleSelectable,
78
78
  }"
79
79
  @click="cardTitleClicked($event)"
80
80
  >
@@ -122,7 +122,7 @@
122
122
  class="d-inline card-grid-item-icon--top-right"
123
123
  :class="{
124
124
  [`text-right`]: iconPosition === 'top-right',
125
- rtl: rtl
125
+ rtl: rtl,
126
126
  }"
127
127
  :rtl="rtl"
128
128
  >
@@ -134,7 +134,7 @@
134
134
  text-tag="div"
135
135
  class="card-grid-item__body"
136
136
  :class="{
137
- rtl: rtl
137
+ rtl: rtl,
138
138
  }"
139
139
  >
140
140
  <div
@@ -142,7 +142,7 @@
142
142
  :class="{
143
143
  [descriptionClass]: !!descriptionClass,
144
144
  [`card-grid-item__description--withIcon`]:
145
- iconPosition === 'before-description'
145
+ iconPosition === 'before-description',
146
146
  }"
147
147
  >
148
148
  <card-grid-item-icon
@@ -181,7 +181,7 @@
181
181
  v-if="caretPosition === 'bottom'"
182
182
  class="card-grid-item__caretContainer card-grid-item__caretContainer--bottom"
183
183
  :class="{
184
- rtl: !rtl
184
+ rtl: !rtl,
185
185
  }"
186
186
  >
187
187
  <card-grid-item-caret :caret="caret" :rtl="rtl" />
@@ -196,52 +196,60 @@
196
196
  import CardGridItemIcon from './card-grid-item-icon.vue'
197
197
  import CardGridItemCaret from './card-grid-item-caret.vue'
198
198
  import RichText from '../../Paragraphs/RichText/index.vue'
199
- import parseISO from 'date-fns/parseISO'
199
+ import { parseISO } from 'date-fns'
200
200
  import { isAbsoluteUrl, isGovSite } from '../../../../lib/utility'
201
201
  import { BCard, BCardBody, BCardTitle, BCardText } from 'bootstrap-vue-next'
202
202
 
203
203
  export default {
204
204
  name: 'CardGridItem',
205
- components: {CardGridItemIcon, CardGridItemCaret, RichText, BCard, BCardBody, BCardTitle, BCardText },
205
+ components: {
206
+ CardGridItemIcon,
207
+ CardGridItemCaret,
208
+ RichText,
209
+ BCard,
210
+ BCardBody,
211
+ BCardTitle,
212
+ BCardText,
213
+ },
206
214
  props: {
207
215
  backgroundVariant: {
208
216
  type: String,
209
217
  default: 'white',
210
218
  validator: (value) =>
211
- ['white', 'transparent', 'light'].indexOf(value) >= 0
219
+ ['white', 'transparent', 'light'].indexOf(value) >= 0,
212
220
  },
213
221
  imageSrc: {
214
222
  type: String,
215
- default: null
223
+ default: null,
216
224
  },
217
225
  imageAlt: {
218
226
  type: String,
219
- default: null
227
+ default: null,
220
228
  },
221
229
  description: {
222
230
  type: String,
223
- default: null
231
+ default: null,
224
232
  },
225
233
  stripDescriptionHtml: {
226
- type: Boolean
234
+ type: Boolean,
227
235
  },
228
236
  descriptionClass: {
229
237
  type: String,
230
- default: ''
238
+ default: '',
231
239
  },
232
240
  glyphSrc: {
233
241
  type: [Object, String],
234
- default: null
242
+ default: null,
235
243
  },
236
244
  glyphIconComponent: {
237
245
  type: String,
238
- default: null
246
+ default: null,
239
247
  },
240
248
  iconSize: {
241
249
  type: String,
242
250
  default: 'small',
243
251
  validator: (value) =>
244
- ['xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0
252
+ ['xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0,
245
253
  },
246
254
  iconPosition: {
247
255
  type: String,
@@ -252,112 +260,113 @@ export default {
252
260
  'top-left',
253
261
  'top-right',
254
262
  'after-title',
255
- 'before-description'
256
- ].indexOf(value) >= 0
263
+ 'before-description',
264
+ ].indexOf(value) >= 0,
257
265
  },
258
266
  iconIsBordered: {
259
267
  type: Boolean,
260
- default: true
268
+ default: true,
261
269
  },
262
270
  showDivider: {
263
- type: Boolean
271
+ type: Boolean,
264
272
  },
265
273
  cardHeaderTitle: {
266
274
  type: String,
267
- default: null
275
+ default: null,
268
276
  },
269
277
  invertOnSelectBackground: {
270
278
  type: String,
271
279
  default: 'none',
272
- validator: (value) => ['none', 'yellow', 'black'].indexOf(value) >= 0
280
+ validator: (value) => ['none', 'yellow', 'black'].indexOf(value) >= 0,
273
281
  },
274
282
  borderOnSelectBackground: {
275
283
  type: String,
276
284
  default: 'none',
277
285
  validator: (value) =>
278
- ['none', 'yellow', 'black', 'blue'].indexOf(value) >= 0
286
+ ['none', 'yellow', 'black', 'blue'].indexOf(value) >= 0,
279
287
  },
280
288
  rtl: {
281
289
  type: Boolean,
282
- default: false
290
+ default: false,
283
291
  },
284
292
  headerSize: {
285
293
  type: String,
286
294
  default: 'custom',
287
295
  validator: (value) =>
288
296
  ['medium', 'large', 'extra-large', 'extra-2x-large', 'custom'].indexOf(
289
- value
290
- ) >= 0
297
+ value,
298
+ ) >= 0,
291
299
  },
292
300
  headerTextAlign: {
293
301
  type: String,
294
302
  default: 'left',
295
- validator: (value) => ['left', 'center', 'right'].indexOf(value) >= 0
303
+ validator: (value) => ['left', 'center', 'right'].indexOf(value) >= 0,
296
304
  },
297
305
  headerTag: {
298
306
  type: String,
299
307
  required: false,
300
- default: 'h3'
308
+ default: 'h3',
301
309
  },
302
310
  caret: {
303
311
  type: String,
304
312
  default: undefined,
305
313
  validator: (value) =>
306
- ['down', 'up', 'right', 'left', 'external'].indexOf(value) >= 0
314
+ ['down', 'up', 'right', 'left', 'external'].indexOf(value) >= 0,
307
315
  },
308
316
  caretPosition: {
309
317
  type: String,
310
318
  default: 'top',
311
- validator: (value) => ['top', 'bottom', 'after-title'].indexOf(value) >= 0
319
+ validator: (value) =>
320
+ ['top', 'bottom', 'after-title'].indexOf(value) >= 0,
312
321
  },
313
322
  cardPadding: {
314
323
  type: String,
315
324
  default: 'none',
316
325
  validator: (value) =>
317
- ['none', 'xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0
326
+ ['none', 'xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0,
318
327
  },
319
328
  borderType: {
320
329
  type: String,
321
330
  default: 'none',
322
331
  validator: (value) =>
323
- ['none', 'thin', 'shadow', 'thick', 'dark'].indexOf(value) >= 0
332
+ ['none', 'thin', 'shadow', 'thick', 'dark'].indexOf(value) >= 0,
324
333
  },
325
334
  cardTextAlign: {
326
335
  type: String,
327
- default: 'left'
336
+ default: 'left',
328
337
  },
329
338
  disableSelect: {
330
339
  type: Boolean,
331
- default: false
340
+ default: false,
332
341
  },
333
342
  pillText: {
334
343
  type: String,
335
- default: ''
344
+ default: '',
336
345
  },
337
346
  buttonRole: {
338
347
  type: String,
339
- default: 'link'
348
+ default: 'link',
340
349
  },
341
350
  isSelected: {
342
351
  type: Boolean,
343
- default: false
352
+ default: false,
344
353
  },
345
354
  isExpandable: {
346
355
  type: Boolean,
347
- default: false
356
+ default: false,
348
357
  },
349
358
  link: {
350
359
  type: [String, Boolean],
351
- default: false
360
+ default: false,
352
361
  },
353
362
  taxonomies: {
354
363
  type: Object,
355
- default: () => {}
364
+ default: () => {},
356
365
  },
357
366
  isCardTitleSelectable: {
358
367
  type: Boolean,
359
- default: false
360
- }
368
+ default: false,
369
+ },
361
370
  },
362
371
  data: () => ({
363
372
  isSelectable: false,
@@ -367,7 +376,7 @@ export default {
367
376
  isMobileView: false,
368
377
  isTabletView: false,
369
378
  selected: false,
370
- isAbsoluteUrl
379
+ isAbsoluteUrl,
371
380
  }),
372
381
  computed: {
373
382
  cardClass() {
@@ -394,12 +403,12 @@ export default {
394
403
  [`card-grid-item__card--border-${this.borderType}`]: true,
395
404
  [`card-grid-item__card--bg-${this.backgroundVariant}`]: true,
396
405
  [`card-grid-item__card--select-${this.buttonRole}`]: true,
397
- [`card-grid-item__card--align-${this.cardTextAlign}`]: true
406
+ [`card-grid-item__card--align-${this.cardTextAlign}`]: true,
398
407
  }
399
408
  },
400
409
  urlHostname() {
401
410
  return window.location.protocol + '//' + window.location.host
402
- }
411
+ },
403
412
  },
404
413
  mounted() {
405
414
  this.selected = this.isSelected
@@ -468,8 +477,8 @@ export default {
468
477
  if (theEl && theEl.length > 0) {
469
478
  var content = {
470
479
  content: this.$diffInDays(
471
- parseISO(theEl[0]?.componentOptions?.propsData?.card?.created)
472
- )
480
+ parseISO(theEl[0]?.componentOptions?.propsData?.card?.created),
481
+ ),
473
482
  }
474
483
  }
475
484
  if (this.$gtm) {
@@ -484,43 +493,46 @@ export default {
484
493
  label: this.cardHeaderTitle,
485
494
  data: linkURL,
486
495
  ...content,
487
- ...this.taxonomies
496
+ ...this.taxonomies,
488
497
  }
489
498
  // fire the default event
490
499
  this.$gtm.push({
491
500
  event: 'custom.interaction.tile.click',
492
501
  group: this?.parentGrid?.title,
493
- ...attrs
502
+ ...attrs,
494
503
  })
495
504
  if (this.pillText === 'News') {
496
505
  this.$gtm.push({
497
506
  event: 'custom.interaction.news.click',
498
507
  group: 'News',
499
- ...attrs
508
+ ...attrs,
500
509
  })
501
510
  }
502
511
  if (this.pillText === 'Event') {
503
512
  this.$gtm.push({
504
513
  event: 'custom.interaction.event.click',
505
514
  group: 'Event',
506
- ...attrs
515
+ ...attrs,
507
516
  })
508
517
  }
509
518
  if (this.pillText === 'Safety alert') {
510
519
  this.$gtm.push({
511
520
  event: 'custom.interaction.safety.click',
512
521
  group: 'Safety alert',
513
- ...attrs
522
+ ...attrs,
514
523
  })
515
524
  }
516
525
  if (
517
526
  (this.link,
518
- this.isAbsoluteUrl(this.link) && process.env.CARETAKER === 'false')
527
+ this.isAbsoluteUrl(this.link) &&
528
+ (this.$config
529
+ ? this.$config.public.caretaker
530
+ : process.env.CARETAKER) === 'false')
519
531
  ) {
520
532
  this.$gtm.push({
521
533
  event: 'custom.interaction.outboundlink',
522
534
  category: this.cardHeaderTitle,
523
- label: this.link
535
+ label: this.link,
524
536
  })
525
537
  }
526
538
  }
@@ -529,16 +541,18 @@ export default {
529
541
  this.link &&
530
542
  this.isAbsoluteUrl(this.link) &&
531
543
  isGovSite(this.link) &&
532
- process.env.CARETAKER === 'true'
544
+ (this.$config
545
+ ? this.$config.public.caretaker
546
+ : process.env.CARETAKER) === 'true'
533
547
  ) {
534
548
  this.$gtm.push({
535
549
  event: 'custom.interaction.outboundlink',
536
550
  category: this.cardHeaderTitle,
537
- label: this.link
551
+ label: this.link,
538
552
  })
539
553
  }
540
- }
541
- }
554
+ },
555
+ },
542
556
  }
543
557
  </script>
544
558
 
@@ -7,16 +7,16 @@
7
7
  controls
8
8
  indicators
9
9
  keyboard
10
+ :fade="true"
10
11
  background="#ababab"
11
12
  >
12
13
  <b-carousel-slide
13
14
  v-for="item in filteredCarouselItems"
14
15
  :key="item.id"
15
-
16
- :img-src="item.image"
17
- @click.prevent="handleClick(item.link)"
16
+ :img-src="getImageURL(item.field_image.field_media_image?.uri?.url)"
17
+ @click.prevent="handleClick(item.field_link.url)"
18
18
  >
19
- <h4>{{ item.content}}</h4>
19
+ <h4>{{ item.field_title}}</h4>
20
20
  </b-carousel-slide>
21
21
  </b-carousel>
22
22
  </div>
@@ -54,10 +54,10 @@ export default {
54
54
  var todayDate = new Date()
55
55
 
56
56
  for (var i = 0, length = this.carouselItems.length; i < length; i++) {
57
- if (this.carouselItems[i].favorite === 'Yes') {
57
+ if (this.carouselItems[i].field_favorite === true) {
58
58
  this.carouselItems[i].active = 'Yes'
59
- } else if (new Date(this.carouselItems[i].dateStart).valueOf() <= todayDate.valueOf()) {
60
- if (new Date(this.carouselItems[i].dateEnd).valueOf() >= todayDate.valueOf()) {
59
+ } else if (new Date(this.carouselItems[i].field_date_start).valueOf() <= todayDate.valueOf()) {
60
+ if (new Date(this.carouselItems[i].field_date_end).valueOf() >= todayDate.valueOf()) {
61
61
  this.carouselItems[i].active = 'Yes'
62
62
  }
63
63
  }
@@ -84,6 +84,12 @@ export default {
84
84
  }
85
85
  },
86
86
 
87
+ getImageURL(imagePath) {
88
+ let apiPath = this.$config ? this.$config.public.apiURL : process.env.CONTENT_API_URL;
89
+ let fullPath = apiPath.concat(imagePath)
90
+ return fullPath
91
+ },
92
+
87
93
  formatDate(date) {
88
94
  return [
89
95
  date.getFullYear(),
@@ -103,6 +109,7 @@ export default {
103
109
  .carousel {
104
110
  position: relative;
105
111
  padding-bottom: 7rem;
112
+ max-width: 540px;
106
113
  }
107
114
 
108
115
  .carousel-inner {
@@ -2,43 +2,66 @@ import HomepageHeader from './index.vue'
2
2
 
3
3
  const header = {
4
4
  title: 'This is sentence 1. This is sentence 2.',
5
- description: 'description text'
5
+ description: 'description text',
6
6
  }
7
7
 
8
- const fetchMenu = () =>
9
- Promise.resolve([
10
- {
11
- title: 'Report an incident',
12
- relative: '/report-incident'
13
- },
14
- {
15
- title: 'Report a case of COVID-19',
16
- relative: '/report-confirmed-positive-case-covid-19'
17
- },
18
- {
19
- title: 'Make a claim',
20
- relative: '/before-claim'
21
- },
22
- {
23
- title: 'Apply for a licence',
24
- relative: '/apply-for-licence'
25
- },
26
- {
27
- title: 'Pay or renew your insurance',
28
- relative: '/pay-or-renew-your-workcover-insurance-premium'
29
- }
30
- ])
8
+ // This is generated server side with useAsyncData
9
+ // const fetchMenu = () =>
10
+ // Promise.resolve([
11
+ // {
12
+ // title: 'Report an incident',
13
+ // relative: '/report-incident'
14
+ // },
15
+ // {
16
+ // title: 'Report a case of COVID-19',
17
+ // relative: '/report-confirmed-positive-case-covid-19'
18
+ // },
19
+ // {
20
+ // title: 'Make a claim',
21
+ // relative: '/before-claim'
22
+ // },
23
+ // {
24
+ // title: 'Apply for a licence',
25
+ // relative: '/apply-for-licence'
26
+ // },
27
+ // {
28
+ // title: 'Pay or renew your insurance',
29
+ // relative: '/pay-or-renew-your-workcover-insurance-premium'
30
+ // }
31
+ // ])
32
+ const headerLinks = [
33
+ {
34
+ text: 'Report an incident',
35
+ path: '/report-incident',
36
+ },
37
+ {
38
+ text: 'Report a case of COVID-19',
39
+ path: '/report-confirmed-positive-case-covid-19',
40
+ },
41
+ {
42
+ text: 'Make a claim',
43
+ path: '/before-claim',
44
+ },
45
+ {
46
+ text: 'Apply for a licence',
47
+ path: '/apply-for-licence',
48
+ },
49
+ {
50
+ text: 'Pay or renew your insurance',
51
+ path: '/pay-or-renew-your-workcover-insurance-premium',
52
+ },
53
+ ]
31
54
 
32
55
  const contentParser = () => {
33
56
  return Promise.resolve({
34
57
  results: [
35
58
  {
36
59
  title: 'Content title 1',
37
- description: 'Content description 2'
38
- }
60
+ description: 'Content description 2',
61
+ },
39
62
  ],
40
63
  offset: 0,
41
- numFound: 1000
64
+ numFound: 1000,
42
65
  })
43
66
  }
44
67
 
@@ -48,31 +71,32 @@ export default {
48
71
  argTypes: {
49
72
  fetchMenu: {
50
73
  control: 'function',
51
- table: { disable: true }
74
+ table: { disable: true },
52
75
  },
53
76
  contentParser: {
54
77
  control: 'function',
55
- table: { disable: true }
56
- }
78
+ table: { disable: true },
79
+ },
57
80
  },
58
81
  args: {
59
82
  heroHeader: header,
60
- fetchMenu: fetchMenu,
61
- contentParser: contentParser
62
- }
83
+ // fetchMenu: fetchMenu,
84
+ contentParser: contentParser,
85
+ headerLinks: headerLinks,
86
+ },
63
87
  }
64
88
 
65
89
  const DefaultHH = (args) => ({
66
90
  components: { HomepageHeader },
67
91
  setup() {
68
- return { args };
92
+ return { args }
69
93
  },
70
94
  mounted() {
71
95
  setTimeout(() => {
72
96
  this.$refs.hh.renderMenu()
73
97
  })
74
98
  },
75
- template: '<homepage-header v-bind="args" ref="hh" />'
99
+ template: '<homepage-header v-bind="args" ref="hh" />',
76
100
  })
77
101
 
78
- export const Default = DefaultHH.bind({})
102
+ export const Default = DefaultHH.bind({})
@@ -30,7 +30,7 @@
30
30
  <template v-slot:side>
31
31
  <div>
32
32
  <cta-button
33
- v-for="(link, i) in links"
33
+ v-for="(link, i) in headerLinks"
34
34
  :key="i"
35
35
  class="iebtn"
36
36
  :url="link.path"
@@ -73,36 +73,12 @@ export default {
73
73
  type: Object,
74
74
  required: true,
75
75
  },
76
- fetchMenu: {
77
- type: Function,
78
- required: true,
79
- },
80
- },
81
- // TODO useAsyncData <script setup>
82
- // async fetch() {
83
- // console.log("NEVA")
84
- // await this.renderMenu()
85
- // },
86
- // Temp use of mounted to replace fetch
87
- async mounted() {
88
- await this.renderMenu()
76
+ headerLinks: { type: Array, required: true },
89
77
  },
90
78
 
91
79
  data: () => ({
92
- links: [],
93
80
  earthIcon,
94
81
  }),
95
- methods: {
96
- async renderMenu() {
97
- const menu = await this.fetchMenu()
98
- this.links = (Array.isArray(menu) ? menu : []).map((item) => {
99
- return {
100
- text: item.title,
101
- path: item.relative || item.absolute,
102
- }
103
- })
104
- },
105
- },
106
82
  }
107
83
  </script>
108
84
  <style lang="scss" scoped>
@@ -1,29 +1,29 @@
1
1
  import HomepageHeader from './index.vue'
2
2
  import { mockCarouselItems } from '../../../mock/carousel-items'
3
3
 
4
- const fetchMenu = () =>
5
- Promise.resolve([
4
+
5
+ const headerLinks = [
6
6
  {
7
- title: 'Report an incident',
8
- relative: '/report-incident'
7
+ text: 'Report an incident',
8
+ path: '/report-incident'
9
9
  },
10
10
  {
11
- title: 'Report a case of COVID-19',
12
- relative: '/report-confirmed-positive-case-covid-19'
11
+ text: 'Report a case of COVID-19',
12
+ path: '/report-confirmed-positive-case-covid-19'
13
13
  },
14
14
  {
15
- title: 'Make a claim',
16
- relative: '/before-claim'
15
+ text: 'Make a claim',
16
+ path: '/before-claim'
17
17
  },
18
18
  {
19
- title: 'Apply for a licence',
20
- relative: '/apply-for-licence'
19
+ text: 'Apply for a licence',
20
+ path: '/apply-for-licence'
21
21
  },
22
22
  {
23
- title: 'Pay or renew your insurance',
24
- relative: '/pay-or-renew-your-workcover-insurance-premium'
23
+ text: 'Pay or renew your insurance',
24
+ path: '/pay-or-renew-your-workcover-insurance-premium'
25
25
  }
26
- ])
26
+ ]
27
27
 
28
28
  const contentParser = () => {
29
29
  return Promise.resolve({
@@ -52,10 +52,10 @@ export default {
52
52
  }
53
53
  },
54
54
  args: {
55
- fetchMenu: fetchMenu,
56
55
  slideList: mockCarouselItems,
57
56
  isStorybook: true,
58
- contentParser: contentParser
57
+ contentParser: contentParser,
58
+ headerLinks: headerLinks,
59
59
  }
60
60
  }
61
61