@salesforcedevs/docs-components 1.3.138-coveo-fix2 → 1.3.138-coveo-fix4

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.138-coveo-fix2",
3
+ "version": "1.3.138-coveo-fix4",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <doc-content-layout
3
- if:true={loaded}
4
3
  use-old-sidebar={useOldSidebar}
5
4
  class="content-type content-type-reference"
6
5
  coveo-organization-id={coveoOrganizationId}
@@ -8,6 +7,7 @@
8
7
  coveo-search-hub={coveoSearchHub}
9
8
  coveo-advanced-query-config={coveoAdvancedQueryConfig}
10
9
  breadcrumbs={breadcrumbs}
10
+ version={version}
11
11
  sidebar-header={sidebarHeader}
12
12
  sidebar-value={selectedSidebarValue}
13
13
  sidebar-content={navigation}
@@ -3,7 +3,7 @@ import { noCase } from "no-case";
3
3
  import { sentenceCase } from "sentence-case";
4
4
  import qs from "query-string";
5
5
  import { AmfModelParser } from "./utils";
6
- import { normalizeBoolean, toJson } from "dxUtils/normalizers";
6
+ import { normalizeBoolean } from "dxUtils/normalizers";
7
7
  import type {
8
8
  AmfConfig,
9
9
  AmfMetadataTopic,
@@ -34,6 +34,7 @@ export default class AmfReference extends LightningElement {
34
34
  @api sidebarHeader!: string;
35
35
  @api coveoOrganizationId!: string;
36
36
  @api coveoPublicAccessToken!: string;
37
+ @api coveoAdvancedQueryConfig!: string;
37
38
  @api coveoSearchHub!: string;
38
39
  @api useOldSidebar?: boolean = false;
39
40
  @api tocTitle?: string;
@@ -109,6 +110,7 @@ export default class AmfReference extends LightningElement {
109
110
  this.oldVersionInfo
110
111
  ) {
111
112
  this.showVersionBanner = true;
113
+ this.version = this.selectedVersion.id.replace("v", "");
112
114
  }
113
115
  }
114
116
 
@@ -142,26 +144,6 @@ export default class AmfReference extends LightningElement {
142
144
  this._expandChildren = normalizeBoolean(value);
143
145
  }
144
146
 
145
- @api
146
- get coveoAdvancedQueryConfig(): { [key: string]: any } {
147
- const coveoConfig = toJson(this._coveoAdvancedQueryConfig);
148
- if (this.versions.length > 1 && this.selectedVersion) {
149
- const currentGAVersionRef = this.versions[0];
150
- if (this.selectedVersion.id !== currentGAVersionRef.id) {
151
- coveoConfig.version = this.selectedVersion.id.replace("v", "");
152
- this._coveoAdvancedQueryConfig = coveoConfig;
153
- }
154
- }
155
- console.log(
156
- "AQ AMF Ref: " + JSON.stringify(this._coveoAdvancedQueryConfig)
157
- );
158
- return this._coveoAdvancedQueryConfig;
159
- }
160
-
161
- set coveoAdvancedQueryConfig(config) {
162
- this._coveoAdvancedQueryConfig = config;
163
- }
164
-
165
147
  // model
166
148
  protected _amfConfigList: AmfConfig[] = [];
167
149
  protected _amfConfigMap: Map<string, AmfConfig> = new Map();
@@ -182,8 +164,7 @@ export default class AmfReference extends LightningElement {
182
164
  private isParentLevelDocPhaseEnabled = false;
183
165
  private selectedReferenceDocPhase?: string | null = null;
184
166
  private _expandChildren?: boolean = false;
185
- private loaded = false;
186
- private _coveoAdvancedQueryConfig!: { [key: string]: any };
167
+ private version = "latest";
187
168
 
188
169
  /**
189
170
  * Key for storing the currently selected reference url. This will be used to save the
@@ -204,7 +185,6 @@ export default class AmfReference extends LightningElement {
204
185
  }
205
186
 
206
187
  connectedCallback(): void {
207
- this.loaded = true;
208
188
  this.addEventListener(
209
189
  "api-navigation-selection-changed",
210
190
  this._boundOnApiNavigationChanged
@@ -1279,6 +1259,7 @@ export default class AmfReference extends LightningElement {
1279
1259
  this.versions = this.getVersions();
1280
1260
  if (this.oldVersionInfo) {
1281
1261
  this.showVersionBanner = true;
1262
+ this.version = this.getSelectedVersion().id.replace("v", "");
1282
1263
  }
1283
1264
  this.updateDocPhase();
1284
1265
  this.selectedSidebarValue = window.location.pathname;
@@ -17,6 +17,7 @@
17
17
  trees={sidebarContent}
18
18
  value={sidebarValue}
19
19
  header={sidebarHeader}
20
+ version={version}
20
21
  coveo-organization-id={coveoOrganizationId}
21
22
  coveo-public-access-token={coveoPublicAccessToken}
22
23
  coveo-search-hub={coveoSearchHub}
@@ -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 version!: string;
38
39
 
39
40
  @api
40
41
  get breadcrumbs() {