@salesforcedevs/dw-components 1.28.2-action-link-1 → 1.28.2-action-link-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.28.2-action-link-1",
3
+ "version": "1.28.2-action-link-2",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -40,37 +40,27 @@
40
40
  ></dx-input>
41
41
  </div>
42
42
  <dx-grid columns={tileColumns} if:false={showEmptyState}>
43
- <dx-card-docs
44
- for:each={currentPageDocs}
45
- for:item="item"
46
- for:index="i"
47
- key={item.id}
48
- header={item.title}
49
- body={item.description}
50
- href={item.guidesHref}
51
- class="docs-card"
52
- target={item.target}
53
- >
54
- <dx-button
55
- variant="inline"
43
+ <template for:each={currentPageDocs} for:item="item" for:index="i">
44
+ <dx-card-docs
45
+ lwc:if={item.isDita}
46
+ key={item.id}
47
+ header={item.title}
48
+ body={item.description}
56
49
  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>
50
+ class="docs-card"
51
+ target={item.target}
52
+ onclick={handleDitaCardClick}
53
+ ></dx-card-docs>
54
+ <dx-card-docs
55
+ lwc:else
56
+ key={item.id}
57
+ header={item.title}
58
+ body={item.description}
59
+ href={item.guidesHref}
60
+ class="docs-card"
61
+ target={item.target}
62
+ ></dx-card-docs>
63
+ </template>
74
64
  </dx-grid>
75
65
  <div class="pagination-container" if:false={showEmptyState}>
76
66
  <dx-pagination
@@ -1,6 +1,6 @@
1
1
  import { api, LightningElement } from "lwc";
2
2
  import { normalizeBoolean, toJson } from "dxUtils/normalizers";
3
- import { DocsLink, DocsTile, DropdownItem, Language } from "typings/custom";
3
+ import { DocsTile, DropdownItem, Language } from "typings/custom";
4
4
  import qs from "query-string";
5
5
  import uniqBy from "lodash.uniqby";
6
6
  import orderBy from "lodash.orderby";
@@ -16,7 +16,6 @@ const DSC_API_URL = {
16
16
  const PRODUCT_FILTER_ALL_SERVICES = "all services";
17
17
  const LANGUAGE_FILTER_LABEL = "Language";
18
18
  const WAIT_TIME = 500;
19
- const DOCS_CONTENT_TYPE = "docs";
20
19
 
21
20
  type Filter = {
22
21
  label: string;
@@ -183,18 +182,12 @@ export default class DocsGrid extends LightningElement {
183
182
 
184
183
  for (const docs of allDocs) {
185
184
  for (const project of docs.projects) {
186
- const firstLink = project.contentTypes[0].href;
187
- const links = this.isDocsContentType(project)
188
- ? []
189
- : project.contentTypes;
190
-
191
185
  transformed.push({
192
186
  id: project.id,
193
187
  title: project.title,
194
188
  description: project.description,
195
- links,
196
189
  service: project.meta.brand,
197
- guidesHref: firstLink,
190
+ guidesHref: project.contentTypes[0].href,
198
191
  locale: docs.locale || "en-us"
199
192
  });
200
193
  }
@@ -203,13 +196,6 @@ export default class DocsGrid extends LightningElement {
203
196
  return transformed;
204
197
  }
205
198
 
206
- private isDocsContentType(project: any): boolean {
207
- return !!project.contentTypes?.some(
208
- (contentType: DocsLink) =>
209
- contentType.contentType === DOCS_CONTENT_TYPE
210
- );
211
- }
212
-
213
199
  async fetchOtherDocsFromSitemetadata(): Promise<void> {
214
200
  if (this._isFetchingOtherDocs) {
215
201
  return;
@@ -480,7 +466,8 @@ export default class DocsGrid extends LightningElement {
480
466
  "/" +
481
467
  content.value.default_topic
482
468
  : "",
483
- service: content.value.service
469
+ service: content.value.service,
470
+ isDita: true
484
471
  });
485
472
  }
486
473
  }
@@ -707,7 +694,7 @@ export default class DocsGrid extends LightningElement {
707
694
  }
708
695
  };
709
696
 
710
- handleReadItClick(e: any) {
697
+ handleDitaCardClick(e: any) {
711
698
  this.filteredItemsSelected = true;
712
699
  this.selectedProductFilters?.forEach((filter) => {
713
700
  track(document, "custEv_filterApplied", {