@sisense/sdk-query-client 1.15.1 → 1.17.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.
@@ -33,10 +33,10 @@ export class DimensionalQueryClient {
33
33
  * @throws Error if query description is invalid
34
34
  */
35
35
  executeQuery(queryDescription, config) {
36
- validateQueryDescription(queryDescription);
37
36
  const taskPassport = new QueryTaskPassport('SEND_JAQL_QUERY', queryDescription, Object.assign(Object.assign({}, (config ? config : {})), { shouldSkipHighlightsWithoutAttributes: this.shouldSkipHighlightsWithoutAttributes || false }));
38
37
  return {
39
38
  resultPromise: new Promise((resolve, reject) => {
39
+ validateQueryDescription(queryDescription);
40
40
  void this.taskManager.executeQuerySending(taskPassport).then((executionResult) => {
41
41
  if (executionResult.status === ExecutionResultStatus.SUCCESS) {
42
42
  resolve(executionResult.result);
@@ -50,10 +50,10 @@ export class DimensionalQueryClient {
50
50
  };
51
51
  }
52
52
  executeCsvQuery(queryDescription, config) {
53
- validateQueryDescription(queryDescription);
54
53
  const taskPassport = new QueryTaskPassport('SEND_DOWNLOAD_CSV_QUERY', queryDescription, Object.assign(Object.assign({}, (config ? config : {})), { shouldSkipHighlightsWithoutAttributes: this.shouldSkipHighlightsWithoutAttributes || false }));
55
54
  return {
56
55
  resultPromise: new Promise((resolve, reject) => {
56
+ validateQueryDescription(queryDescription);
57
57
  void this.taskManager.executeDownloadCsvSending(taskPassport).then((executionResult) => {
58
58
  if (executionResult.status === ExecutionResultStatus.SUCCESS) {
59
59
  resolve(executionResult.result);
@@ -75,10 +75,10 @@ export class DimensionalQueryClient {
75
75
  * @throws Error if query description is invalid
76
76
  */
77
77
  executePivotQuery(pivotQueryDescription, config) {
78
- validatePivotQueryDescription(pivotQueryDescription);
79
78
  const taskPassport = new PivotQueryTaskPassport('SEND_JAQL_QUERY', pivotQueryDescription, Object.assign(Object.assign({}, (config ? config : {})), { shouldSkipHighlightsWithoutAttributes: this.shouldSkipHighlightsWithoutAttributes || false }));
80
79
  return {
81
80
  resultPromise: new Promise((resolve, reject) => {
81
+ validatePivotQueryDescription(pivotQueryDescription);
82
82
  void this.taskManager.executePivotQuerySending(taskPassport).then((executionResult) => {
83
83
  if (executionResult.status === ExecutionResultStatus.SUCCESS) {
84
84
  resolve(executionResult.result);
@@ -22,20 +22,31 @@ export function prepareResultAsColsAndRows(data, metadata) {
22
22
  */
23
23
  export function setCellsBlur(rows) {
24
24
  var _a;
25
- // An array indicating whether `blur` is enabled per each column.
26
- const blurEnabledPerColumn = (_a = rows[0]) === null || _a === void 0 ? void 0 : _a.map((_value, index) => {
27
- return rows.some((r) => 'selected' in r[index]);
25
+ // A boolean flag indicating whether highlight is enabled on some column.
26
+ let isHighlightEnabledSomeColumn = false;
27
+ // An array indicating whether highlight is enabled per each column.
28
+ const highlightEnabledPerColumn = (_a = rows[0]) === null || _a === void 0 ? void 0 : _a.map((_value, index) => {
29
+ const isHighlightEnabled = rows.some((r) => 'selected' in r[index]);
30
+ if (isHighlightEnabled) {
31
+ isHighlightEnabledSomeColumn = true;
32
+ }
33
+ return isHighlightEnabled;
28
34
  });
29
35
  return rows.map((r) => {
30
36
  // calculates a single `blur` value for a whole row based on each column (cell) configuration.
31
- const blur = blurEnabledPerColumn.some((isBlurEnabled, columnIndex) => {
32
- return isBlurEnabled && !r[columnIndex].selected;
33
- });
34
- return r.map((d) => ({
35
- data: d.data,
36
- text: d.text,
37
- blur,
38
- }));
37
+ // true: the data value is blurred
38
+ // false: the data value is highlighted
39
+ // undefined: the data value is neutral (neither highlighted nor blurred)
40
+ const blur = !isHighlightEnabledSomeColumn
41
+ ? undefined
42
+ : highlightEnabledPerColumn.some((isHighlightEnabled, columnIndex) => isHighlightEnabled && !r[columnIndex].selected);
43
+ return r.map((d) => blur !== undefined
44
+ ? {
45
+ data: d.data,
46
+ text: d.text,
47
+ blur,
48
+ }
49
+ : { data: d.data, text: d.text });
39
50
  });
40
51
  }
41
52
  export function getQueryResultValues({ values = [], metadata = [] }) {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "1.15.1",
14
+ "version": "1.17.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.15.1",
24
- "@sisense/sdk-data": "^1.15.1",
25
- "@sisense/sdk-pivot-client": "^1.15.1",
26
- "@sisense/sdk-rest-client": "^1.15.1",
23
+ "@sisense/sdk-common": "^1.17.0",
24
+ "@sisense/sdk-data": "^1.17.0",
25
+ "@sisense/sdk-pivot-client": "^1.17.0",
26
+ "@sisense/sdk-rest-client": "^1.17.0",
27
27
  "@sisense/task-manager": "^0.1.0",
28
28
  "numeral": "^2.0.6",
29
29
  "ts-deepmerge": "6.0.2",
@@ -32,6 +32,7 @@
32
32
  "scripts": {
33
33
  "type-check": "tsc --noEmit",
34
34
  "build": "tsc --build tsconfig.build.json",
35
+ "build:watch": "tsc --build tsconfig.build.json --watch",
35
36
  "build:prod": "tsc --project tsconfig.prod.json",
36
37
  "clean": "rm -rf dist coverage tsconfig.build.tsbuildinfo tsconfig.prod.tsbuildinfo",
37
38
  "lint": "eslint . --fix",