@worksafevictoria/wcl7.5 1.8.0-beta.3 → 1.8.0-beta.5

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.
package/lib/utility.js CHANGED
@@ -35,6 +35,8 @@ function isGovSite(url) {
35
35
  }
36
36
 
37
37
  function navigateToPath(path, newTab, nuxtRouter) {
38
+ debugger
39
+
38
40
  const url = String(path).startsWith('www.') ? `http://${path}` : path
39
41
  const isAbsolute = isAbsoluteUrl(url)
40
42
  const router = nuxtRouter ? nuxtRouter : this.$router
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.8.0-beta.3",
3
+ "version": "1.8.0-beta.5",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -239,6 +239,7 @@ export default {
239
239
  },
240
240
  cardSelected(selectedCard, ev) {
241
241
  debugger;
242
+ console.log("cardSelected selectedCard :- ", selectedCard);
242
243
  this.clearCards();
243
244
  selectedCard.selected = !!!selectedCard.selected;
244
245
  const selectedCardModelIndex = this.getChildIndex(selectedCard);
@@ -403,7 +403,7 @@ export default {
403
403
  methods: {
404
404
  cardClicked(ev) {
405
405
  debugger;
406
- console.log("cardClicked this.isSelectable :- ", this.isSelectable);
406
+
407
407
  if (this.isSelectable) {
408
408
  this.parentGrid.cardSelected(this, ev);
409
409
  }
@@ -57,70 +57,73 @@
57
57
  <div style="padding-top: 20px;">
58
58
  <hr>
59
59
  </div>
60
- <row >
60
+ <!-- Contacts, if any -->
61
+ <div v-if="validContacts">
62
+ <row >
61
63
  <column >
62
64
  <h4>Contact Information</h4>
63
65
  </column>
64
66
  </row>
65
- <row>
66
- <column sm="2" class="label">
67
+ <row v-if="item.contact1 !== '' || item.contact2 !== ''">
68
+ <column sm="2" class="label" v-if="item.contact1 !== ''">
67
69
  Contact
68
70
  </column>
69
- <column sm="4" class="hscp-additional-records">
71
+ <column sm="4" class="hscp-additional-records" v-if="item.contact1 !== ''">
70
72
  {{item.contact1}}
71
73
  </column>
72
- <column sm="2" class="label">
74
+ <column sm="2" class="label" v-if="item.contact2 !== ''">
73
75
  Contact
74
76
  </column>
75
- <column sm="4" class="hscp-additional-records">
77
+ <column sm="4" class="hscp-additional-records" v-if="item.contact2 !== ''">
76
78
  {{item.contact2}}
77
79
  </column>
78
80
  </row>
79
- <row>
80
- <column sm="2" class="label">
81
+ <row v-if="item.phone1 !== '' || item.phone2 !== ''">
82
+ <column sm="2" class="label" v-if="item.phone1 !== ''">
81
83
  Phone
82
84
  </column>
83
- <column sm="4" class="hscp-additional-records">
85
+ <column sm="4" class="hscp-additional-records" v-if="item.phone1 !== ''">
84
86
  {{item.phone1}}
85
87
  </column>
86
- <column sm="2" class="label">
88
+ <column sm="2" class="label" v-if="item.phone2 !== ''">
87
89
  Phone
88
90
  </column>
89
- <column sm="4" class="hscp-additional-records">
91
+ <column sm="4" class="hscp-additional-records" v-if="item.phone2 !== ''">
90
92
  {{item.phone2}}
91
93
  </column>
92
94
  </row>
93
- <row>
94
- <column sm="2" class="label">
95
+ <row v-if="item.email1 !== '' || item.email2 !== ''">
96
+ <column sm="2" class="label" v-if="item.email1 !== ''">
95
97
  Email
96
98
  </column>
97
- <column sm="4" class="hscp-additional-records">
99
+ <column sm="4" class="hscp-additional-records" v-if="item.email1 !== ''">
98
100
  {{item.email1}}
99
101
  </column>
100
- <column sm="2" class="label">
102
+ <column sm="2" class="label" v-if="item.email2 !== ''">
101
103
  Email
102
104
  </column>
103
- <column sm="4" class="hscp-additional-records">
105
+ <column sm="4" class="hscp-additional-records" v-if="item.email1 !== ''">
104
106
  {{item.email2}}
105
107
  </column>
106
108
  </row>
109
+ </div>
110
+ <div v-if="item.trainingVenues.length">
107
111
  <row class="row-hscp-additional">
108
112
  <column>
109
113
  <h4>Training Venue Locations</h4>
110
114
  </column>
111
115
  </row>
112
116
  <row class="hscp-additional-records">
113
- <column v-if="item.trainingVenues.length" >
117
+ <column >
114
118
  <ul>
115
119
  <li v-for="(venue) in item.trainingVenues.split(',')" :key="venue.id">
116
120
  {{venue}}
117
121
  </li>
118
122
  </ul>
119
123
  </column>
120
- <column v-else-if="!item.trainingVenues.length">
121
- <p>No training venues</p>
122
- </column>
123
124
  </row>
125
+ </div>
126
+
124
127
  <row class="row-hscp-additional">
125
128
  <column>
126
129
  <h4>Training Courses</h4>
@@ -170,6 +173,13 @@ export default {
170
173
  gMapLink() {
171
174
  return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
172
175
  },
176
+ validContacts() {
177
+ if (this.item.contact1 === '' && this.item.contact2 === '' && this.item.phone1 === '' && this.item.phone2 === '' && this.item.email1 === '' && this.item.email2 === '') {
178
+ return false
179
+ } else {
180
+ return true
181
+ }
182
+ }
173
183
 
174
184
  },
175
185
  methods: {
@@ -206,12 +216,11 @@ export default {
206
216
  align-content: end;
207
217
  max-width: 20px;
208
218
  padding-right: 0px;
209
- padding-bottom: 10px;
210
219
  float:right;
211
220
  }
212
221
  .paragraph--directory__records--hscp {
213
222
 
214
- padding-bottom: 20px !important;
223
+ padding-bottom: 30px !important;
215
224
 
216
225
  a {
217
226
  color: $black;
@@ -236,7 +236,7 @@ export default {
236
236
  },
237
237
 
238
238
  reset() {
239
- this.collapseOrgs('')
239
+ this.collapseOrgs('No')
240
240
  this.hideReset = true
241
241
  this.searchOrg = ''
242
242
  this.searchCourse = ''
@@ -249,7 +249,7 @@ export default {
249
249
 
250
250
  if (this.searchOrg.length || this.searchSub.length || this.searchCourse.length || this.searchThemes.length) {
251
251
  // don't set focus
252
- this.collapseOrgs('')
252
+ // don't collapseOrgs
253
253
  } else {
254
254
  // set focus to top element - used instead of scrollTo
255
255
  this.collapseOrgs('Yes')
@@ -257,6 +257,7 @@ export default {
257
257
  },
258
258
 
259
259
  collapseOrgs(focusLink) {
260
+ // called by pageChanged and reset. pageChanged called by filter and by pagination links
260
261
  const aLinks = document.getElementsByName('titleLink')
261
262
  // Convert nodelist to array
262
263
  let linksArr = Array.from(aLinks)
@@ -265,9 +266,9 @@ export default {
265
266
  .filter((link) => link.getAttribute('aria-expanded') === 'true')
266
267
  .forEach((link) => link.click())
267
268
 
268
- if (focusLink === 'Yes') {
269
- linksArr[0].focus()
270
- }
269
+ if (focusLink === 'Yes') {
270
+ linksArr[0].focus()
271
+ }
271
272
  }
272
273
 
273
274
  },
@@ -18,14 +18,14 @@
18
18
  :force-lg-columns-per-row="1"
19
19
  :force-md-columns-per-row="1"
20
20
  :cards="results"
21
- :is-selectable="isSelectable"
21
+ :is-selectable="true"
22
22
  :size="'full'"
23
23
  :row-spacing="'none'"
24
24
  :no-padding-top="true"
25
25
  @selected="onSelectResult"
26
- @selected-title="onSelectCardTitle"
27
26
  >
28
27
  <template v-slot:cardItem="{ card }">
28
+ <span class="d-none">card.link :- {{ card.link }}</span>
29
29
  <card-grid-item
30
30
  :header-size="isTypeahead ? 'medium' : 'large'"
31
31
  :card-header-title="card.title"
@@ -38,13 +38,13 @@
38
38
  ? truncate(card.description, 144)
39
39
  : card.htmlSnippet || ''
40
40
  "
41
+ :link="card.link ? card.link : false"
41
42
  :strip-description-html="true"
42
43
  :taxonomies="{
43
44
  industry: card.industry,
44
45
  topic: card.topic,
45
46
  language: card.language,
46
47
  }"
47
- :is-card-title-selectable="isCardTitleSelectable"
48
48
  />
49
49
  </template>
50
50
  <template
@@ -146,9 +146,11 @@ export default {
146
146
  },
147
147
  onSelectCardTitle(card) {
148
148
  debugger;
149
+ console.log("onSelectCardTitle :- ", card);
150
+
149
151
  navigateToPath.call(
150
152
  this,
151
- card?.selectedCard?.link.match(/https?:\/\/[^\/]+(\/[^?#]*)/)[1], // open link in current environment
153
+ card?.selectedCard?.link,
152
154
  card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
153
155
  );
154
156
  this.$nextTick(() => this.$emit("selected-title"));
@@ -158,9 +160,13 @@ export default {
158
160
  }
159
161
  },
160
162
  onSelectResult(card) {
163
+ debugger;
164
+ console.log("onSelectResult card:- ", card);
165
+ console.log("onSelectResult card?.selectedCard?.link:- ", card?.selectedCard?.link);
166
+
161
167
  navigateToPath.call(
162
168
  this,
163
- card?.selectedCard?.link.match(/https?:\/\/[^\/]+(\/[^?#]*)/)[1], // title click is used for search result, but change also included here
169
+ card?.selectedCard?.link, // title click is used for search result, but change also included here
164
170
  card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
165
171
  );
166
172
  this.$nextTick(() => this.$emit("selected"));
@@ -5,7 +5,8 @@ const contentParser = () => {
5
5
  results: [
6
6
  {
7
7
  title: 'Content title 1',
8
- description: 'Content description 2'
8
+ description: 'Content description 2',
9
+ link: '/mental-health'
9
10
  }
10
11
  ],
11
12
  offset: 0,
@@ -42,8 +42,6 @@
42
42
  :offset="searchResults && searchResults.offset"
43
43
  :page-limit="pageLimit"
44
44
  :content-parser="contentParser"
45
- :is-selectable="true"
46
- :is-card-title-selectable="true"
47
45
  @selected="$emit('selected')"
48
46
  @pageChanged="pageChanged"
49
47
  />
@@ -233,9 +231,6 @@ export default {
233
231
  }
234
232
  },
235
233
  onSearch(e) {
236
- debugger;
237
- console.log("this.searchType:- ", this.searchType);
238
-
239
234
  const { path } = this.$route || {};
240
235
 
241
236
  // Home page