@salesforcedevs/dw-components 1.28.3 → 1.29.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.28.3",
3
+ "version": "1.29.0",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -26,5 +26,5 @@
26
26
  "@types/setimmediate": "1.0.4",
27
27
  "setimmediate": "1.0.5"
28
28
  },
29
- "gitHead": "71d75798db2bfb52ea29b57f52947190aa0ec092"
29
+ "gitHead": "db75cd19dd7a77fe4e09856439c4905c32e64d1f"
30
30
  }
@@ -43,34 +43,15 @@
43
43
  <dx-card-docs
44
44
  for:each={currentPageDocs}
45
45
  for:item="item"
46
- for:index="i"
47
46
  key={item.id}
48
47
  header={item.title}
49
48
  body={item.description}
50
- href={item.guidesHref}
49
+ href={item.projectHref}
51
50
  class="docs-card"
52
51
  target={item.target}
53
- >
54
- <dx-button
55
- variant="inline"
56
- href={item.guidesHref}
57
- onclick={handleReadItClick}
58
- if:false={item.links}
59
- >
60
- Read It
61
- </dx-button>
62
- <template if:true={item.links}>
63
- <dx-button
64
- for:each={item.links}
65
- for:item="link"
66
- key={link.id}
67
- href={link.href}
68
- variant="inline"
69
- >
70
- { link.title }
71
- </dx-button>
72
- </template>
73
- </dx-card-docs>
52
+ data-is-dita={item.isDita}
53
+ onclick={handleDitaCardClick}
54
+ ></dx-card-docs>
74
55
  </dx-grid>
75
56
  <div class="pagination-container" if:false={showEmptyState}>
76
57
  <dx-pagination
@@ -182,15 +182,12 @@ export default class DocsGrid extends LightningElement {
182
182
 
183
183
  for (const docs of allDocs) {
184
184
  for (const project of docs.projects) {
185
- const firstLink = project.contentTypes[0].href;
186
-
187
185
  transformed.push({
188
186
  id: project.id,
189
187
  title: project.title,
190
188
  description: project.description,
191
- links: project.contentTypes,
192
189
  service: project.meta.brand,
193
- guidesHref: firstLink,
190
+ projectHref: project.contentTypes[0].href,
194
191
  locale: docs.locale || "en-us"
195
192
  });
196
193
  }
@@ -463,13 +460,14 @@ export default class DocsGrid extends LightningElement {
463
460
  id: content.id,
464
461
  title: content.value.title,
465
462
  description: content.value.shortdesc,
466
- guidesHref: content
463
+ projectHref: content
467
464
  ? "/docs/" +
468
465
  content.value._id +
469
466
  "/" +
470
467
  content.value.default_topic
471
468
  : "",
472
- service: content.value.service
469
+ service: content.value.service,
470
+ isDita: true
473
471
  });
474
472
  }
475
473
  }
@@ -696,7 +694,11 @@ export default class DocsGrid extends LightningElement {
696
694
  }
697
695
  };
698
696
 
699
- handleReadItClick(e: any) {
697
+ handleDitaCardClick(e: any) {
698
+ if (e?.currentTarget?.dataset?.isDita !== "true") {
699
+ return;
700
+ }
701
+
700
702
  this.filteredItemsSelected = true;
701
703
  this.selectedProductFilters?.forEach((filter) => {
702
704
  track(document, "custEv_filterApplied", {