@worksafevictoria/wcl7.5 1.0.0 → 1.1.0-beta.2

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 (35) hide show
  1. package/.env +4 -2
  2. package/.eslintrc.cjs +1 -1
  3. package/.eslintrc.js +2 -1
  4. package/.husky/pre-commit +4 -0
  5. package/.storybook/main.js +2 -1
  6. package/.storybook/preview.js +10 -0
  7. package/README.md +14 -0
  8. package/babel.config.js +7 -6
  9. package/bin/deploy.sh +3 -3
  10. package/ci/build/build_validation.yml +11 -6
  11. package/ci/release/beta.yml +6 -5
  12. package/ci/release/master.yml +6 -5
  13. package/jest.config.js +3 -1
  14. package/package.json +14 -9
  15. package/public/.nojekyll +1 -0
  16. package/src/components/Global/Cookies/{index.storieshide.js → index.stories.js} +5 -16
  17. package/src/components/Global/Cookies/index.vue +122 -136
  18. package/src/components/Global/Cookies/styles.scss +10 -2
  19. package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +53 -47
  20. package/src/components/Global/GlobalNotice/index.stories.js +8 -0
  21. package/src/components/Global/GlobalNotice/index.vue +71 -137
  22. package/src/components/Global/HeroHeader/styles.scss +2 -1
  23. package/src/components/Paragraphs/BrowseContent/index.stories.js +39 -57
  24. package/src/components/SubComponents/FormInstance/index.vue +3 -1
  25. package/src/components/SubComponents/FormInstance/stories/mocks/checkbox.json +21 -0
  26. package/src/components/SubComponents/Search/GoogleREST/index.stories.js +50 -0
  27. package/src/components/SubComponents/Search/GoogleSearch/index.stories.js +23 -0
  28. package/src/components/SubComponents/Search/SearchListing/index.vue +69 -9
  29. package/src/components/SubComponents/Search/index.stories.js +19 -16
  30. package/src/components/SubComponents/Search/index.vue +563 -59
  31. package/src/components/SubComponents/VideoThumbnail/index.stories.js +9 -4
  32. package/src/components/SubComponents/VideoThumbnail/index.vue +93 -96
  33. package/vite.config.js +5 -1
  34. package/src/components/SubComponents/GoogleSearch/index.stories.js +0 -8
  35. package/src/components/SubComponents/GoogleSearch/index.vue +0 -405
@@ -1,5 +1,5 @@
1
1
  @import '../../../assets/styles/generated-icons.scss';
2
- @import '../../../includes/scss/all';
2
+ @import './../../../includes/scss/all';
3
3
 
4
4
  h3.cookie-header {
5
5
  font-weight: 700;
@@ -249,7 +249,15 @@ h3.cookie-header {
249
249
  color: $black;
250
250
  }
251
251
 
252
- .modal-heading {
252
+ .modal {
253
+ background: rgba(0,0,0,0.5)
254
+ }
255
+
256
+ .modal-backdrop {
257
+ display: none;
258
+ }
259
+
260
+ .modal-heading-text {
253
261
  font-size: 26px;
254
262
  font-weight: 700;
255
263
  line-height: 32px;
@@ -4,62 +4,58 @@
4
4
  :has-caret="true"
5
5
  :selected="numberOfItems > 0"
6
6
  :is-reset="false"
7
- @clicked="$bvModal.show(`modal-center-${_uid}`)"
7
+ @clicked="showMyModal = !showMyModal"
8
8
  >
9
9
  <span>{{ data.name }}</span>
10
10
  <span v-if="numberOfItems > 0">({{ numberOfItems }})</span>
11
11
  </filter-button>
12
- <b-modal
13
- :id="`modal-center-${_uid}`"
14
- modal-class="wcl-directory-filters__single-tax__modal"
15
- centered
16
- scrollable
17
- size="xl"
18
- :title="data.name"
19
- :title-sr-only="true"
20
- header-close-label="Close dialog box"
21
- >
22
- <fieldset>
23
- <legend>Filter by {{ data.name }}</legend>
24
- <div v-for="term in data.terms" :key="term.tid" class="option">
25
- <input
26
- :id="`term_${term.tid}`"
27
- v-model="selectedFilters[`${data.record_id}`]"
28
- type="checkbox"
29
- :name="term.name"
30
- :value="term"
31
- :disabled="term.preselected"
32
- @keyup.enter="(e) => e.target.click()"
33
- />
34
- <label :for="`term_${term.tid}`">{{ term.name }}</label>
12
+ <div v-if="showMyModal" class="modal fade show wcl-directory-filters__single-tax__modal"
13
+ tabindex="-1" aria-labelledby="exampleModalLabel" aria-modal="true" role="dialog"
14
+ style="display: block;">
15
+ <div class="modal-dialog modal-xl modal-dialog-scrollable modal-dialog-centered">
16
+ <div class="modal-content">
17
+ <div class="modal-body">
18
+ <fieldset>
19
+ <legend>Filter by {{ data.name }}</legend>
20
+ <div v-for="term in data.terms" :key="term.tid" class="option">
21
+ <input
22
+ :id="`term_${term.tid}`"
23
+ v-model="selectedFilters[`${data.record_id}`]"
24
+ type="checkbox"
25
+ :name="term.name"
26
+ :value="term"
27
+ :disabled="term.preselected"
28
+ @keyup.enter="(e) => e.target.click()"
29
+ />
30
+ <label :for="`term_${term.tid}`">{{ term.name }}</label>
31
+ </div>
32
+ </fieldset>
33
+ </div>
34
+ <div class="modal-footer">
35
+ <cta-button
36
+ v-if="!loading && results !== 0"
37
+ :type="'dark'"
38
+ :rtl="false"
39
+ :focus-outline="'light'"
40
+ :workwell="false"
41
+ @clicked="showMyModal = !showMyModal"
42
+ >Show <span>{{ results }}</span> {{ resultString }}
43
+ </cta-button>
44
+ <strong v-else><span v-show="!loading">No results found</span></strong>
45
+ </div>
35
46
  </div>
36
- </fieldset>
37
- <template #modal-footer="{ ok }">
38
- <!-- Emulate built in modal footer ok and cancel button actions -->
39
- <cta-button
40
- v-if="!loading && results !== 0"
41
- :type="'dark'"
42
- :rtl="false"
43
- :focus-outline="'light'"
44
- :workwell="false"
45
- @clicked="ok()"
46
- >Show <span>{{ results }}</span> {{ resultString }}</cta-button
47
- >
48
- <strong v-else><span v-show="!loading">No results found</span></strong>
49
- </template>
50
- </b-modal>
47
+ </div>
48
+ </div>
51
49
  </div>
52
50
  </template>
53
51
  <script>
54
- import CtaButton from './../../../SubComponents/CtaButton/index.vue'
55
- import FilterButton from './../../../Common/FilterButton/index.vue'
56
- import { BModal } from 'bootstrap-vue-next'
52
+ import CtaButton from '../../../SubComponents/CtaButton/index.vue'
53
+ import FilterButton from '../../../Common/FilterButton/index.vue'
57
54
 
58
55
  export default {
59
56
  components: {
60
57
  CtaButton,
61
- FilterButton,
62
- BModal
58
+ FilterButton
63
59
  },
64
60
  props: {
65
61
  data: {
@@ -82,7 +78,8 @@ export default {
82
78
  (term) => term.preselected
83
79
  )
84
80
  },
85
- hasReset: false
81
+ hasReset: false,
82
+ showMyModal: false
86
83
  }
87
84
  },
88
85
  computed: {
@@ -92,7 +89,7 @@ export default {
92
89
  resultString() {
93
90
  let s = 's'
94
91
  this.results === 1 ? (s = '') : false
95
- return 'Result' + s
92
+ return 'Result' + s + ' '
96
93
  }
97
94
  },
98
95
  watch: {
@@ -121,7 +118,7 @@ export default {
121
118
  }
122
119
  </script>
123
120
  <style lang="scss">
124
- //
121
+ //
125
122
  // Global non scoped scss!
126
123
  // Modal inner overrides only
127
124
  //
@@ -134,13 +131,22 @@ export default {
134
131
  padding-left: 8px;
135
132
  }
136
133
 
134
+ .modal {
135
+ background: rgba(0,0,0,0.5);
136
+ }
137
+ .modal-backdrop {
138
+ display: none;
139
+ }
140
+
137
141
  &__modal {
138
142
  .modal-content {
139
143
  border-radius: 8px;
140
144
  }
145
+
141
146
  .modal-xl {
142
147
  max-width: 920px;
143
148
  }
149
+
144
150
  .modal-header {
145
151
  position: absolute;
146
152
  width: 100%;
@@ -0,0 +1,8 @@
1
+ import GlobalNotice from './index.vue'
2
+
3
+ export default {
4
+ title: 'Global/GlobalNotice',
5
+ component: GlobalNotice
6
+ }
7
+
8
+ export const Default = {}
@@ -1,104 +1,72 @@
1
1
  <template>
2
- <div>
3
- <b-modal
4
- id="global-notice-modal"
5
- ref="globalNoticeModal"
6
- :visible="displayGlobal"
7
- size="400"
8
- class="modal"
9
- :no-close-on-backdrop="true"
10
- :close-on-backdrop="false"
11
- :close-on-esc="false"
12
- aria-labelledby="global-notice-modal"
13
- role="dialog"
14
- >
15
- <template #modal-header="{} ">
16
- <div>
17
- <!-- Emulate built in modal header close button action -->
18
- <a
19
- href="#"
20
- aria-label="Close"
21
- @click="
22
- setCookie()
23
- $bvModal.hide('global-notice-modal')
24
- "
25
- >
26
- <img
27
- :src="IconClose"
28
- alt="close icon"
29
- class="close-icon"
30
- width="16px"
31
- height="16px"
32
- />
33
- </a>
34
- </div>
35
- </template>
36
- <div>
37
- <div slot="modal-title" class="modal-heading">
38
- Understand changes to the 2023-24 WorkCover premium
39
- </div>
40
- </div>
2
+ <div
3
+ v-if="displayGlobal"
4
+ id="global-notice-modal"
5
+ ref="globalNoticeModal"
6
+ class="modal show"
7
+ aria-labelledby="global-notice-modal"
8
+ role="dialog"
9
+ tabindex="-1"
10
+ aria-modal="true"
11
+ style="display: block;">
41
12
 
42
- <div class="modal-content global-modal-global-content">
43
- <div>
44
- Information for employers on changes to premium rates, how premium is
45
- calculated and key dates.
13
+ <div class="modal-dialog modal-dialog-centered">
14
+ <div class="modal-content">
15
+ <div class="modal-header">
16
+ <button type="button" class="btn-close" @click="setCookie(), displayGlobal = !displayGlobal" aria-label="close"></button>
46
17
  </div>
47
- <div class="modal-buttons">
48
- <div>
49
- <button
50
- id="open_page"
51
- type="button"
52
- role="button"
53
- class="modal-buttons isWiderYellow hasIcon justify-content-start "
54
- style="order: 1"
55
- aria-label="Open information about premium changes"
56
- @click="
57
- setCookie()
58
- goToPage('/2023-24-workcover-premium-changes')
59
- $bvModal.hide('global-notice-modal')
60
- "
61
- >
62
- 2023-24 premium FAQs
63
- </button>
18
+ <div class="modal-body">
19
+ <div class="modal-heading">
20
+ Understand changes to the 2023-24 WorkCover premium
64
21
  </div>
65
22
  <div>
66
- <button
67
- id="modal_close"
68
- type="button"
69
- role="button"
70
- class="modal-buttons isWiderGray hasIcon justify-content-start "
71
- style="order: 2"
72
- data-bs-dismiss="global-notice-modal"
73
- aria-label="Close modal and go to WorkSafe website"
74
- @click="
75
- setCookie()
76
- $bvModal.hide('global-notice-modal')
77
- "
78
- >
79
- Continue to WorkSafe
80
- </button>
23
+ Information for employers on changes to premium rates, how premium is
24
+ calculated and key dates.
25
+ </div>
26
+ <div class="modal-buttons">
27
+ <div>
28
+ <button
29
+ id="open_page"
30
+ type="button"
31
+ role="button"
32
+ class="modal-buttons isWiderYellow hasIcon justify-content-start "
33
+ style="order: 1"
34
+ aria-label="Open information about premium changes"
35
+ @click="setCookie(), goToPage('/2023-24-workcover-premium-changes'), displayGlobal = !displayGlobal"
36
+ >
37
+ 2023-24 premium FAQs
38
+ </button>
39
+ </div>
40
+ <div>
41
+ <button
42
+ id="modal_close"
43
+ type="button"
44
+ role="button"
45
+ class="modal-buttons isWiderGray hasIcon justify-content-start "
46
+ style="order: 2"
47
+ data-bs-dismiss="global-notice-modal"
48
+ aria-label="Close modal and go to WorkSafe website"
49
+ @click="setCookie(), displayGlobal = !displayGlobal"
50
+ >
51
+ Continue to WorkSafe
52
+ </button>
53
+ </div>
81
54
  </div>
82
55
  </div>
56
+ <div style="display: none;" class="modal-footer"></div>
83
57
  </div>
84
- <div
85
- slot="modal-footer"
86
- style="display: none;"
87
- class="modal-footer"
88
- ></div>
89
- </b-modal>
58
+ </div>
90
59
  </div>
91
60
  </template>
92
61
 
93
62
  <script>
94
- import IconClose from '../../../assets/icons/icon-close.svg'
63
+
95
64
  export default {
96
65
  name: 'GlobalNotice',
97
66
  data() {
98
67
  return {
99
68
  currentURL: '',
100
69
  displayGlobal: false,
101
- IconClose
102
70
  }
103
71
  },
104
72
  mounted() {
@@ -109,7 +77,11 @@ export default {
109
77
  localStorage.setItem('globalModalHidden', 'true')
110
78
  },
111
79
  goToPage(link) {
112
- window.open(link, '_self')
80
+ if (process.env.IS_STORYBOOK === 'TRUE') {
81
+ alert('Will go to: ' + link + ' and close notice - clear local storage and refresh to redisplay')
82
+ } else {
83
+ window.open(link, '_self')
84
+ }
113
85
  },
114
86
  checkPage() {
115
87
  this.currentURL = window.location.pathname
@@ -131,73 +103,35 @@ export default {
131
103
  @import '../../../assets/styles/generated-icons.scss';
132
104
  @import '../../../includes/scss/all';
133
105
 
134
- .global-modal {
135
- border-bottom: 0 none !important;
136
- }
137
- .modal-dialog.modal-400 {
138
- width: 400px !important;
139
- left: 50%;
140
- margin-left: -(200px);
141
- top: 50%;
142
- margin-top: -240px;
143
- box-shadow: 0px 0px 16px 8px rgba(0, 0, 0, 0.24) !important;
144
- border-radius: 6px !important;
106
+ // modal and modal backdrop styles required in order to display the overlay behind the modal
145
107
 
146
- @media only screen and (max-width: 481px) {
147
- width: 343px !important;
148
- margin-left: -(171px);
149
- }
108
+ .modal {
109
+ background: rgba(0,0,0,0.5)
150
110
  }
151
- .modal-header .close {
111
+
112
+ .modal-backdrop {
152
113
  display: none;
153
114
  }
115
+
154
116
  .modal-header {
155
- border-bottom: 0 none !important;
156
- justify-content: flex-end !important;
157
- padding-bottom: 0px !important;
158
- }
159
- .close-icon {
160
- padding: 0;
117
+ border: none;
161
118
  }
162
- .modal-footer {
163
- border-top: 0 none !important;
164
- }
165
- .modal-body {
166
- padding-left: 24px;
167
- margin-bottom: 0px;
168
- padding-bottom: 0 !important;
169
- }
170
-
171
- .modal-content {
172
- font-weight: 400;
173
- font-size: 16px;
174
- line-height: 24px;
175
- border: none !important;
176
- margin-top: 16px;
177
- margin-bottom: 0px;
178
- padding: 0px 8px;
179
-
180
- &:focus:focus-visible {
181
- outline: 0 !important;
182
- }
183
119
 
184
- @media only screen and (max-width: 481px) {
185
- padding: 0px;
186
- }
187
- }
188
120
  .modal-heading {
189
121
  font-size: 26px;
190
122
  font-weight: 700;
191
123
  line-height: 30px;
192
124
  letter-spacing: 0px;
193
- margin-bottom: 0px;
194
- margin-top: 0px;
195
- padding: 0px 8px;
196
- @media only screen and (max-width: 481px) {
197
- padding: 0px;
198
- }
125
+ margin-bottom: 16px;
199
126
  }
200
127
 
128
+ .modal-content {
129
+ font-weight: 400;
130
+ font-size: 16px;
131
+ line-height: 24px;
132
+ padding: 16px;
133
+ }
134
+
201
135
  .modal-buttons {
202
136
  position: relative;
203
137
  text-decoration: none;
@@ -179,7 +179,8 @@
179
179
  // Masking
180
180
  //
181
181
  &__mask {
182
- position: absolute;
182
+ position: relative;
183
+ overflow: hidden;
183
184
  width: 100%;
184
185
  height: 100%;
185
186
  top: 0;
@@ -8,83 +8,64 @@ export default {
8
8
  argTypes: {
9
9
  background: {
10
10
  control: 'select',
11
- options: ['grey', 'white', 'yellow'],
12
- defaultValue: 'grey'
13
- },
14
- title: {
15
- control: 'text',
16
- defaultValue: 'Card Group Auto title'
11
+ options: ['grey', 'white', 'yellow']
17
12
  },
18
13
  titleTag: {
19
14
  control: 'select',
20
- options: ['h2', 'h3'],
21
- defaultValue: 'h2'
22
- },
23
- bundle: {
24
- control: 'object',
25
- defaultValue: bundleContent
15
+ options: ['h2', 'h3']
26
16
  },
27
17
  columns: {
28
18
  control: 'select',
29
- options: [4, 3, 2, 1],
30
- defaultValue: 3
31
- },
32
- initialDisplyLimit: {
33
- control: 'number',
34
- defaultValue: 3
19
+ options: [4, 3, 2, 1]
35
20
  },
36
21
  fetchContent: {
37
22
  control: 'function',
38
- defaultValue: null,
39
23
  table: { disable: true }
40
24
  },
41
- enableBundleFilter: {
42
- control: 'boolean',
43
- defaultValue: true
44
- },
45
- showMore: {
46
- control: 'boolean',
47
- defaultValue: true
25
+ fetchFilters: {
26
+ control: 'function',
27
+ table: { disable: true }
48
28
  },
49
29
  type: {
50
30
  control: 'text',
51
- defaultValue: 'auto',
52
31
  table: { disable: true }
53
32
  },
54
- showFilter: {
55
- control: 'boolean',
56
- defaultValue: true
57
- },
58
33
  rows: {
59
34
  control: 'select',
60
- options: [3, 2, 1],
61
- defaultValue: 3
62
- },
63
- hasPreselectedFilters: {
64
- control: 'boolean',
65
- defaultValue: false
66
- },
67
- totalResults: {
68
- control: 'number',
69
- defaultValue: 10
70
- },
71
- filterResults: {
72
- control: 'number',
73
- defaultValue: 1
35
+ options: [3, 2, 1]
74
36
  }
37
+ },
38
+ args: {
39
+ background: 'grey',
40
+ title: 'Card Group Auto title',
41
+ titleTag: 'h2',
42
+ bundle: bundleContent,
43
+ columns: 3,
44
+ initialDisplyLimit: 3,
45
+ fetchContent: null,
46
+ enableBundleFilter: true,
47
+ showMore: true,
48
+ type: 'auto',
49
+ showFilter: true,
50
+ rows: 3,
51
+ hasPreselectedFilters: false,
52
+ totalResults: 10,
53
+ filterResults: 1
75
54
  }
76
55
  }
77
56
 
78
- const DefaultContent = (args, { argTypes }) => ({
57
+ const DefaultContent = (args) => ({
79
58
  components: { BrowseContent },
80
- props: Object.keys(argTypes),
59
+ setup() {
60
+ return { args }
61
+ },
81
62
  mounted() {
82
63
  this.reset()
83
64
  },
84
65
  computed: {
85
66
  searchResults() {
86
67
  return {
87
- results: Array(this.totalResults).fill({
68
+ results: Array(args.totalResults).fill({
88
69
  title: 'News Kitchen Sink 11',
89
70
  imageSrc: '',
90
71
  imageAlt: '',
@@ -96,7 +77,7 @@ const DefaultContent = (args, { argTypes }) => ({
96
77
  location: '',
97
78
  rtl: false
98
79
  }),
99
- numFound: this.totalResults
80
+ numFound: args.totalResults
100
81
  }
101
82
  }
102
83
  },
@@ -125,15 +106,15 @@ const DefaultContent = (args, { argTypes }) => ({
125
106
  })
126
107
 
127
108
  data.results = hasFilters
128
- ? data.results.slice(0, this.filterResults)
109
+ ? data.results.slice(0, args.filterResults)
129
110
  : data.results.slice(qs.start, qs.start + qs.rows)
130
- data.numFound = hasFilters ? this.filterResults : data.numFound
111
+ data.numFound = hasFilters ? args.filterResults : data.numFound
131
112
 
132
113
  return Promise.resolve(data)
133
114
  },
134
115
  fetchFilters() {
135
- return Promise.resolve(
136
- this.showFilter
116
+ const filters = (
117
+ args.showFilter
137
118
  ? [
138
119
  {
139
120
  name: 'industry',
@@ -148,7 +129,7 @@ const DefaultContent = (args, { argTypes }) => ({
148
129
  name: 'Aged care'
149
130
  }
150
131
  ].filter((item) =>
151
- this.hasPreselectedFilters ? true : !item.preselected
132
+ args.hasPreselectedFilters ? true : !item.preselected
152
133
  ),
153
134
  record_id: 'industry'
154
135
  },
@@ -165,13 +146,14 @@ const DefaultContent = (args, { argTypes }) => ({
165
146
  preselected: true
166
147
  }
167
148
  ].filter((item) =>
168
- this.hasPreselectedFilters ? true : !item.preselected
149
+ args.hasPreselectedFilters ? true : !item.preselected
169
150
  ),
170
151
  record_id: 'topic'
171
152
  }
172
153
  ]
173
154
  : []
174
155
  )
156
+ return Promise.resolve(filters)
175
157
  },
176
158
  getBundleAlias(string) {
177
159
  return string.charAt(0).toUpperCase() + string.slice(1)
@@ -206,10 +188,10 @@ const DefaultContent = (args, { argTypes }) => ({
206
188
  },
207
189
  template: `
208
190
  <browse-content
209
- v-bind="$props"
191
+ v-bind="args"
210
192
  ref="bc"
211
193
  :key="rerenderKey"
212
- :initial-disply-limit="rows * 3"
194
+ :initial-disply-limit="args.rows * 3"
213
195
  :fetch-content="fetchCards"
214
196
  :get-bundle-alias="getBundleAlias"
215
197
  :fetch-filters="fetchFilters"
@@ -1,8 +1,10 @@
1
1
  <template>
2
- <h1>Form Instance</h1>
2
+ <div>
3
+ <h1>Form Instance</h1>
3
4
  <p>
4
5
  The .vue and .stories.js files for SubComponents/FormInstance (displayed in Storybook under Form) must be copied from current Storybook 6 branch when time to upgrade them. They are causing errors preventing Storybook from being rendered and therefore tested.
5
6
  </p>
7
+ </div>
6
8
  </template>
7
9
 
8
10
  <script>
@@ -0,0 +1,21 @@
1
+ {
2
+ "checkbox1": {
3
+ "#type": "checkbox",
4
+ "#title": "checkbox1",
5
+ "#prepopulate": true,
6
+ "#default_value": true,
7
+ "#webform": "kitchen_sink_formio_v1",
8
+ "#webform_id": "kitchen_sink_formio_v1--checkbox1",
9
+ "#webform_key": "checkbox1",
10
+ "#webform_element": true,
11
+ "#input": true,
12
+ "#return_value": 1,
13
+ "#title_display": "after",
14
+ "#required": false,
15
+ "#description_display": "after",
16
+ "#id": "edit-checkbox1",
17
+ "#name": "checkbox1",
18
+ "#value": true,
19
+ "#checked": true
20
+ }
21
+ }