@salesforcedevs/docs-components 1.3.138-coveo-fix7 → 1.3.138-coveoversion-alpha

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-fix7",
3
+ "version": "1.3.138-coveoversion-alpha",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -3,7 +3,6 @@
3
3
  if:true={hasRendered}
4
4
  use-old-sidebar={useOldSidebar}
5
5
  class="content-type content-type-reference"
6
- version={version}
7
6
  coveo-organization-id={coveoOrganizationId}
8
7
  coveo-public-access-token={coveoPublicAccessToken}
9
8
  coveo-search-hub={coveoSearchHub}
@@ -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,8 +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
- console.log("AMF Ref: " + this.version);
115
112
  }
116
113
  }
117
114
 
@@ -145,6 +142,25 @@ export default class AmfReference extends LightningElement {
145
142
  this._expandChildren = normalizeBoolean(value);
146
143
  }
147
144
 
145
+ @api
146
+ get coveoAdvancedQueryConfig(): { [key: string]: any } {
147
+ const coveoConfig = this._coveoAdvancedQueryConfig;
148
+ if (this.versions.length > 1 && this.selectedVersion) {
149
+ const currentGAVersionRef = this.versions[0];
150
+ if (this.selectedVersion.id !== currentGAVersionRef.id) {
151
+ // Currently Coveo only supports query without "v"
152
+ const 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
+ }
163
+
148
164
  // model
149
165
  protected _amfConfigList: AmfConfig[] = [];
150
166
  protected _amfConfigMap: Map<string, AmfConfig> = new Map();
@@ -165,7 +181,7 @@ export default class AmfReference extends LightningElement {
165
181
  private isParentLevelDocPhaseEnabled = false;
166
182
  private selectedReferenceDocPhase?: string | null = null;
167
183
  private _expandChildren?: boolean = false;
168
- private version = "latest";
184
+ private _coveoAdvancedQueryConfig!: { [key: string]: any };
169
185
 
170
186
  /**
171
187
  * Key for storing the currently selected reference url. This will be used to save the
@@ -1260,8 +1276,6 @@ export default class AmfReference extends LightningElement {
1260
1276
  this.versions = this.getVersions();
1261
1277
  if (this.oldVersionInfo) {
1262
1278
  this.showVersionBanner = true;
1263
- this.version = this.getSelectedVersion().id.replace("v", "");
1264
- console.log("AMF Ref: " + this.version);
1265
1279
  }
1266
1280
  this.updateDocPhase();
1267
1281
  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}
@@ -29,7 +29,6 @@ export default class ContentLayout extends LightningElement {
29
29
  @api sidebarValue: string;
30
30
  @api sidebarHeader: string;
31
31
  @api tocTitle: string;
32
- @api version!: string;
33
32
  @api enableSlotChange = false;
34
33
  @api coveoOrganizationId!: string;
35
34
  @api coveoPublicAccessToken!: string;