@salesforcedevs/docs-components 1.3.139-coveo-fix-test4 → 1.3.139-coveo-fix-test5

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.3.139-coveo-fix-test4",
3
+ "version": "1.3.139-coveo-fix-test5",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -14,6 +14,7 @@
14
14
  onexpandcollapse={onExpandCollapse}
15
15
  toc-title={tocTitle}
16
16
  toc-options={tocOptions}
17
+ selected-version={curSelectedVersion}
17
18
  enable-slot-change="true"
18
19
  >
19
20
  <doc-phase
@@ -110,9 +110,7 @@ export default class AmfReference extends LightningElement {
110
110
  this.oldVersionInfo
111
111
  ) {
112
112
  this.showVersionBanner = true;
113
- const newCoveoQueryConfig = this._coveoAdvancedQueryConfig;
114
- newCoveoQueryConfig.version = selectedVersion.id;
115
- this._coveoAdvancedQueryConfig = newCoveoQueryConfig;
113
+ this.setCurrentSelectedVersion();
116
114
  }
117
115
  }
118
116
 
@@ -184,6 +182,7 @@ export default class AmfReference extends LightningElement {
184
182
  protected metadata: { [key: string]: AmfMetadataTopic } = {};
185
183
  protected selectedTopic?: AmfMetaTopicType = undefined;
186
184
  protected selectedSidebarValue = undefined;
185
+ protected curSelectedVersion = "latest";
187
186
 
188
187
  protected selectedVersion: ReferenceVersion | null = null;
189
188
 
@@ -370,6 +369,12 @@ export default class AmfReference extends LightningElement {
370
369
  return selectedVersion || (versions.length && versions[0]);
371
370
  }
372
371
 
372
+ private setCurrentSelectedVersion() {
373
+ if (this.showVersionBanner) {
374
+ this.curSelectedVersion = this.getSelectedVersion().id;
375
+ }
376
+ }
377
+
373
378
  private updateAmfConfigInView(): void {
374
379
  if (this._amfConfigList && this._amfConfigList.length) {
375
380
  // fetch AMF Json as soon as config is set
@@ -1286,9 +1291,7 @@ export default class AmfReference extends LightningElement {
1286
1291
  this.versions = this.getVersions();
1287
1292
  if (this.oldVersionInfo) {
1288
1293
  this.showVersionBanner = true;
1289
- const newCoveoQueryConfig = this._coveoAdvancedQueryConfig;
1290
- newCoveoQueryConfig.version = this.getSelectedVersion().id;
1291
- this._coveoAdvancedQueryConfig = newCoveoQueryConfig;
1294
+ this.setCurrentSelectedVersion();
1292
1295
  }
1293
1296
  this.updateDocPhase();
1294
1297
  this.selectedSidebarValue = window.location.pathname;
@@ -22,6 +22,7 @@
22
22
  coveo-search-hub={coveoSearchHub}
23
23
  coveo-advanced-query-config={coveoAdvancedQueryConfig}
24
24
  ontogglesidebar={onToggleSidebar}
25
+ selected-version={selectedVersion}
25
26
  >
26
27
  <slot name="sidebar-header" slot="header"></slot>
27
28
  </dx-sidebar>
@@ -35,6 +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 selectedVersion?: string;
38
39
 
39
40
  @api
40
41
  get breadcrumbs() {