@worksafevictoria/wcl7.5 1.7.3 → 1.8.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.
@@ -5,10 +5,7 @@
5
5
  v-if="!(isTypeahead && numFound > 0) && !isLoading"
6
6
  class="app-search-result__found"
7
7
  >
8
- <span
9
- >{{ numFound }} results found for
10
- {{ !suggestion ? query : suggestion }}</span
11
- >
8
+ <span>{{ numFound }} results found for {{ !suggestion ? query : suggestion }}</span>
12
9
  </p>
13
10
  <p
14
11
  v-if="results && results.length > 0 && suggestion"
@@ -21,7 +18,7 @@
21
18
  :force-lg-columns-per-row="1"
22
19
  :force-md-columns-per-row="1"
23
20
  :cards="results"
24
- :is-selectable="false"
21
+ :is-selectable="isSelectable"
25
22
  :size="'full'"
26
23
  :row-spacing="'none'"
27
24
  :no-padding-top="true"
@@ -82,14 +79,14 @@
82
79
  </template>
83
80
 
84
81
  <script>
85
- import CardGrid from '../../../Common/CardGrid/index.vue'
86
- import CardGridItem from '../../../Common/CardGridItem/index.vue'
87
- import { navigateToPath } from '../../../../../lib/utility'
88
- import Pagination from '../../Pagination/index.vue'
89
- import Column from '../../../Containers/Column/index.vue'
82
+ import CardGrid from "../../../Common/CardGrid/index.vue";
83
+ import CardGridItem from "../../../Common/CardGridItem/index.vue";
84
+ import { navigateToPath } from "../../../../../lib/utility";
85
+ import Pagination from "../../Pagination/index.vue";
86
+ import Column from "../../../Containers/Column/index.vue";
90
87
 
91
88
  export default {
92
- name: 'SearchListing',
89
+ name: "SearchListing",
93
90
  components: { CardGrid, CardGridItem, Pagination, Column },
94
91
  props: {
95
92
  isTypeahead: {
@@ -109,7 +106,7 @@ export default {
109
106
  query: {
110
107
  type: String,
111
108
  required: false,
112
- default: '',
109
+ default: "",
113
110
  },
114
111
  results: {
115
112
  type: Array,
@@ -132,49 +129,54 @@ export default {
132
129
  type: Boolean,
133
130
  default: false,
134
131
  },
132
+ isSelectable: {
133
+ type: Boolean,
134
+ default: true,
135
+ },
135
136
  },
136
137
  methods: {
137
138
  onClickItem(event, item, index) {
138
- this.$emit('select-item', event.target, item, index)
139
+ this.$emit("select-item", event.target, item, index);
139
140
  },
140
141
  truncate(value, limit) {
141
142
  if (value.length > limit) {
142
- value = value.substring(0, limit - 3) + '...'
143
+ value = value.substring(0, limit - 3) + "...";
143
144
  }
144
- return value
145
+ return value;
145
146
  },
146
147
  onSelectCardTitle(card) {
148
+ debugger;
147
149
  navigateToPath.call(
148
150
  this,
149
151
  card?.selectedCard?.link.match(/https?:\/\/[^\/]+(\/[^?#]*)/)[1], // open link in current environment
150
- card?.ev?.ctrlKey === true || card?.ev?.metaKey === true,
151
- )
152
- this.$nextTick(() => this.$emit('selected-title'))
152
+ card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
153
+ );
154
+ this.$nextTick(() => this.$emit("selected-title"));
153
155
 
154
156
  if (this.$gtm) {
155
- this.fireGTM(card)
157
+ this.fireGTM(card);
156
158
  }
157
159
  },
158
160
  onSelectResult(card) {
159
161
  navigateToPath.call(
160
162
  this,
161
163
  card?.selectedCard?.link.match(/https?:\/\/[^\/]+(\/[^?#]*)/)[1], // title click is used for search result, but change also included here
162
- card?.ev?.ctrlKey === true || card?.ev?.metaKey === true,
163
- )
164
- this.$nextTick(() => this.$emit('selected'))
164
+ card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
165
+ );
166
+ this.$nextTick(() => this.$emit("selected"));
165
167
 
166
168
  if (this.$gtm) {
167
- this.fireGTM(card)
169
+ this.fireGTM(card);
168
170
  }
169
171
  },
170
172
  fireGTM(card) {
171
173
  let attrs = {
172
174
  location:
173
- this.$route?.path === '/'
174
- ? 'Homepage'
175
- : this.$route?.path === '/search'
176
- ? 'Search Page'
177
- : this.$route?.path,
175
+ this.$route?.path === "/"
176
+ ? "Homepage"
177
+ : this.$route?.path === "/search"
178
+ ? "Search Page"
179
+ : this.$route?.path,
178
180
  label: this.query,
179
181
  results: this.results.length,
180
182
  clickText: card.selectedCard.title,
@@ -184,20 +186,20 @@ export default {
184
186
  industry: card?.selectedCard?.industry,
185
187
  topic: card?.selectedCard?.topic,
186
188
  language: card?.selectedCard?.language,
187
- }
188
- this.$gtm.push({ event: 'custom.search.site.result', ...attrs })
189
+ };
190
+ this.$gtm.push({ event: "custom.search.site.result", ...attrs });
189
191
  },
190
192
  showMoreResults() {
191
193
  if (this.$nuxt) {
192
- this.$router.push('/search?q=' + this.query)
194
+ this.$router.push("/search?q=" + this.query);
193
195
  }
194
196
  },
195
197
  },
196
- }
198
+ };
197
199
  </script>
198
200
 
199
201
  <style lang="scss" scoped>
200
- @import '../../../../includes/scss/all';
202
+ @import "../../../../includes/scss/all";
201
203
  .app-search-result {
202
204
  &__found,
203
205
  &__suggestion {
@@ -37,8 +37,8 @@ const DefaultSearch = (args) => ({
37
37
  setup () {
38
38
  return { args }
39
39
  },
40
- template: `<search
41
- v-bind="args"
40
+ template: `<search
41
+ v-bind="args"
42
42
  ref="solrsearch" />`
43
43
  })
44
44