@salesforcedevs/docs-components 1.17.0 → 1.17.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/docs-components",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@types/lodash.orderby": "4.6.9",
|
|
26
26
|
"@types/lodash.uniqby": "4.7.9"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "456b8ad8b3162df223f9809e66a454cb66b4add0"
|
|
29
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<doc-content-layout
|
|
3
|
-
lwc:if={
|
|
3
|
+
lwc:if={displayContent}
|
|
4
4
|
lwc:ref="docContentLayout"
|
|
5
5
|
coveo-organization-id={coveoOrganizationId}
|
|
6
6
|
coveo-public-access-token={coveoPublicAccessToken}
|
|
@@ -49,4 +49,12 @@
|
|
|
49
49
|
onnavclick={handleNavClick}
|
|
50
50
|
></doc-content>
|
|
51
51
|
</doc-content-layout>
|
|
52
|
+
<div lwc:if={display404}>
|
|
53
|
+
<dx-error
|
|
54
|
+
image="https://a.sfdcstatic.com/developer-website/images/404.svg"
|
|
55
|
+
code="404"
|
|
56
|
+
header="Beep boop. That did not compute."
|
|
57
|
+
subtitle="The document you're looking for doesn't seem to exist."
|
|
58
|
+
></dx-error>
|
|
59
|
+
</div>
|
|
52
60
|
</template>
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
SiderbarFooter,
|
|
12
12
|
HistoryState,
|
|
13
13
|
PageReference,
|
|
14
|
-
TocMap
|
|
14
|
+
TocMap,
|
|
15
|
+
ContentData
|
|
15
16
|
} from "./types";
|
|
16
17
|
import { SearchSyncer } from "docUtils/searchSyncer";
|
|
17
18
|
import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
|
|
@@ -72,7 +73,8 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
72
73
|
private contentProvider?: FetchContent;
|
|
73
74
|
private docContent = "";
|
|
74
75
|
private language?: DocLanguage | null = null;
|
|
75
|
-
private
|
|
76
|
+
private displayContent = false;
|
|
77
|
+
private display404 = false;
|
|
76
78
|
private _pageHeader?: Header;
|
|
77
79
|
private pdfUrl = "";
|
|
78
80
|
private tocMap: TocMap = {};
|
|
@@ -185,7 +187,13 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
185
187
|
this.apiDomain,
|
|
186
188
|
this.allLanguages
|
|
187
189
|
);
|
|
188
|
-
this.fetchDocument().then(() =>
|
|
190
|
+
this.fetchDocument().then((content: any) => {
|
|
191
|
+
if (content) {
|
|
192
|
+
this.displayContent = true;
|
|
193
|
+
} else {
|
|
194
|
+
this.display404 = true;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
189
197
|
window.addEventListener("popstate", this.handlePopState);
|
|
190
198
|
|
|
191
199
|
this.searchSyncer.init();
|
|
@@ -463,7 +471,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
463
471
|
);
|
|
464
472
|
}
|
|
465
473
|
|
|
466
|
-
async fetchDocument(): Promise<
|
|
474
|
+
async fetchDocument(): Promise<string> {
|
|
467
475
|
this.setState({
|
|
468
476
|
isFetchingDocument: true
|
|
469
477
|
});
|
|
@@ -477,7 +485,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
477
485
|
this.setState({
|
|
478
486
|
isFetchingDocument: false
|
|
479
487
|
});
|
|
480
|
-
return;
|
|
488
|
+
return "";
|
|
481
489
|
}
|
|
482
490
|
|
|
483
491
|
this.docTitle = data.docTitle;
|
|
@@ -509,11 +517,11 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
509
517
|
data.id
|
|
510
518
|
) {
|
|
511
519
|
try {
|
|
512
|
-
await this.fetchContent();
|
|
520
|
+
const moreData = await this.fetchContent();
|
|
513
521
|
this.setState({
|
|
514
522
|
isFetchingDocument: false
|
|
515
523
|
});
|
|
516
|
-
return;
|
|
524
|
+
return moreData.content;
|
|
517
525
|
} catch (error) {
|
|
518
526
|
this.pageReference.contentDocumentId = `${data.id}.htm`;
|
|
519
527
|
this.pageReference.hash = "";
|
|
@@ -527,9 +535,10 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
527
535
|
this.setState({
|
|
528
536
|
isFetchingDocument: false
|
|
529
537
|
});
|
|
538
|
+
return data.content;
|
|
530
539
|
}
|
|
531
540
|
|
|
532
|
-
async fetchContent(): Promise<
|
|
541
|
+
async fetchContent(): Promise<ContentData> {
|
|
533
542
|
this.setState({
|
|
534
543
|
isFetchingContent: true
|
|
535
544
|
});
|
|
@@ -553,6 +562,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
553
562
|
this.setState({
|
|
554
563
|
isFetchingContent: false
|
|
555
564
|
});
|
|
565
|
+
return data;
|
|
556
566
|
}
|
|
557
567
|
|
|
558
568
|
updateHeaderAndSidebarFooter(): void {
|