@worksafevictoria/wcl7.5 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/package.json +3 -2
  2. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +15 -19
  3. package/src/components/Global/AppFooter/styles.scss +3 -0
  4. package/src/components/Global/DirectoryFilters/index.vue +3 -0
  5. package/src/components/Paragraphs/Chart/Constants.js +479 -479
  6. package/src/components/Paragraphs/Directory/{Records/HSCP → HSCP/Records/SingleRecord}/index.stories.js +4 -3
  7. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +321 -0
  8. package/src/components/Paragraphs/Directory/HSCP/Records/index.stories.js +19 -0
  9. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +345 -0
  10. package/src/components/Paragraphs/Directory/HSCP/Records/pagination.vue +179 -0
  11. package/src/components/Paragraphs/Directory/Records/CJ/index.vue +1 -1
  12. package/src/components/Paragraphs/Directory/Records/ISP/index.vue +1 -1
  13. package/src/components/Paragraphs/Directory/Records/PRS/index.stories.js +34 -0
  14. package/src/components/Paragraphs/Directory/Records/PRS/index.vue +5 -1
  15. package/src/components/Paragraphs/Directory/Records/index.storieshide.js +47 -0
  16. package/src/components/Paragraphs/Directory/Records/index.vue +18 -35
  17. package/src/components/Paragraphs/Directory/{Records/styles.scss → styles.scss} +4 -3
  18. package/src/components/Paragraphs/Map/Constants.js +4790 -0
  19. package/src/components/Paragraphs/Map/index.mdx +29 -0
  20. package/src/components/Paragraphs/Map/index.stories.js +15 -0
  21. package/src/components/Paragraphs/Map/index.vue +295 -0
  22. package/src/components/Paragraphs/Map/postcode_location.json +3543 -0
  23. package/src/components/SubComponents/Breadcrumb/index.vue +4 -0
  24. package/src/components/SubComponents/FormInstance/components/renderer/index.vue +23 -7
  25. package/src/components/SubComponents/FormInstance/models/overrides/file.js +7 -2
  26. package/src/components/SubComponents/Search/index.vue +7 -2
  27. package/src/index.js +4 -0
  28. package/src/mock/course-provider.js +273 -0
  29. package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +0 -334
@@ -0,0 +1,179 @@
1
+ <!-- Copied from pagination used by ISP in the website repository - paginates a list in place instead of search for BE values. -->
2
+ <template>
3
+ <div class="pagination">
4
+ <div>
5
+ {{ `${totalPages} ${pageOrPages} of results` }}
6
+ </div>
7
+ <ul>
8
+ <li v-if="!isFirstPage" class="pagination-item">
9
+ <button type="button" :disabled="isFirstPage" @click="onClickFirstPage">
10
+ First
11
+ </button>
12
+ </li>
13
+ <li v-if="!isFirstPage" class="pagination-item">
14
+ <button
15
+ type="button"
16
+ :disabled="isFirstPage"
17
+ @click="onClickPreviousPage"
18
+ >
19
+ Previous
20
+ </button>
21
+ </li>
22
+ <!-- Visible Buttons Start -->
23
+ <li v-for="(page, i) in pages" :key="i" class="pagination-item">
24
+ <button
25
+ type="button"
26
+ :disabled="page.isDisabled"
27
+ :class="{ active: isPageActive(page.name) }"
28
+ :aria-current="isPageActive(page.name) ? 'page' : false"
29
+ @click="onClickPage(page.name)"
30
+ >
31
+ {{ page.name }}
32
+ </button>
33
+ </li>
34
+ <!-- Visible Buttons End -->
35
+ <li v-if="!isLastPage" class="pagination-item">
36
+ <button type="button" :disabled="isLastPage" @click="onClickNextPage">
37
+ Next
38
+ </button>
39
+ </li>
40
+ <li v-if="!isLastPage" class="pagination-item">
41
+ <button type="button" :disabled="isLastPage" @click="onClickLastPage">
42
+ Last
43
+ </button>
44
+ </li>
45
+ </ul>
46
+ </div>
47
+ </template>
48
+ <script>
49
+ export default {
50
+ props: {
51
+ maxVisibleButtons: {
52
+ type: Number,
53
+ required: false,
54
+ default: 3
55
+ },
56
+ totalPages: {
57
+ type: Number,
58
+ required: true
59
+ },
60
+ total: {
61
+ type: Number,
62
+ required: true
63
+ },
64
+ perPage: {
65
+ type: Number,
66
+ required: true
67
+ },
68
+ currentPage: {
69
+ type: Number,
70
+ required: true
71
+ }
72
+ },
73
+ computed: {
74
+ startPage() {
75
+ // When on the first page
76
+ if (this.currentPage === 1) {
77
+ return 1
78
+ }
79
+ // When on the last page
80
+ if (this.currentPage === this.totalPages) {
81
+ return this.totalPages - 1
82
+ }
83
+ // When inbetween
84
+ return this.currentPage - 1
85
+ },
86
+ pages() {
87
+ const range = []
88
+ for (
89
+ let i = this.startPage;
90
+ i <=
91
+ Math.min(this.startPage + this.maxVisibleButtons - 1, this.totalPages);
92
+ i++
93
+ ) {
94
+ range.push({
95
+ name: i,
96
+ isDisabled: i === this.currentPage
97
+ })
98
+ }
99
+ return range
100
+ },
101
+ isFirstPage() {
102
+ return this.currentPage === 1
103
+ },
104
+ isLastPage() {
105
+ return this.currentPage === this.totalPages
106
+ },
107
+ pageOrPages() {
108
+ return this.totalPages > 1 ? 'pages' : 'page'
109
+ }
110
+ },
111
+ methods: {
112
+ onClickFirstPage() {
113
+ this.$emit('pagechanged', 1)
114
+ },
115
+ onClickPreviousPage() {
116
+ this.$emit('pagechanged', this.currentPage - 1)
117
+ },
118
+ onClickPage(page) {
119
+ this.$emit('pagechanged', page)
120
+ },
121
+ onClickNextPage() {
122
+ this.$emit('pagechanged', this.currentPage + 1)
123
+ },
124
+ onClickLastPage() {
125
+ this.$emit('pagechanged', this.totalPages)
126
+ },
127
+ isPageActive(page) {
128
+ return this.currentPage === page
129
+ }
130
+ }
131
+ }
132
+ </script>
133
+
134
+ <style lang="scss" scoped>
135
+ @import '../../../../../includes/scss/all.scss';
136
+
137
+ .pagination {
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ flex-direction: column;
142
+ ul {
143
+ display: flex;
144
+ margin: 16px 0;
145
+ padding: 0;
146
+ }
147
+
148
+ li {
149
+ list-style: none;
150
+ padding: 0;
151
+ margin-right: 6px;
152
+ margin-left: 0;
153
+ margin-top: 0;
154
+ margin-bottom: 0;
155
+
156
+ button {
157
+ background: $white;
158
+ color: $black;
159
+ border: 1px solid $gray;
160
+ padding: 10px 12px;
161
+ font-weight: normal;
162
+ border-radius: 8px;
163
+ cursor: pointer;
164
+
165
+ &:hover {
166
+ background: $lightgray;
167
+ }
168
+ &:disabled,
169
+ &[disabled] {
170
+ background: $black;
171
+ color: $white;
172
+ font-weight: 700;
173
+ border: 1px solid transparent;
174
+ cursor: default;
175
+ }
176
+ }
177
+ }
178
+ }
179
+ </style>
@@ -55,5 +55,5 @@ export default {
55
55
  }
56
56
  </script>
57
57
  <style lang="scss" scoped>
58
- @import '../styles.scss';
58
+ @import '../../styles.scss';
59
59
  </style>
@@ -84,5 +84,5 @@ export default {
84
84
  }
85
85
  </script>
86
86
  <style lang="scss" scoped>
87
- @import '../styles.scss';
87
+ @import '../../styles.scss';
88
88
  </style>
@@ -0,0 +1,34 @@
1
+ import prsRecord from './index.vue'
2
+
3
+ const cpData = {
4
+ id: '1',
5
+ title: 'Australian Nurses and Midwifery Federation - Victorian Branch',
6
+ meta: {
7
+ court: ['Federal Court of Australia'],
8
+ legislation: ['Work Health and Safety Act 2011'],
9
+ section: '21(1); 21(2)(a) & 5A(1)',
10
+ dateOutcome: '2023-09-15',
11
+ fine: '$10,000',
12
+ costs: '$2,000',
13
+ restitution: '$5,000',
14
+ datePublished: '2023-09-20',
15
+ appeal: 'None',
16
+ category: ['Workplace Safety']
17
+ },
18
+ field_prs_sentence: 'Company fined for OH&S breach.',
19
+ outcome: '<div><p><strong>Background</strong></p><p>Company found guilty of OH&S breach and fined.</p></div>',
20
+ attachment: 'case_details.pdf',
21
+ attachment_src: 'https://www.example.com/case_details.pdf'
22
+ };
23
+
24
+ export default {
25
+ title: 'Paragraphs/Directory/PRS',
26
+ component: prsRecord,
27
+ tags: ['autodocs']
28
+ };
29
+
30
+ export const CourseProvider = {};
31
+
32
+ CourseProvider.args = {
33
+ item: cpData,
34
+ };
@@ -21,8 +21,12 @@
21
21
  <script>
22
22
  import RecordDetails from './recordDetails.vue'
23
23
  import RecordContent from './recordContent.vue'
24
+ import { BButton, BCollapse } from 'bootstrap-vue-next'
25
+
24
26
  export default {
25
27
  components: {
28
+ BButton,
29
+ BCollapse,
26
30
  RecordDetails,
27
31
  RecordContent
28
32
  },
@@ -55,5 +59,5 @@ export default {
55
59
  }
56
60
  </script>
57
61
  <style lang="scss" scoped>
58
- @import '../styles.scss';
62
+ @import '../../styles.scss';
59
63
  </style>
@@ -0,0 +1,47 @@
1
+ import Records from './index.vue'
2
+ import { hscpData } from '../../../../mock/course-provider'
3
+
4
+ const hscpOptions =
5
+ {
6
+ field_directory_exposefilters: 'full',
7
+ field_directory_rows: 15,
8
+ field_directory_type: 'hscp'
9
+ }
10
+
11
+ const hscpTaxonomies = [
12
+ {
13
+ name: 'Service Type',
14
+ record_id: 'record_hscp_course',
15
+ terms: ['HSR Iniitial', 'HSR Refresher']
16
+ }
17
+ ]
18
+
19
+ export default {
20
+ title: 'Paragraphs/Directory/Records',
21
+ component: Records,
22
+ tags: ['autodocs'],
23
+ data() {
24
+ return {
25
+ hscpData
26
+ }
27
+ },
28
+ argTypes: {
29
+ fetchRecords: {
30
+ control: 'function',
31
+ table: { disable: true }
32
+ },
33
+ fetchFilters: {
34
+ control: 'function',
35
+ table: { disable: true }
36
+ }
37
+ },
38
+ }
39
+
40
+ export const CourseProvider = {
41
+ args: {
42
+ options: hscpOptions,
43
+ items: hscpData,
44
+ taxonomies: hscpTaxonomies,
45
+ showFilters: true
46
+ }
47
+ }
@@ -2,13 +2,8 @@
2
2
  <div v-if="items.length" class="paragraph--directory__records">
3
3
  <template v-for="(item, index) in flatRecords">
4
4
  <prs-record v-if="item.type === 'prs'" :key="index" :item="item" />
5
- <isp-record
6
- v-if="item.type === 'isp'"
7
- :key="index"
8
- :item="item"
9
- :location="baseLocation"
10
- />
11
5
  <hscp-record v-if="item.type === 'hscp'" :key="index" :item="item" />
6
+ <isp-record v-if="item.type === 'isp'" :key="index" :item="item" :location="baseLocation" />
12
7
  <cj-record v-if="item.type === 'cj'" :key="index" :item="item" />
13
8
  </template>
14
9
  </div>
@@ -17,14 +12,14 @@
17
12
  import PrsRecord from './PRS/index.vue'
18
13
  import IspRecord from './ISP/index.vue'
19
14
  import CjRecord from './CJ/index.vue'
20
- import HscpRecord from './HSCP/index.vue'
15
+ import HscpRecord from './../HSCP/Records/SingleRecord/index.vue'
21
16
 
22
17
  export default {
23
18
  components: {
24
19
  PrsRecord,
25
20
  IspRecord,
26
21
  CjRecord,
27
- HscpRecord,
22
+ HscpRecord
28
23
  },
29
24
  props: {
30
25
  items: {
@@ -147,35 +142,23 @@ export default {
147
142
  },
148
143
  })
149
144
  }
150
- if (record.record_type === 'hscp') {
151
- let {
152
- record_id,
153
- data: {
154
- attributes: {
155
- title,
156
- hscp: {
157
- fulladdress,
158
- workphone,
159
- tollfreephone,
160
- email,
161
- website,
162
- courses,
163
- companyid,
164
- } = {},
165
- } = {},
166
- } = {},
167
- } = record
145
+ if (record.type === 'hscp') {
168
146
  flatRecords.push({
169
- id: record_id,
170
147
  type: 'hscp',
171
- title,
172
- fulladdress,
173
- workphone,
174
- tollfreephone,
175
- email,
176
- website,
177
- courses,
178
- companyid,
148
+ title: record.title,
149
+ fullAddress: record.fullAddress,
150
+ workPhone: record.workPhone,
151
+ tollfreePhone: record.tollfreePhone,
152
+ email: record.email,
153
+ website: record.website,
154
+ contact1: record.contact1,
155
+ email1: record.email1,
156
+ phone1: record.phone1,
157
+ contact2: record.contact2,
158
+ email2: record.email2,
159
+ phone2: record.phone2,
160
+ courses: record.courses,
161
+ trainingVenues: record.trainingVenues
179
162
  })
180
163
  }
181
164
  if (record.record_type === 'cj') {
@@ -1,4 +1,4 @@
1
- @import '../../../../includes/scss/all';
1
+ @import '../../../includes/scss/all.scss';
2
2
 
3
3
  @mixin itemStyle() {
4
4
  text-align: left;
@@ -30,10 +30,11 @@
30
30
 
31
31
  &--isp,
32
32
  &--hscp,
33
- &--cj {
33
+ &--cj {
34
34
  @include defaultStyle();
35
35
  @include itemStyle();
36
36
  }
37
+
37
38
  &--prs {
38
39
  @include defaultStyle();
39
40
  border: 1px solid $gray;
@@ -81,6 +82,7 @@
81
82
  font-size: 16px;
82
83
  border-top: 2px solid $lightgray;
83
84
  padding: 16px;
85
+ }
84
86
 
85
87
  :deep(.attachment_name a) {
86
88
  text-decoration: underline;
@@ -124,7 +126,6 @@
124
126
  font-weight: bold;
125
127
  margin-bottom: 5px;
126
128
  }
127
- }
128
129
  }
129
130
  }
130
131
  }