@salesforcedevs/docs-components 1.3.139-coveo-fix-test3 → 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-test3",
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,6 +110,7 @@ export default class AmfReference extends LightningElement {
110
110
  this.oldVersionInfo
111
111
  ) {
112
112
  this.showVersionBanner = true;
113
+ this.setCurrentSelectedVersion();
113
114
  }
114
115
  }
115
116
 
@@ -123,7 +124,7 @@ export default class AmfReference extends LightningElement {
123
124
  }
124
125
 
125
126
  @api
126
- set coveoAdvancedQueryConfig(config : CoveoAdvancedQueryXMLConfig) {
127
+ set coveoAdvancedQueryConfig(config: CoveoAdvancedQueryXMLConfig) {
127
128
  try {
128
129
  const coveoConfig =
129
130
  typeof config === "string" ? JSON.parse(config) : config;
@@ -135,12 +136,15 @@ export default class AmfReference extends LightningElement {
135
136
  topicid: this._currentReferenceId
136
137
  };
137
138
  }
139
+ console.log(
140
+ "Setting AQ: " + JSON.stringify(this._coveoAdvancedQueryConfig)
141
+ );
138
142
  }
139
-
143
+
140
144
  private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
141
- if(this.showVersionBanner) {
142
- this._coveoAdvancedQueryConfig.version = this.getSelectedVersion().id;
143
- }
145
+ console.log(
146
+ "Getting AQ: " + JSON.stringify(this._coveoAdvancedQueryConfig)
147
+ );
144
148
  return this._coveoAdvancedQueryConfig;
145
149
  }
146
150
 
@@ -178,6 +182,7 @@ export default class AmfReference extends LightningElement {
178
182
  protected metadata: { [key: string]: AmfMetadataTopic } = {};
179
183
  protected selectedTopic?: AmfMetaTopicType = undefined;
180
184
  protected selectedSidebarValue = undefined;
185
+ protected curSelectedVersion = "latest";
181
186
 
182
187
  protected selectedVersion: ReferenceVersion | null = null;
183
188
 
@@ -364,6 +369,12 @@ export default class AmfReference extends LightningElement {
364
369
  return selectedVersion || (versions.length && versions[0]);
365
370
  }
366
371
 
372
+ private setCurrentSelectedVersion() {
373
+ if (this.showVersionBanner) {
374
+ this.curSelectedVersion = this.getSelectedVersion().id;
375
+ }
376
+ }
377
+
367
378
  private updateAmfConfigInView(): void {
368
379
  if (this._amfConfigList && this._amfConfigList.length) {
369
380
  // fetch AMF Json as soon as config is set
@@ -1280,6 +1291,7 @@ export default class AmfReference extends LightningElement {
1280
1291
  this.versions = this.getVersions();
1281
1292
  if (this.oldVersionInfo) {
1282
1293
  this.showVersionBanner = true;
1294
+ this.setCurrentSelectedVersion();
1283
1295
  }
1284
1296
  this.updateDocPhase();
1285
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() {