@salesforcedevs/dx-components 1.3.254-alpha.1 → 1.3.254-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.254-alpha.1",
3
+ "version": "1.3.254-alpha.3",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -61,18 +61,25 @@ const resultsTemplatesInnerHtml = `
61
61
  <% } %>
62
62
  <% } %>
63
63
  </div>
64
- <a
65
- href="<%= raw.uri %>"
66
- class="dx-result-title CoveoResultLink"
67
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
68
- target="_blank"
69
- <% } %>
70
- >
71
- <%= title %>
72
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
73
- <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
74
- <% } %>
75
- </a>
64
+ <% if (raw.content_type === "community posts") { %>
65
+ <a
66
+ class="dx-result-title CoveoResultLink"
67
+ data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
68
+ >
69
+ <% } else { %>
70
+ <a
71
+ href="<%= raw.uri %>"
72
+ class="dx-result-title CoveoResultLink"
73
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
74
+ target="_blank"
75
+ <% } %>
76
+ >
77
+ <% } %>
78
+ <%= title %>
79
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
80
+ <svg xmlns="http://www.w3.org/2000/svg" style="display: inline; vertical-align: baseline;" fill="var(--dx-g-blue-vibrant-20)" width="20" height="20" part="svg" aria-hidden="true"><use xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#new_window"></use></svg>
81
+ <% } %>
82
+ </a>
76
83
  <span class="CoveoFieldValue" data-field="@sflastmodifieddate" data-helper="postedDate" data-html-value="true"></span>
77
84
  <p class="dx-result-excerpt CoveoExcerpt"></p>
78
85
  <% if (raw.sfcommentcount || raw.sflikecount) { %>
@@ -104,13 +111,20 @@ const resultsTemplatesInnerHtml = `
104
111
  <% } %>
105
112
  <% } %>
106
113
  </div>
107
- <a
108
- href="<%= raw.uri %>"
109
- class="dx-result-title CoveoResultLink"
110
- <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
111
- target="_blank"
112
- <% } %>
113
- >
114
+ <% if (raw.content_type === "community posts") { %>
115
+ <a
116
+ class="dx-result-title CoveoResultLink"
117
+ data-href-template="https://trailhead.salesforce.com/trailblazer-community/feed/<%= raw.sfid %>"
118
+ >
119
+ <% } else { %>
120
+ <a
121
+ href="<%= raw.uri %>"
122
+ class="dx-result-title CoveoResultLink"
123
+ <% if (!raw.uri.includes('developer.salesforce.com') && !raw.uri.includes('developer-website-s.herokuapp.com')) { %>
124
+ target="_blank"
125
+ <% } %>
126
+ >
127
+ <% } %>
114
128
  <% if (title) { %>
115
129
  <%= title %>
116
130
  <% } else { %>
@@ -398,6 +412,10 @@ export default class SearchResults extends LightningElement {
398
412
  this.totalPages = numberOfPages;
399
413
  this.totalResults = event.detail.results.totalCount;
400
414
 
415
+ if (!this.totalResults) {
416
+ this.hasResults = false;
417
+ }
418
+
401
419
  this.query = event.detail.query.q ?? "";
402
420
  this.hasFilters = event.detail.query.facets.some((f: any) => {
403
421
  return f.currentValues.some((cv: any) => {
@@ -409,12 +427,6 @@ export default class SearchResults extends LightningElement {
409
427
  });
410
428
 
411
429
  Coveo.$$(root).on(Coveo.QueryEvents.deferredQuerySuccess, async () => {
412
- if (!this.totalResults) {
413
- this.hasResults = false;
414
- } else {
415
- this.hasResults = true;
416
- }
417
-
418
430
  // wait specified time to ensure breadcrumbs are rendered before processing them
419
431
  await pollUntil(
420
432
  () => {