@salesforcedevs/dx-components 0.10.1-alpha.130 → 0.10.1-alpha.134

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/dx-components",
3
- "version": "0.10.1-alpha.130",
3
+ "version": "0.10.1-alpha.134",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -36,8 +36,19 @@ export default class SidebarSearch extends LightningElement {
36
36
  get coveoAdvancedQueryConfig(): { [key: string]: any } {
37
37
  return this._coveoAdvancedQueryConfig;
38
38
  }
39
- set coveoAdvancedQueryConfig(value) {
39
+ set coveoAdvancedQueryConfig(value: string) {
40
40
  this._coveoAdvancedQueryConfig = toJson(value);
41
+
42
+ if (
43
+ this._coveoAdvancedQueryConfigValue &&
44
+ value !== this._coveoAdvancedQueryConfigValue &&
45
+ this.engine
46
+ ) {
47
+ // set adnvanced filters needs access to the latest coveoAdvancedQueryConfig
48
+ this.setAdvancedFilters(this.engine);
49
+ }
50
+
51
+ this._coveoAdvancedQueryConfigValue = value;
41
52
  }
42
53
 
43
54
  @api
@@ -53,7 +64,8 @@ export default class SidebarSearch extends LightningElement {
53
64
  this.value = searchTerm || "";
54
65
  }
55
66
 
56
- private _coveoAdvancedQueryConfig!: object;
67
+ private _coveoAdvancedQueryConfigValue!: string;
68
+ private _coveoAdvancedQueryConfig!: { [key: string]: any };
57
69
  private dropdownRequestedOpen: boolean = false;
58
70
  private recentSearches: Option[] = [];
59
71
  private resultList: ResultList | null = null;
@@ -116,16 +128,6 @@ export default class SidebarSearch extends LightningElement {
116
128
  );
117
129
  }
118
130
 
119
- const queryConfigValue = JSON.stringify(this.coveoAdvancedQueryConfig);
120
- console.log('query config value', queryConfigValue);
121
- if (this.queryConfigValue !== queryConfigValue) {
122
- if (this.queryConfigValue && this.engine) {
123
- console.log('setting query config again')
124
- this.setAdvancedFilters(this.engine);
125
- }
126
- this.queryConfigValue = queryConfigValue;
127
- }
128
-
129
131
  // If this is the first render and there is a search value, trigger
130
132
  // term highlighting
131
133
  if (!this.didRender && this.value) {
@@ -251,6 +253,7 @@ export default class SidebarSearch extends LightningElement {
251
253
  };
252
254
 
253
255
  private setAdvancedFilters(engine: SearchEngine) {
256
+ console.log('setting advanced filters')
254
257
  const aq = Object.entries(this.coveoAdvancedQueryConfig).reduce(
255
258
  (result, [key, value]) =>
256
259
  `${result}(@${key}=="${normalizeCoveoAdvancedQueryValue(