@salesforcedevs/docs-components 1.3.139-coveo-fix-test1 → 1.3.139-coveo-fix-test2

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-test1",
3
+ "version": "1.3.139-coveo-fix-test2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -123,15 +123,25 @@ export default class AmfReference extends LightningElement {
123
123
  }
124
124
 
125
125
  @api
126
- set coveoAdvancedQueryConfig(config) {
127
- console.log('Setting AQ value.');
128
- this._coveoAdvancedQueryConfig = config;
126
+ set coveoAdvancedQueryConfig(config : CoveoAdvancedQueryXMLConfig) {
127
+ try {
128
+ const coveoConfig =
129
+ typeof config === "string" ? JSON.parse(config) : config;
130
+ this._coveoAdvancedQueryConfig = coveoConfig;
131
+ } catch (e) {
132
+ this._coveoAdvancedQueryConfig = {
133
+ locale: "en-us",
134
+ version: "latest",
135
+ topicid: this._currentReferenceId
136
+ };
137
+ }
138
+
129
139
  if(this.showVersionBanner) {
130
140
  this._coveoAdvancedQueryConfig.version = this.getSelectedVersion().id;
131
141
  }
132
142
  }
133
- get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
134
- console.log('Getting AQ value.');
143
+
144
+ private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
135
145
  return this._coveoAdvancedQueryConfig;
136
146
  }
137
147