@salesforcedevs/docs-components 1.3.139-coveo-fix-test5 → 1.3.139-coveo-fix-test7
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 +1 -1
- package/src/modules/doc/amfReference/amfReference.html +1 -1
- package/src/modules/doc/amfReference/amfReference.ts +3 -37
- package/src/modules/doc/amfReference/types.ts +0 -6
- package/src/modules/doc/contentLayout/contentLayout.html +1 -1
- package/src/modules/doc/contentLayout/contentLayout.ts +1 -1
package/package.json
CHANGED
|
@@ -16,8 +16,7 @@ import type {
|
|
|
16
16
|
ReferenceSetConfig,
|
|
17
17
|
AmfMetaTopicType,
|
|
18
18
|
RouteMeta,
|
|
19
|
-
ParsedMarkdownTopic
|
|
20
|
-
CoveoAdvancedQueryXMLConfig
|
|
19
|
+
ParsedMarkdownTopic
|
|
21
20
|
} from "./types";
|
|
22
21
|
|
|
23
22
|
import {
|
|
@@ -35,6 +34,7 @@ export default class AmfReference extends LightningElement {
|
|
|
35
34
|
@api sidebarHeader!: string;
|
|
36
35
|
@api coveoOrganizationId!: string;
|
|
37
36
|
@api coveoPublicAccessToken!: string;
|
|
37
|
+
@api coveoAdvancedQueryConfig!: string;
|
|
38
38
|
@api coveoSearchHub!: string;
|
|
39
39
|
@api useOldSidebar?: boolean = false;
|
|
40
40
|
@api tocTitle?: string;
|
|
@@ -42,6 +42,7 @@ export default class AmfReference extends LightningElement {
|
|
|
42
42
|
@track navigation = [];
|
|
43
43
|
@track versions: Array<ReferenceVersion> = [];
|
|
44
44
|
@track showVersionBanner = false;
|
|
45
|
+
@api currentVersion: string = "something";
|
|
45
46
|
|
|
46
47
|
// Update this to update what component gets rendered in the content block
|
|
47
48
|
@track
|
|
@@ -110,7 +111,6 @@ export default class AmfReference extends LightningElement {
|
|
|
110
111
|
this.oldVersionInfo
|
|
111
112
|
) {
|
|
112
113
|
this.showVersionBanner = true;
|
|
113
|
-
this.setCurrentSelectedVersion();
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -123,31 +123,6 @@ export default class AmfReference extends LightningElement {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
@api
|
|
127
|
-
set coveoAdvancedQueryConfig(config: CoveoAdvancedQueryXMLConfig) {
|
|
128
|
-
try {
|
|
129
|
-
const coveoConfig =
|
|
130
|
-
typeof config === "string" ? JSON.parse(config) : config;
|
|
131
|
-
this._coveoAdvancedQueryConfig = coveoConfig;
|
|
132
|
-
} catch (e) {
|
|
133
|
-
this._coveoAdvancedQueryConfig = {
|
|
134
|
-
locale: "en-us",
|
|
135
|
-
version: "latest",
|
|
136
|
-
topicid: this._currentReferenceId
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
console.log(
|
|
140
|
-
"Setting AQ: " + JSON.stringify(this._coveoAdvancedQueryConfig)
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
|
|
145
|
-
console.log(
|
|
146
|
-
"Getting AQ: " + JSON.stringify(this._coveoAdvancedQueryConfig)
|
|
147
|
-
);
|
|
148
|
-
return this._coveoAdvancedQueryConfig;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
126
|
@api
|
|
152
127
|
get docPhaseInfo() {
|
|
153
128
|
return this.selectedReferenceDocPhase;
|
|
@@ -174,7 +149,6 @@ export default class AmfReference extends LightningElement {
|
|
|
174
149
|
protected _amfConfigMap: Map<string, AmfConfig> = new Map();
|
|
175
150
|
protected _referenceSetConfig!: ReferenceSetConfig;
|
|
176
151
|
protected _currentReferenceId = "";
|
|
177
|
-
protected _coveoAdvancedQueryConfig!: CoveoAdvancedQueryXMLConfig;
|
|
178
152
|
|
|
179
153
|
protected parentReferenceUrls = [];
|
|
180
154
|
protected amfMap: Record<string, AmfModelRecord> = {};
|
|
@@ -182,7 +156,6 @@ export default class AmfReference extends LightningElement {
|
|
|
182
156
|
protected metadata: { [key: string]: AmfMetadataTopic } = {};
|
|
183
157
|
protected selectedTopic?: AmfMetaTopicType = undefined;
|
|
184
158
|
protected selectedSidebarValue = undefined;
|
|
185
|
-
protected curSelectedVersion = "latest";
|
|
186
159
|
|
|
187
160
|
protected selectedVersion: ReferenceVersion | null = null;
|
|
188
161
|
|
|
@@ -369,12 +342,6 @@ export default class AmfReference extends LightningElement {
|
|
|
369
342
|
return selectedVersion || (versions.length && versions[0]);
|
|
370
343
|
}
|
|
371
344
|
|
|
372
|
-
private setCurrentSelectedVersion() {
|
|
373
|
-
if (this.showVersionBanner) {
|
|
374
|
-
this.curSelectedVersion = this.getSelectedVersion().id;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
|
|
378
345
|
private updateAmfConfigInView(): void {
|
|
379
346
|
if (this._amfConfigList && this._amfConfigList.length) {
|
|
380
347
|
// fetch AMF Json as soon as config is set
|
|
@@ -1291,7 +1258,6 @@ export default class AmfReference extends LightningElement {
|
|
|
1291
1258
|
this.versions = this.getVersions();
|
|
1292
1259
|
if (this.oldVersionInfo) {
|
|
1293
1260
|
this.showVersionBanner = true;
|
|
1294
|
-
this.setCurrentSelectedVersion();
|
|
1295
1261
|
}
|
|
1296
1262
|
this.updateDocPhase();
|
|
1297
1263
|
this.selectedSidebarValue = window.location.pathname;
|
|
@@ -8,12 +8,6 @@ export interface AmfTopicType {
|
|
|
8
8
|
type: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export type CoveoAdvancedQueryXMLConfig = {
|
|
12
|
-
locale?: string;
|
|
13
|
-
version?: string;
|
|
14
|
-
topicid?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
11
|
export interface AmfMetadataTopic extends AmfTopicType {
|
|
18
12
|
meta: string;
|
|
19
13
|
identifier: string;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
coveo-search-hub={coveoSearchHub}
|
|
23
23
|
coveo-advanced-query-config={coveoAdvancedQueryConfig}
|
|
24
24
|
ontogglesidebar={onToggleSidebar}
|
|
25
|
-
|
|
25
|
+
current-version={currentVersion}
|
|
26
26
|
>
|
|
27
27
|
<slot name="sidebar-header" slot="header"></slot>
|
|
28
28
|
</dx-sidebar>
|
|
@@ -35,7 +35,7 @@ export default class ContentLayout extends LightningElement {
|
|
|
35
35
|
@api coveoSearchHub!: string;
|
|
36
36
|
@api coveoAdvancedQueryConfig!: string;
|
|
37
37
|
@api useOldSidebar?: boolean = false;
|
|
38
|
-
@api
|
|
38
|
+
@api currentVersion?: string;
|
|
39
39
|
|
|
40
40
|
@api
|
|
41
41
|
get breadcrumbs() {
|