@salesforcedevs/dx-components 0.10.1-alpha.131 → 0.10.1-alpha.135

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