@worksafevictoria/wcl7.5 1.4.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 (86) 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 -5
  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 +69 -49
  10. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +7 -4
  11. package/src/components/Common/CardGridItem/index.vue +95 -71
  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/index.vue +304 -233
  22. package/src/components/Global/AppHeaderNew/styles.scss +29 -8
  23. package/src/components/Global/BackToTop/index.vue +8 -8
  24. package/src/components/Global/ContrastMode/index.vue +1 -1
  25. package/src/components/Global/Cookies/index.stories.js +16 -10
  26. package/src/components/Global/Cookies/index.vue +281 -237
  27. package/src/components/Global/Cookies/styles.scss +54 -54
  28. package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +50 -133
  29. package/src/components/Global/GlobalNotice/index.vue +79 -100
  30. package/src/components/Global/SocialShare/index.vue +1 -1
  31. package/src/components/Global/Strip/index.vue +1 -1
  32. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +8 -4
  33. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +23 -23
  34. package/src/components/Paragraphs/Accordion/index.stories.js +21 -18
  35. package/src/components/Paragraphs/Accordion/index.vue +52 -48
  36. package/src/components/Paragraphs/BrowseContent/index.vue +1 -1
  37. package/src/components/Paragraphs/BrowseContent/setup.vue +284 -0
  38. package/src/components/Paragraphs/Chart/Constants.js +485 -485
  39. package/src/components/Paragraphs/Chart/index.vue +232 -241
  40. package/src/components/Paragraphs/Directory/Records/HSCP/index.stories.js +33 -0
  41. package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +334 -0
  42. package/src/components/Paragraphs/Directory/Records/ISP/index.vue +2 -2
  43. package/src/components/Paragraphs/Directory/Records/index.vue +63 -27
  44. package/src/components/Paragraphs/Directory/Records/styles.scss +1 -0
  45. package/src/components/Paragraphs/Directory/constants.js +23 -5
  46. package/src/components/Paragraphs/Directory/index.vue +14 -14
  47. package/src/components/Paragraphs/ListGroup/index.vue +5 -1
  48. package/src/components/Paragraphs/ScrollSpy/index.vue +23 -14
  49. package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
  50. package/src/components/Paragraphs/TabbedCards/index.vue +13 -14
  51. package/src/components/Paragraphs/Tabs/index.vue +19 -17
  52. package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +9 -9
  53. package/src/components/Paragraphs/TextMedia/index.vue +20 -16
  54. package/src/components/Paragraphs/VideoGrid/index.stories.js +43 -19
  55. package/src/components/Paragraphs/VideoGrid/index.vue +13 -13
  56. package/src/components/Paragraphs/Webform/index.stories.js +82 -69
  57. package/src/components/SubComponents/CardGroup/index.vue +5 -1
  58. package/src/components/SubComponents/FormAddressPostcode/index.vue +35 -37
  59. package/src/components/SubComponents/FormInstance/components/handler/index.vue +25 -29
  60. package/src/components/SubComponents/FormInstance/components/renderer/index.vue +63 -28
  61. package/src/components/SubComponents/FormInstance/models/overrides/file.js +33 -40
  62. package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +22 -15
  63. package/src/components/SubComponents/FormInstance/services/registry-factory.js +1 -1
  64. package/src/components/SubComponents/FormInstance/stories/fileupload.stories.js +57 -0
  65. package/src/components/SubComponents/FormInstance/stories/mocks/fileupload.json +25 -0
  66. package/src/components/SubComponents/FormInstance/style.scss +2 -2
  67. package/src/components/SubComponents/FormInstance/tests/address.test.js +4 -4
  68. package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +7 -7
  69. package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +15 -15
  70. package/src/components/SubComponents/FormInstance/tests/date.test.js +8 -8
  71. package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +9 -9
  72. package/src/components/SubComponents/FormInstance/tests/multiple.test.js +13 -13
  73. package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +120 -120
  74. package/src/components/SubComponents/FormInstance/tests/scale.test.js +6 -6
  75. package/src/components/SubComponents/FormInstance/tests/url.test.js +13 -10
  76. package/src/components/SubComponents/Pagination/index.vue +19 -18
  77. package/src/components/SubComponents/ResourceGroup/index.vue +5 -1
  78. package/src/components/SubComponents/Search/SearchListing/index.vue +20 -20
  79. package/src/components/SubComponents/Search/index.vue +35 -33
  80. package/src/components/SubComponents/VideoThumbnail/index.vue +48 -133
  81. package/src/includes/scss/mixins/src/units.scss +25 -4
  82. package/src/includes/scss/vars/src/colors.module.scss +28 -1
  83. package/src/index.js +21 -3
  84. package/src/main.js +2 -10
  85. package/src/mock/app-header-new.js +27 -15
  86. package/src/mock/carousel-items.js +71 -46
@@ -15,10 +15,10 @@
15
15
  ? isSelectable && selected
16
16
  ? 'true'
17
17
  : 'false'
18
- : null
18
+ : false
19
19
  "
20
20
  :aria-expanded="
21
- isExpandable ? (isSelectable && selected ? 'true' : 'false') : null
21
+ isExpandable ? (isSelectable && selected ? 'true' : 'false') : false
22
22
  "
23
23
  :data-href="link"
24
24
  @click="cardClicked($event)"
@@ -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,19 +63,20 @@
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
- <div>
71
70
  <b-card-title
72
71
  v-if="cardHeaderTitle !== null && cardHeaderTitle !== undefined"
73
72
  :tag="headerTag"
74
73
  class="card-grid-item__header"
75
74
  :class="{
76
75
  [`card-grid-item__header--${headerSize}`]: true,
77
- [`card-grid-item__header--align-${headerTextAlign}`]: true
76
+ [`card-grid-item__header--align-${headerTextAlign}`]: true,
77
+ 'card-grid-item__header--cursor': isCardTitleSelectable,
78
78
  }"
79
+ @click="cardTitleClicked($event)"
79
80
  >
80
81
  <span>{{ cardHeaderTitle }}</span> &nbsp;
81
82
  <card-grid-item-caret
@@ -100,9 +101,7 @@
100
101
  >
101
102
  </card-grid-item-icon>
102
103
  </b-card-title>
103
- </div>
104
- <div>
105
- <card-grid-item-caret
104
+ <card-grid-item-caret
106
105
  v-if="caretPosition === 'top'"
107
106
  :caret="caret"
108
107
  :rtl="rtl"
@@ -123,22 +122,19 @@
123
122
  class="d-inline card-grid-item-icon--top-right"
124
123
  :class="{
125
124
  [`text-right`]: iconPosition === 'top-right',
126
- rtl: rtl
125
+ rtl: rtl,
127
126
  }"
128
127
  :rtl="rtl"
129
128
  >
130
129
  </card-grid-item-icon>
131
-
132
130
  <span v-if="pillText" class="visually-hidden">{{ pillText }}</span>
133
- </div>
134
-
135
131
  </div>
136
132
  <b-card-text
137
133
  v-if="$slots.cardDescription || description"
138
134
  text-tag="div"
139
135
  class="card-grid-item__body"
140
136
  :class="{
141
- rtl: rtl
137
+ rtl: rtl,
142
138
  }"
143
139
  >
144
140
  <div
@@ -146,7 +142,7 @@
146
142
  :class="{
147
143
  [descriptionClass]: !!descriptionClass,
148
144
  [`card-grid-item__description--withIcon`]:
149
- iconPosition === 'before-description'
145
+ iconPosition === 'before-description',
150
146
  }"
151
147
  >
152
148
  <card-grid-item-icon
@@ -185,7 +181,7 @@
185
181
  v-if="caretPosition === 'bottom'"
186
182
  class="card-grid-item__caretContainer card-grid-item__caretContainer--bottom"
187
183
  :class="{
188
- rtl: !rtl
184
+ rtl: !rtl,
189
185
  }"
190
186
  >
191
187
  <card-grid-item-caret :caret="caret" :rtl="rtl" />
@@ -200,52 +196,60 @@
200
196
  import CardGridItemIcon from './card-grid-item-icon.vue'
201
197
  import CardGridItemCaret from './card-grid-item-caret.vue'
202
198
  import RichText from '../../Paragraphs/RichText/index.vue'
203
- import parseISO from 'date-fns/parseISO'
199
+ import { parseISO } from 'date-fns'
204
200
  import { isAbsoluteUrl, isGovSite } from '../../../../lib/utility'
205
201
  import { BCard, BCardBody, BCardTitle, BCardText } from 'bootstrap-vue-next'
206
202
 
207
203
  export default {
208
204
  name: 'CardGridItem',
209
- 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
+ },
210
214
  props: {
211
215
  backgroundVariant: {
212
216
  type: String,
213
217
  default: 'white',
214
218
  validator: (value) =>
215
- ['white', 'transparent', 'light'].indexOf(value) >= 0
219
+ ['white', 'transparent', 'light'].indexOf(value) >= 0,
216
220
  },
217
221
  imageSrc: {
218
222
  type: String,
219
- default: null
223
+ default: null,
220
224
  },
221
225
  imageAlt: {
222
226
  type: String,
223
- default: null
227
+ default: null,
224
228
  },
225
229
  description: {
226
230
  type: String,
227
- default: null
231
+ default: null,
228
232
  },
229
233
  stripDescriptionHtml: {
230
- type: Boolean
234
+ type: Boolean,
231
235
  },
232
236
  descriptionClass: {
233
237
  type: String,
234
- default: ''
238
+ default: '',
235
239
  },
236
240
  glyphSrc: {
237
241
  type: [Object, String],
238
- default: null
242
+ default: null,
239
243
  },
240
244
  glyphIconComponent: {
241
245
  type: String,
242
- default: null
246
+ default: null,
243
247
  },
244
248
  iconSize: {
245
249
  type: String,
246
250
  default: 'small',
247
251
  validator: (value) =>
248
- ['xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0
252
+ ['xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0,
249
253
  },
250
254
  iconPosition: {
251
255
  type: String,
@@ -256,108 +260,113 @@ export default {
256
260
  'top-left',
257
261
  'top-right',
258
262
  'after-title',
259
- 'before-description'
260
- ].indexOf(value) >= 0
263
+ 'before-description',
264
+ ].indexOf(value) >= 0,
261
265
  },
262
266
  iconIsBordered: {
263
267
  type: Boolean,
264
- default: true
268
+ default: true,
265
269
  },
266
270
  showDivider: {
267
- type: Boolean
271
+ type: Boolean,
268
272
  },
269
273
  cardHeaderTitle: {
270
274
  type: String,
271
- default: null
275
+ default: null,
272
276
  },
273
277
  invertOnSelectBackground: {
274
278
  type: String,
275
279
  default: 'none',
276
- validator: (value) => ['none', 'yellow', 'black'].indexOf(value) >= 0
280
+ validator: (value) => ['none', 'yellow', 'black'].indexOf(value) >= 0,
277
281
  },
278
282
  borderOnSelectBackground: {
279
283
  type: String,
280
284
  default: 'none',
281
285
  validator: (value) =>
282
- ['none', 'yellow', 'black', 'blue'].indexOf(value) >= 0
286
+ ['none', 'yellow', 'black', 'blue'].indexOf(value) >= 0,
283
287
  },
284
288
  rtl: {
285
289
  type: Boolean,
286
- default: false
290
+ default: false,
287
291
  },
288
292
  headerSize: {
289
293
  type: String,
290
294
  default: 'custom',
291
295
  validator: (value) =>
292
296
  ['medium', 'large', 'extra-large', 'extra-2x-large', 'custom'].indexOf(
293
- value
294
- ) >= 0
297
+ value,
298
+ ) >= 0,
295
299
  },
296
300
  headerTextAlign: {
297
301
  type: String,
298
302
  default: 'left',
299
- validator: (value) => ['left', 'center', 'right'].indexOf(value) >= 0
303
+ validator: (value) => ['left', 'center', 'right'].indexOf(value) >= 0,
300
304
  },
301
305
  headerTag: {
302
306
  type: String,
303
307
  required: false,
304
- default: 'h3'
308
+ default: 'h3',
305
309
  },
306
310
  caret: {
307
311
  type: String,
308
312
  default: undefined,
309
313
  validator: (value) =>
310
- ['down', 'up', 'right', 'left', 'external'].indexOf(value) >= 0
314
+ ['down', 'up', 'right', 'left', 'external'].indexOf(value) >= 0,
311
315
  },
312
316
  caretPosition: {
313
317
  type: String,
314
318
  default: 'top',
315
- validator: (value) => ['top', 'bottom', 'after-title'].indexOf(value) >= 0
319
+ validator: (value) =>
320
+ ['top', 'bottom', 'after-title'].indexOf(value) >= 0,
316
321
  },
317
322
  cardPadding: {
318
323
  type: String,
319
324
  default: 'none',
320
325
  validator: (value) =>
321
- ['none', 'xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0
326
+ ['none', 'xsmall', 'small', 'medium', 'large'].indexOf(value) >= 0,
322
327
  },
323
328
  borderType: {
324
329
  type: String,
325
330
  default: 'none',
326
331
  validator: (value) =>
327
- ['none', 'thin', 'shadow', 'thick', 'dark'].indexOf(value) >= 0
332
+ ['none', 'thin', 'shadow', 'thick', 'dark'].indexOf(value) >= 0,
328
333
  },
329
334
  cardTextAlign: {
330
335
  type: String,
331
- default: 'left'
336
+ default: 'left',
332
337
  },
333
338
  disableSelect: {
334
339
  type: Boolean,
335
- default: false
340
+ default: false,
336
341
  },
337
342
  pillText: {
338
343
  type: String,
339
- default: ''
344
+ default: '',
340
345
  },
341
346
  buttonRole: {
342
347
  type: String,
343
- default: 'link'
348
+ default: 'link',
344
349
  },
345
350
  isSelected: {
346
351
  type: Boolean,
347
- default: false
352
+ default: false,
348
353
  },
349
354
  isExpandable: {
350
355
  type: Boolean,
351
- default: false
356
+ default: false,
352
357
  },
353
358
  link: {
354
359
  type: [String, Boolean],
355
- default: false
360
+ default: false,
356
361
  },
357
362
  taxonomies: {
358
363
  type: Object,
359
- default: () => {}
360
- }
364
+ default: () => {},
365
+ },
366
+ isCardTitleSelectable: {
367
+ type: Boolean,
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
@@ -422,10 +431,16 @@ export default {
422
431
  if (this.isSelectable) {
423
432
  this.parentGrid.cardSelected(this, ev)
424
433
  }
434
+
425
435
  if (this.$gtm) {
426
436
  this.fireGTM()
427
437
  }
428
438
  },
439
+ cardTitleClicked(ev) {
440
+ if (this.isCardTitleSelectable) {
441
+ this.parentGrid.cardTitleSelected(this, ev)
442
+ }
443
+ },
429
444
  getParentGridItem() {
430
445
  let counter = 0
431
446
  const maxParentDepth = 10
@@ -462,8 +477,8 @@ export default {
462
477
  if (theEl && theEl.length > 0) {
463
478
  var content = {
464
479
  content: this.$diffInDays(
465
- parseISO(theEl[0]?.componentOptions?.propsData?.card?.created)
466
- )
480
+ parseISO(theEl[0]?.componentOptions?.propsData?.card?.created),
481
+ ),
467
482
  }
468
483
  }
469
484
  if (this.$gtm) {
@@ -478,43 +493,46 @@ export default {
478
493
  label: this.cardHeaderTitle,
479
494
  data: linkURL,
480
495
  ...content,
481
- ...this.taxonomies
496
+ ...this.taxonomies,
482
497
  }
483
498
  // fire the default event
484
499
  this.$gtm.push({
485
500
  event: 'custom.interaction.tile.click',
486
501
  group: this?.parentGrid?.title,
487
- ...attrs
502
+ ...attrs,
488
503
  })
489
504
  if (this.pillText === 'News') {
490
505
  this.$gtm.push({
491
506
  event: 'custom.interaction.news.click',
492
507
  group: 'News',
493
- ...attrs
508
+ ...attrs,
494
509
  })
495
510
  }
496
511
  if (this.pillText === 'Event') {
497
512
  this.$gtm.push({
498
513
  event: 'custom.interaction.event.click',
499
514
  group: 'Event',
500
- ...attrs
515
+ ...attrs,
501
516
  })
502
517
  }
503
518
  if (this.pillText === 'Safety alert') {
504
519
  this.$gtm.push({
505
520
  event: 'custom.interaction.safety.click',
506
521
  group: 'Safety alert',
507
- ...attrs
522
+ ...attrs,
508
523
  })
509
524
  }
510
525
  if (
511
526
  (this.link,
512
- 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')
513
531
  ) {
514
532
  this.$gtm.push({
515
533
  event: 'custom.interaction.outboundlink',
516
534
  category: this.cardHeaderTitle,
517
- label: this.link
535
+ label: this.link,
518
536
  })
519
537
  }
520
538
  }
@@ -523,16 +541,18 @@ export default {
523
541
  this.link &&
524
542
  this.isAbsoluteUrl(this.link) &&
525
543
  isGovSite(this.link) &&
526
- process.env.CARETAKER === 'true'
544
+ (this.$config
545
+ ? this.$config.public.caretaker
546
+ : process.env.CARETAKER) === 'true'
527
547
  ) {
528
548
  this.$gtm.push({
529
549
  event: 'custom.interaction.outboundlink',
530
550
  category: this.cardHeaderTitle,
531
- label: this.link
551
+ label: this.link,
532
552
  })
533
553
  }
534
- }
535
- }
554
+ },
555
+ },
536
556
  }
537
557
  </script>
538
558
 
@@ -845,6 +865,10 @@ export default {
845
865
  &--align-right {
846
866
  direction: rtl;
847
867
  }
868
+
869
+ &--cursor {
870
+ cursor: pointer;
871
+ }
848
872
  }
849
873
  }
850
874
 
@@ -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>