@sisense/sdk-query-client 1.11.0 → 1.12.0

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.
@@ -24,14 +24,21 @@ function prepareFilterMetadata(attributesMetadata, filters, filterRelations, hig
24
24
  const [highlightsWithAttributes, highlightsWithoutAttributes] = matchHighlightsWithAttributes(attributesMetadata, highlights);
25
25
  attributesMetadata.forEach((d) => applyHighlightFilters(d, highlightsWithAttributes));
26
26
  const getFilterJaql = (f) => {
27
+ const jaql = f.jaql();
27
28
  if (filterRelations) {
28
- return Object.assign(Object.assign({}, f.jaql()), { instanceid: f.guid });
29
+ // instanceid is needed for filter relations only
30
+ if (Array.isArray(jaql)) {
31
+ return jaql.map((j) => (Object.assign(Object.assign({}, j), { instanceid: f.guid })));
32
+ }
33
+ else {
34
+ return Object.assign(Object.assign({}, jaql), { instanceid: f.guid });
35
+ }
29
36
  }
30
- return f.jaql();
37
+ return jaql;
31
38
  };
32
39
  const filtersMetadata = (shouldSkipHighlightsWithoutAttributes
33
- ? filters.map((d) => getFilterJaql(d))
34
- : [...filters, ...highlightsWithoutAttributes].map((d) => getFilterJaql(d))).filter((f) => {
40
+ ? filters.flatMap((d) => getFilterJaql(d))
41
+ : [...filters, ...highlightsWithoutAttributes].flatMap((d) => getFilterJaql(d))).filter((f) => {
35
42
  return Object.keys(f.jaql.filter || {}).length !== 0;
36
43
  });
37
44
  if (shouldSkipHighlightsWithoutAttributes && highlightsWithoutAttributes.length > 0) {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "1.11.0",
14
+ "version": "1.12.0",
15
15
  "type": "module",
16
16
  "exports": "./dist/index.js",
17
17
  "main": "./dist/index.js",
@@ -20,10 +20,10 @@
20
20
  "author": "Sisense",
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
- "@sisense/sdk-common": "^1.11.0",
24
- "@sisense/sdk-data": "^1.11.0",
25
- "@sisense/sdk-pivot-client": "^1.11.0",
26
- "@sisense/sdk-rest-client": "^1.11.0",
23
+ "@sisense/sdk-common": "^1.12.0",
24
+ "@sisense/sdk-data": "^1.12.0",
25
+ "@sisense/sdk-pivot-client": "^1.12.0",
26
+ "@sisense/sdk-rest-client": "^1.12.0",
27
27
  "@sisense/task-manager": "^0.1.0",
28
28
  "numeral": "^2.0.6",
29
29
  "ts-deepmerge": "6.0.2",