@salesforcedevs/docs-components 1.28.7-alpha.5 → 1.28.7-alpha.7
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.28.7-alpha.
|
|
3
|
+
"version": "1.28.7-alpha.7",
|
|
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": "f2c341af399aa8e306edd3fa21632df70493124e"
|
|
29
29
|
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
|
+
<dx-sidebar
|
|
4
|
+
lwc:if={showDataCloudSidebar}
|
|
5
|
+
class="is-sticky left-nav-bar"
|
|
6
|
+
trees={sidebarContent}
|
|
7
|
+
value={sidebarValue}
|
|
8
|
+
header={sidebarHeader}
|
|
9
|
+
ontogglesidebar={onToggleSidebar}
|
|
10
|
+
>
|
|
11
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
12
|
+
</dx-sidebar>
|
|
3
13
|
<dx-sidebar-old
|
|
4
|
-
lwc:
|
|
14
|
+
lwc:else
|
|
5
15
|
class="is-sticky left-nav-bar"
|
|
6
16
|
trees={sidebarContent}
|
|
7
17
|
value={sidebarValue}
|
|
@@ -17,16 +27,6 @@
|
|
|
17
27
|
>
|
|
18
28
|
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
19
29
|
</dx-sidebar-old>
|
|
20
|
-
<dx-sidebar
|
|
21
|
-
lwc:else
|
|
22
|
-
class="is-sticky left-nav-bar"
|
|
23
|
-
trees={sidebarContent}
|
|
24
|
-
value={sidebarValue}
|
|
25
|
-
header={sidebarHeader}
|
|
26
|
-
ontogglesidebar={onToggleSidebar}
|
|
27
|
-
>
|
|
28
|
-
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
29
|
-
</dx-sidebar>
|
|
30
30
|
<div class="content-body-doc-phase-container">
|
|
31
31
|
<div class="doc-phase-wrapper">
|
|
32
32
|
<slot name="doc-phase"></slot>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @lwc/lwc/no-document-query */
|
|
2
2
|
import { LightningElement, api, track } from "lwc";
|
|
3
3
|
import { closest } from "kagekiri";
|
|
4
|
+
import { fetchHasResults } from "dxUtils/dataCloudSearch";
|
|
4
5
|
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
5
6
|
import { highlightTerms } from "dxUtils/highlight";
|
|
6
7
|
import { SearchSyncer } from "docUtils/searchSyncer";
|
|
@@ -108,9 +109,17 @@ export default class ContentLayout extends LightningElement {
|
|
|
108
109
|
);
|
|
109
110
|
}
|
|
110
111
|
|
|
112
|
+
/** Show Data Cloud sidebar only when not using old sidebar and the page has searchable results. */
|
|
113
|
+
protected get showDataCloudSidebar(): boolean {
|
|
114
|
+
return !this.useOldSidebar && this.hasDataCloudResults === true;
|
|
115
|
+
}
|
|
116
|
+
|
|
111
117
|
@track
|
|
112
118
|
protected _sidebarContent: unknown;
|
|
113
119
|
|
|
120
|
+
@track
|
|
121
|
+
protected hasDataCloudResults: boolean | null = null;
|
|
122
|
+
|
|
114
123
|
protected _breadcrumbs = null;
|
|
115
124
|
|
|
116
125
|
@track
|
|
@@ -181,6 +190,11 @@ export default class ContentLayout extends LightningElement {
|
|
|
181
190
|
}
|
|
182
191
|
|
|
183
192
|
connectedCallback(): void {
|
|
193
|
+
if (!this.useOldSidebar) {
|
|
194
|
+
fetchHasResults().then((hasResults: boolean) => {
|
|
195
|
+
this.hasDataCloudResults = hasResults;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
184
198
|
const hasParentHighlightListener = closest(
|
|
185
199
|
"doc-xml-content",
|
|
186
200
|
this.template.host
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="content">
|
|
3
3
|
<dx-sidebar-old
|
|
4
|
+
lwc:if={useOldSidebar}
|
|
4
5
|
class="is-sticky left-nav-bar"
|
|
5
6
|
trees={sidebarContent}
|
|
6
7
|
value={sidebarValue}
|
|
@@ -15,6 +16,16 @@
|
|
|
15
16
|
>
|
|
16
17
|
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
17
18
|
</dx-sidebar-old>
|
|
19
|
+
<dx-sidebar
|
|
20
|
+
lwc:else
|
|
21
|
+
class="is-sticky left-nav-bar"
|
|
22
|
+
trees={sidebarContent}
|
|
23
|
+
value={sidebarValue}
|
|
24
|
+
header={sidebarHeader}
|
|
25
|
+
ontogglesidebar={onToggleSidebar}
|
|
26
|
+
>
|
|
27
|
+
<slot name="sidebar-header" slot="version-picker"></slot>
|
|
28
|
+
</dx-sidebar>
|
|
18
29
|
<div class="content-body-doc-phase-container">
|
|
19
30
|
<div class="doc-phase-wrapper">
|
|
20
31
|
<slot name="doc-phase"></slot>
|
|
@@ -251,17 +251,6 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
251
251
|
return this.pageReference.deliverable;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
private get useOldSidebar(): boolean {
|
|
255
|
-
// Coveo is enabled and the version is greater than 51 (within the latest 3 versions)
|
|
256
|
-
// TODO: we need a better fix for version number check
|
|
257
|
-
return !(
|
|
258
|
-
!this.version?.releaseVersion ||
|
|
259
|
-
(this.version?.releaseVersion &&
|
|
260
|
-
parseInt(this.version.releaseVersion.replace("v", ""), 10) >=
|
|
261
|
-
53)
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
254
|
private get pageHeader(): Header {
|
|
266
255
|
if (!this._pageHeader) {
|
|
267
256
|
this._pageHeader = document.querySelector("doc-header")!;
|