@salesforcedevs/dw-components 1.28.2-new-content-type-alpha → 1.28.3-alpha1

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.2-new-content-type-alpha",
3
+ "version": "1.28.3-alpha1",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -25,5 +25,6 @@
25
25
  "@types/lodash.uniqby": "4.7.9",
26
26
  "@types/setimmediate": "1.0.4",
27
27
  "setimmediate": "1.0.5"
28
- }
28
+ },
29
+ "stableVersion": "1.28.3"
29
30
  }
@@ -43,15 +43,34 @@
43
43
  <dx-card-docs
44
44
  for:each={currentPageDocs}
45
45
  for:item="item"
46
+ for:index="i"
46
47
  key={item.id}
47
48
  header={item.title}
48
49
  body={item.description}
49
- href={item.projectHref}
50
+ href={item.guidesHref}
50
51
  class="docs-card"
51
52
  target={item.target}
52
- data-is-dita={item.isDita}
53
- onclick={handleDitaCardClick}
54
- ></dx-card-docs>
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>
55
74
  </dx-grid>
56
75
  <div class="pagination-container" if:false={showEmptyState}>
57
76
  <dx-pagination
@@ -182,12 +182,15 @@ 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
+
185
187
  transformed.push({
186
188
  id: project.id,
187
189
  title: project.title,
188
190
  description: project.description,
191
+ links: project.contentTypes,
189
192
  service: project.meta.brand,
190
- projectHref: project.contentTypes[0].href,
193
+ guidesHref: firstLink,
191
194
  locale: docs.locale || "en-us"
192
195
  });
193
196
  }
@@ -460,14 +463,15 @@ export default class DocsGrid extends LightningElement {
460
463
  id: content.id,
461
464
  title: content.value.title,
462
465
  description: content.value.shortdesc,
463
- projectHref: content
464
- ? "/docs/" +
466
+ guidesHref: content
467
+ ? // Deploy base path (e.g. "/PR-123"); empty in local dev.
468
+ ((globalThis as any)?.LWR?.env?.basePath || "") +
469
+ "/docs/" +
465
470
  content.value._id +
466
471
  "/" +
467
472
  content.value.default_topic
468
473
  : "",
469
- service: content.value.service,
470
- isDita: true
474
+ service: content.value.service
471
475
  });
472
476
  }
473
477
  }
@@ -694,11 +698,7 @@ export default class DocsGrid extends LightningElement {
694
698
  }
695
699
  };
696
700
 
697
- handleDitaCardClick(e: any) {
698
- if (e?.currentTarget?.dataset?.isDita !== "true") {
699
- return;
700
- }
701
-
701
+ handleReadItClick(e: any) {
702
702
  this.filteredItemsSelected = true;
703
703
  this.selectedProductFilters?.forEach((filter) => {
704
704
  track(document, "custEv_filterApplied", {