@salesforcedevs/docs-components 1.3.138-coveo-fix6 → 1.3.138-coveo1

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-fix6",
3
+ "version": "1.3.138-coveo1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <doc-content-layout
3
+ if:true={hasRendered}
3
4
  use-old-sidebar={useOldSidebar}
4
5
  class="content-type content-type-reference"
5
6
  coveo-organization-id={coveoOrganizationId}
@@ -7,7 +8,6 @@
7
8
  coveo-search-hub={coveoSearchHub}
8
9
  coveo-advanced-query-config={coveoAdvancedQueryConfig}
9
10
  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 } from "dxUtils/normalizers";
6
+ import { normalizeBoolean, toJson } from "dxUtils/normalizers";
7
7
  import type {
8
8
  AmfConfig,
9
9
  AmfMetadataTopic,
@@ -34,7 +34,6 @@ 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;
38
37
  @api coveoSearchHub!: string;
39
38
  @api useOldSidebar?: boolean = false;
40
39
  @api tocTitle?: string;
@@ -110,7 +109,6 @@ export default class AmfReference extends LightningElement {
110
109
  this.oldVersionInfo
111
110
  ) {
112
111
  this.showVersionBanner = true;
113
- this.version = this.selectedVersion.id.replace("v", "");
114
112
  }
115
113
  }
116
114
 
@@ -144,6 +142,24 @@ export default class AmfReference extends LightningElement {
144
142
  this._expandChildren = normalizeBoolean(value);
145
143
  }
146
144
 
145
+ @api
146
+ get coveoAdvancedQueryConfig(): { [key: string]: any } {
147
+ const coveoConfig = this._coveoAdvancedQueryConfig;
148
+ let version = "latest";
149
+ if (this.versions.length > 1 && this.selectedVersion) {
150
+ const currentGAVersionRef = this.versions[0];
151
+ if (this.selectedVersion.id !== currentGAVersionRef.id) {
152
+ version = this.selectedVersion.id.replace("v", "");
153
+ coveoConfig.version = version;
154
+ this._coveoAdvancedQueryConfig = coveoConfig;
155
+ }
156
+ }
157
+ return this._coveoAdvancedQueryConfig;
158
+ }
159
+
160
+ set coveoAdvancedQueryConfig(config) {
161
+ this._coveoAdvancedQueryConfig = toJson(config);
162
+ }
147
163
  // model
148
164
  protected _amfConfigList: AmfConfig[] = [];
149
165
  protected _amfConfigMap: Map<string, AmfConfig> = new Map();
@@ -164,7 +180,7 @@ export default class AmfReference extends LightningElement {
164
180
  private isParentLevelDocPhaseEnabled = false;
165
181
  private selectedReferenceDocPhase?: string | null = null;
166
182
  private _expandChildren?: boolean = false;
167
- private version = "latest";
183
+ private _coveoAdvancedQueryConfig!: { [key: string]: any };
168
184
 
169
185
  /**
170
186
  * Key for storing the currently selected reference url. This will be used to save the
@@ -1259,7 +1275,6 @@ export default class AmfReference extends LightningElement {
1259
1275
  this.versions = this.getVersions();
1260
1276
  if (this.oldVersionInfo) {
1261
1277
  this.showVersionBanner = true;
1262
- this.version = this.getSelectedVersion().id.replace("v", "");
1263
1278
  }
1264
1279
  this.updateDocPhase();
1265
1280
  this.selectedSidebarValue = window.location.pathname;
@@ -17,7 +17,6 @@
17
17
  trees={sidebarContent}
18
18
  value={sidebarValue}
19
19
  header={sidebarHeader}
20
- version={version}
21
20
  coveo-organization-id={coveoOrganizationId}
22
21
  coveo-public-access-token={coveoPublicAccessToken}
23
22
  coveo-search-hub={coveoSearchHub}
@@ -35,7 +35,6 @@ 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;
39
38
 
40
39
  @api
41
40
  get breadcrumbs() {