@worksafevictoria/wcl7.5 1.7.0 → 1.7.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.
@@ -3,51 +3,51 @@
3
3
  <!-- Main details -->
4
4
  <container>
5
5
  <row class="records">
6
- <column md="2" sm="12" class="title" >
7
- <a v-if="item.title" href="javascript:void(0)" @click="this.visible = !this.visible">
8
- {{ item.title }}
9
- </a>
10
- </column>
11
- <column md="2" sm="12" class="address" >
12
- <a v-if="item.fullAddress" target="_blank" :href="gMapLink"><span class="sr-only visually-hidden">Address</span>
13
- {{ item.fullAddress }}
14
- </a>
15
- </column>
16
- <column md="2" sm="12" class="coldata longstring" >
17
- <div class="label">Email</div>
18
- <a v-if="item.email" target="_blank" :href="`mailto:${item.email}`"><span class="sr-only visually-hidden">Email address</span>
19
- {{ item.email }}
20
- </a>
21
- </column>
22
- <column md="3" sm="12" class="coldata longstring" >
23
- <div class="label">Website</div>
24
- <a v-if="item.website" target="_blank" :href="`${item.website}`"><span class="sr-only visually-hidden">Website address</span>
25
- {{ item.website }}
6
+ <column md="2" sm="12" class="title" >
7
+ <a name="titleLink" v-if="item.title" href="javascript:void(0)" :aria-expanded="visible ? 'true' : 'false'" @click="this.visible = !this.visible">
8
+ {{ item.title }}
9
+ </a>
10
+ </column>
11
+ <column md="2" sm="12" class="address" >
12
+ <a v-if="item.fullAddress" target="_blank" :href="gMapLink"><span class="sr-only visually-hidden">Address</span>
13
+ {{ item.fullAddress }}
14
+ </a>
15
+ </column>
16
+ <column md="2" sm="12" class="coldata longstring" >
17
+ <div class="label">Email</div>
18
+ <a v-if="item.email" target="_blank" :href="`mailto:${item.email}`"><span class="sr-only visually-hidden">Email address</span>
19
+ {{ item.email }}
20
+ </a>
21
+ </column>
22
+ <column md="3" sm="12" class="coldata longstring" >
23
+ <div class="label">Website</div>
24
+ <a v-if="item.website" target="_blank" :href="`${item.website}`"><span class="sr-only visually-hidden">Website address</span>
25
+ {{ item.website }}
26
+ </a>
27
+ </column>
28
+ <column md="2" sm="12" class="coldata" >
29
+ <div class="label">Phone</div>
30
+ <a v-if="item.tollfreePhone || item.workPhone" :href="`tel:${item.tollfreephone || item.workphone}`"><span class="sr-only visually-hidden">Phone number</span>
31
+ {{ item.tollfreePhone || item.workPhone }}
32
+ </a>
33
+ </column>
34
+ </row>
35
+ <div class="hscp-caret" >
36
+ <a v-if="visible" href="javascript:void(0)" @click="this.visible = false">
37
+ <img
38
+ :src="CaretUp"
39
+ height="12"
40
+ width="17"
41
+ alt="Expand Detail">
26
42
  </a>
27
- </column>
28
- <column md="2" sm="12" class="coldata" >
29
- <div class="label">Phone</div>
30
- <a v-if="item.tollfreePhone || item.workPhone" :href="`tel:${item.tollfreephone || item.workphone}`"><span class="sr-only visually-hidden">Phone number</span>
31
- {{ item.tollfreePhone || item.workPhone }}
43
+ <a v-if="!visible" href="javascript:void(0)" @click="this.visible = true">
44
+ <img
45
+ :src="CaretDown"
46
+ height="12"
47
+ width="17"
48
+ alt="Expand Detail">
32
49
  </a>
33
- </column>
34
- </row>
35
- <div class="hscp-caret" >
36
- <a v-if="visible" href="javascript:void(0)" @click="this.visible = false">
37
- <img
38
- :src="CaretUp"
39
- height="12"
40
- width="17"
41
- alt="Expand Detail">
42
- </a>
43
- <a v-if="!visible" href="javascript:void(0)" @click="this.visible = true">
44
- <img
45
- :src="CaretDown"
46
- height="12"
47
- width="17"
48
- alt="Expand Detail">
49
- </a>
50
- </div>
50
+ </div>
51
51
  </container>
52
52
 
53
53
  <!-- Additional Content -->
@@ -156,7 +156,7 @@ export default {
156
156
  item: {
157
157
  type: Object,
158
158
  required: true
159
- }
159
+ },
160
160
  },
161
161
  data() {
162
162
  return {
@@ -169,6 +169,7 @@ export default {
169
169
  gMapLink() {
170
170
  return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
171
171
  },
172
+
172
173
  },
173
174
  methods: {
174
175
  handleClick(title) {
@@ -7,25 +7,25 @@
7
7
  <label class="visually-hidden" for="search-directory">
8
8
  Search by keyword (typed keyword automatically filters below results)
9
9
  </label>
10
- <input type="text" v-model="searchOrg" placeholder="Search organisation" class="search">
10
+ <input type="text" v-model="searchOrg" placeholder="Organisation" class="search">
11
11
  </column>
12
12
  <column xxl="2" xl="3" md="4" sm="6">
13
13
  <label class="visually-hidden" for="search-directory">
14
14
  Search by suburb (typed suburb automatically filters below results)
15
15
  </label>
16
- <input type="text" v-model="searchSub" placeholder="Search suburb" class="search">
16
+ <input type="text" v-model="searchSub" placeholder="Training location" class="search">
17
17
  </column>
18
18
  <!-- Other Filters -->
19
19
  <column xxl="2" xl="3" md="4" sm="6">
20
20
  <select id="filterType" v-model="searchCourse" name="filter" class="selectClass">
21
- <option class="placeholder" value="" disabled hidden selected>Search course type</option>
21
+ <option class="placeholder" value="" disabled hidden selected>Course type</option>
22
22
  <option value="HSR Initial">HSR Initial</option>
23
23
  <option value="HSR Refresher">HSR Refresher</option>
24
24
  </select>
25
25
  </column>
26
26
  <column xxl="2" xl="3" md="4" sm="6">
27
27
  <select id="filterTheme" v-model="searchThemes" name="filter1" class="selectClass">
28
- <option class="placeholder" value="" disabled hidden selected>Search theme</option>
28
+ <option class="placeholder" value="" disabled hidden selected>Theme</option>
29
29
  <option v-for="(opt, i) in themeOptions" :key="i" :value="opt">
30
30
  {{ opt }}
31
31
  </option>
@@ -42,9 +42,9 @@
42
42
  </column>
43
43
  </row>
44
44
  <!-- HSCP Records -->
45
- <div class="hscpRecords">
46
- <template v-for="(item, index) in resultChunks[page]">
47
- <hscp-record v-if="item.type === 'hscp'" :key="index" :item="item" />
45
+ <div class="hscpRecords" >
46
+ <template v-for="(item, index) in resultChunks[page]" >
47
+ <hscp-record v-if="item.type === 'hscp'" :key="index" :item="item"/>
48
48
  </template>
49
49
  </div>
50
50
  <div v-if="filteredRecords.length > 0" align-items="center">
@@ -88,7 +88,7 @@ export default {
88
88
  perPage: 10,
89
89
  page: 0,
90
90
  searchIcon,
91
- hideReset: true,
91
+ hideReset: true
92
92
  }
93
93
  },
94
94
  props: {
@@ -137,7 +137,7 @@ export default {
137
137
 
138
138
  filteredRecords() {
139
139
  let results = this.flatRecords
140
-
140
+
141
141
  if (this.searchOrg.length) {
142
142
  this.hideReset = false
143
143
  results = results.filter(item => item.title.toLowerCase().includes(this.searchOrg.toLowerCase()))
@@ -155,6 +155,11 @@ export default {
155
155
  results = results.filter(item => item.courses.toLowerCase().includes(this.searchThemes.toLowerCase()))
156
156
  }
157
157
  this.filteredItems = results
158
+
159
+ if (this.searchOrg.length || this.searchSub.length || this.searchCourse.length || this.searchThemes.length) {
160
+ this.pageChanged(1)
161
+ }
162
+
158
163
  return results
159
164
  },
160
165
 
@@ -244,29 +249,21 @@ export default {
244
249
 
245
250
  pageChanged(ev) {
246
251
  this.page = ev - 1
247
- if (this.pageResultCount < this.perPage) {
248
- console.log('scroll to records')
249
- this.scrollToRecords()
250
- }
251
- },
252
- scrollToRecords() {
253
- if (this.$refs.records) {
254
- const element = this.$refs.records
255
- const top = element.offsetTop
256
-
257
- const buttons = [...element.querySelectorAll('button')]
258
- if (Array.isArray(buttons) && buttons.length > 0) {
259
- buttons
260
- .filter((button) => button.getAttribute('aria-expanded') === 'true')
261
- .forEach((button) => button.click())
262
-
263
- buttons[0].focus()
264
- }
252
+
253
+ const aLinks = document.getElementsByName('titleLink')
254
+ // Convert nodelist to array
255
+ let linksArr = Array.from(aLinks)
256
+ if (Array.isArray(linksArr) && linksArr.length > 0) {
257
+ linksArr
258
+ .filter((link) => link.getAttribute('aria-expanded') === 'true')
259
+ .forEach((link) => link.click())
265
260
 
266
- window.scrollTo({
267
- top,
268
- behavior: 'smooth',
269
- })
261
+ if (this.searchOrg.length || this.searchSub.length || this.searchCourse.length || this.searchThemes.length) {
262
+ // don't set focus
263
+ } else {
264
+ // set focus to top element - used instead of scrollTo
265
+ linksArr[0].focus()
266
+ }
270
267
  }
271
268
  },
272
269
  }
@@ -22,62 +22,50 @@
22
22
  </row>
23
23
  <row>
24
24
  <column>
25
- <div>
26
- <GoogleMap
27
- api-key="AIzaSyD76GAmQQ6DuxKWf-aLXPZ9pwdz4nOvs2c"
28
- :style="`width: 100%; height: ${mapHeight}`"
29
- :center="center"
30
- :zoom="zoom"
31
- :zoom-control="true"
32
- :mapTypeControl="false"
33
- :streetViewControl="false"
34
- :fullscreenControl="true"
35
- >
36
- <!-- <CustomControl
37
- position="TOP_CENTER"
38
- class="mt-4"
39
- style="background-color: rgba(0, 0, 0, 0.2); border-radius: 5px"
40
- ><row>
41
- <column class="py-2 px-3">
42
- <single-taxonomy
43
- v-for="(t, i) in computedPropFilters"
44
- :key="i"
45
- :ref="`${t.record_id}`"
46
- :data="t"
47
- :results="filteredList.length"
48
- :loading="isFiltering"
49
- class="wcl-directory-filters__filterButton"
50
- @onFilter="onFilter"
51
- />
52
- <filter-button
53
- v-if="!hideReset"
54
- :is-reset="true"
55
- class="wcl-directory-filters__filterButton"
56
- @clicked="reset"
57
- />
58
- </column>
59
- </row>
60
- </CustomControl> -->
61
- <!-- <MarkerCluster> -->
62
- <Marker
63
- v-for="(location, i) in postcodes"
64
- :options="{
65
- position: location.center,
66
- label: `${location.deaths}`,
67
- title: `${location.deaths} ${location.deaths > 1 ? 'deaths' : 'death'}`,
68
- }"
69
- :key="i"
70
- />
71
- <!-- </MarkerCluster> -->
72
- </GoogleMap>
73
- </div>
25
+ <GoogleMap
26
+ api-key="AIzaSyD76GAmQQ6DuxKWf-aLXPZ9pwdz4nOvs2c"
27
+ map-id="18650d0e6b0daeb1"
28
+ :style="`width: 100%; height: ${mapHeight}`"
29
+ :center="center"
30
+ :zoom="zoom"
31
+ :zoom-control="true"
32
+ :mapTypeControl="false"
33
+ :streetViewControl="false"
34
+ :fullscreenControl="true"
35
+ >
36
+ <Polygon
37
+ v-for="(location, i) in lgaBoundaries"
38
+ :options="location"
39
+ :key="i + polygonKey"
40
+ />
41
+ <CustomControl position="BOTTOM_CENTER">
42
+ <h4 v-if="unknownLGA">
43
+ <BBadge variant="light"> Unknown LGA {{ unknownLGA }} </BBadge>
44
+ </h4>
45
+ </CustomControl>
46
+ <AdvancedMarker
47
+ v-for="(location, i) in centerLGA"
48
+ :options="{
49
+ position: location.center,
50
+ title: `${location.lga} (${location.deaths} ${location.deaths > 1 ? 'fatalities' : 'fatality'})`,
51
+ }"
52
+ :key="i"
53
+ :pin-options="{
54
+ background: '#fdcd59',
55
+ glyph: `${location.deaths}`,
56
+ glyphColor: 'black',
57
+ borderColor: '#000000',
58
+ scale: 1,
59
+ }"
60
+ />
61
+ </GoogleMap>
74
62
  </column>
75
63
  </row>
76
64
  </container>
77
65
  </template>
78
66
 
79
67
  <script>
80
- import postcode from './postcode_location.json'
68
+ import lga from './lga-map.json'
81
69
  import {
82
70
  GoogleMap,
83
71
  Marker,
@@ -85,13 +73,15 @@ import {
85
73
  Circle,
86
74
  CustomControl,
87
75
  InfoWindow,
76
+ Polygon,
77
+ AdvancedMarker,
88
78
  } from 'vue3-google-map'
89
79
  import Container from '../../Containers/Container/index.vue'
90
80
  import Column from '../../Containers/Column/index.vue'
91
81
  import Row from '../../Containers/Row/index.vue'
92
82
  import FilterButton from '../../Common/FilterButton/index.vue' // Reset
93
83
  import SingleTaxonomy from '../../Global/DirectoryFilters/SingleTaxonomy/index.vue'
94
- import { BFormGroup, BFormSelect, BButton } from 'bootstrap-vue-next'
84
+ import { BFormGroup, BFormSelect, BButton, BBadge } from 'bootstrap-vue-next'
95
85
 
96
86
  export default {
97
87
  name: 'GeoChart',
@@ -110,6 +100,9 @@ export default {
110
100
  CustomControl,
111
101
  InfoWindow,
112
102
  BButton,
103
+ Polygon,
104
+ AdvancedMarker,
105
+ BBadge,
113
106
  },
114
107
  props: {
115
108
  statsData: { type: Array, default: () => [] },
@@ -118,7 +111,7 @@ export default {
118
111
  },
119
112
  data() {
120
113
  return {
121
- postcode,
114
+ lga,
122
115
  zoom: 7,
123
116
  mapHeight: '700px',
124
117
  center: { lat: -36.5, lng: 145.3 },
@@ -129,6 +122,8 @@ export default {
129
122
  selected: {},
130
123
  availableBundles: [],
131
124
  },
125
+ unknownLGA: 0,
126
+ polygonKey: 1,
132
127
  }
133
128
  },
134
129
  mounted() {
@@ -209,27 +204,50 @@ export default {
209
204
  })
210
205
  return list
211
206
  },
212
- postcodes: function () {
207
+ centerLGA: function () {
213
208
  if (this.filteredList.length > 1) {
214
209
  let location = {}
210
+ this.unknownLGA = 0
215
211
  this.filteredList.forEach((item) => {
216
- if (location[item.POSTCODE]) {
217
- location[item.POSTCODE].deaths++
212
+ if (location[item.LGA]) {
213
+ location[item.LGA].deaths++
218
214
  } else {
219
- let pc = this.postcode.find((obj) => obj.postcode == item.POSTCODE)
215
+ let pc = this.lga.find(
216
+ (obj) =>
217
+ obj.name ==
218
+ item.LGA.replace('-', ' ')
219
+ .toUpperCase()
220
+ .substring(0, obj.name.length),
221
+ )
220
222
  if (pc) {
221
- location[item.POSTCODE] = {
222
- center: { lat: pc.lat, lng: pc.long },
223
+ location[item.LGA] = {
224
+ center: { lat: pc.labelpoint[0], lng: pc.labelpoint[1] },
223
225
  deaths: 1,
226
+ lga: pc.name,
224
227
  }
225
228
  } else {
226
- console.log('🚀 ~ item.POSTCODE:', item.POSTCODE)
229
+ this.unknownLGA++
227
230
  }
228
231
  }
229
232
  })
230
233
  return location
231
234
  }
232
235
  },
236
+ lgaBoundaries: function () {
237
+ let lgaData = lga.map((item) => {
238
+ return {
239
+ strokeColor: '#000000',
240
+ strokeOpacity: 0.8,
241
+ strokeWeight: 1,
242
+ fillColor: '#bababa',
243
+ fillOpacity: 0.5,
244
+ paths: item.boundaries.map((item) => {
245
+ return { lng: item[0], lat: item[1] }
246
+ }),
247
+ }
248
+ })
249
+ return lgaData
250
+ },
233
251
  },
234
252
  methods: {
235
253
  resize() {