@qrvey/utils 1.8.0-7 → 1.8.0-8

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.8.0-7*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.8.0-8*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -34,7 +34,7 @@ function getTokensFromFilters(filters, options) {
34
34
  continue;
35
35
  if (options.showScope) {
36
36
  tokens.push({
37
- token: i18nService.translate(`filter.scope_title.${scope.scope.toLowerCase()}`) + ":",
37
+ token: `${i18nService.translate(`filter.scope_title.${scope.scope.toLowerCase()}`)}:`,
38
38
  type: FILTER_TOKENS_STRUCTURE_TYPE_1.FILTER_TOKENS_STRUCTURE_TYPE.SCOPE,
39
39
  });
40
40
  }
@@ -44,7 +44,7 @@ function getTokensFromFilters(filters, options) {
44
44
  continue;
45
45
  if (options.showDatabaseName) {
46
46
  tokens.push({
47
- token: database.label + ":",
47
+ token: `${database.label}:`,
48
48
  type: FILTER_TOKENS_STRUCTURE_TYPE_1.FILTER_TOKENS_STRUCTURE_TYPE.DATABASE_NAME,
49
49
  });
50
50
  }
@@ -60,27 +60,26 @@ function getTokensFromFilters(filters, options) {
60
60
  if (!thereIsFiltersWithValues)
61
61
  thereIsFiltersWithValues = true;
62
62
  if (options.showChartName && scope.scope === constants_1.FILTER_SCOPE.CHART) {
63
- const searchToken = tokens.find((token) => token.token === filter.extras.filterLabel + ":");
63
+ const searchToken = tokens.find((token) => token.token === `${filter.extras.filterLabel}:` &&
64
+ token.id === filter.extras.panelid);
64
65
  if (!searchToken) {
65
66
  if (((_b = tokens[tokens.length - 1]) === null || _b === void 0 ? void 0 : _b.type) ===
66
67
  FILTER_TOKENS_STRUCTURE_TYPE_1.FILTER_TOKENS_STRUCTURE_TYPE.LOGICAL_OPERATOR) {
67
68
  tokens.pop();
68
69
  }
69
70
  tokens.push({
70
- token: filter.extras.filterLabel + ":",
71
+ token: `${filter.extras.filterLabel}:`,
71
72
  type: FILTER_TOKENS_STRUCTURE_TYPE_1.FILTER_TOKENS_STRUCTURE_TYPE.CHART_NAME,
73
+ id: filter.extras.panelid,
72
74
  });
73
75
  }
74
76
  }
75
77
  let columnLabel = filter.column.label;
76
78
  if ((_c = filter === null || filter === void 0 ? void 0 : filter.column) === null || _c === void 0 ? void 0 : _c.aggregate) {
77
- columnLabel +=
78
- " (" +
79
- i18nService.translate(`common.aggregate_labels.${(_d = filter === null || filter === void 0 ? void 0 : filter.column) === null || _d === void 0 ? void 0 : _d.aggregate.toLowerCase()}`) +
80
- ")";
79
+ columnLabel += ` (${i18nService.translate(`common.aggregate_labels.${(_d = filter === null || filter === void 0 ? void 0 : filter.column) === null || _d === void 0 ? void 0 : _d.aggregate.toLowerCase()}`)})`;
81
80
  }
82
81
  tokens.push({
83
- token: columnLabel + ":",
82
+ token: `${columnLabel}:`,
84
83
  type: FILTER_TOKENS_STRUCTURE_TYPE_1.FILTER_TOKENS_STRUCTURE_TYPE.COLUMN_NAME,
85
84
  });
86
85
  const property = (0, getFilterPropertyLabel_1.getFilterPropertyLabel)(filter, settings.translate);
@@ -2,4 +2,5 @@ import { FILTER_TOKENS_STRUCTURE_TYPE } from "../constants/common/FILTER_TOKENS_
2
2
  export interface IFFilterTokens {
3
3
  token: string;
4
4
  type: FILTER_TOKENS_STRUCTURE_TYPE;
5
+ id?: string;
5
6
  }
@@ -31,7 +31,7 @@ export function getTokensFromFilters(filters, options) {
31
31
  continue;
32
32
  if (options.showScope) {
33
33
  tokens.push({
34
- token: i18nService.translate(`filter.scope_title.${scope.scope.toLowerCase()}`) + ":",
34
+ token: `${i18nService.translate(`filter.scope_title.${scope.scope.toLowerCase()}`)}:`,
35
35
  type: FILTER_TOKENS_STRUCTURE_TYPE.SCOPE,
36
36
  });
37
37
  }
@@ -41,7 +41,7 @@ export function getTokensFromFilters(filters, options) {
41
41
  continue;
42
42
  if (options.showDatabaseName) {
43
43
  tokens.push({
44
- token: database.label + ":",
44
+ token: `${database.label}:`,
45
45
  type: FILTER_TOKENS_STRUCTURE_TYPE.DATABASE_NAME,
46
46
  });
47
47
  }
@@ -57,27 +57,26 @@ export function getTokensFromFilters(filters, options) {
57
57
  if (!thereIsFiltersWithValues)
58
58
  thereIsFiltersWithValues = true;
59
59
  if (options.showChartName && scope.scope === FILTER_SCOPE.CHART) {
60
- const searchToken = tokens.find((token) => token.token === filter.extras.filterLabel + ":");
60
+ const searchToken = tokens.find((token) => token.token === `${filter.extras.filterLabel}:` &&
61
+ token.id === filter.extras.panelid);
61
62
  if (!searchToken) {
62
63
  if (((_b = tokens[tokens.length - 1]) === null || _b === void 0 ? void 0 : _b.type) ===
63
64
  FILTER_TOKENS_STRUCTURE_TYPE.LOGICAL_OPERATOR) {
64
65
  tokens.pop();
65
66
  }
66
67
  tokens.push({
67
- token: filter.extras.filterLabel + ":",
68
+ token: `${filter.extras.filterLabel}:`,
68
69
  type: FILTER_TOKENS_STRUCTURE_TYPE.CHART_NAME,
70
+ id: filter.extras.panelid,
69
71
  });
70
72
  }
71
73
  }
72
74
  let columnLabel = filter.column.label;
73
75
  if ((_c = filter === null || filter === void 0 ? void 0 : filter.column) === null || _c === void 0 ? void 0 : _c.aggregate) {
74
- columnLabel +=
75
- " (" +
76
- i18nService.translate(`common.aggregate_labels.${(_d = filter === null || filter === void 0 ? void 0 : filter.column) === null || _d === void 0 ? void 0 : _d.aggregate.toLowerCase()}`) +
77
- ")";
76
+ columnLabel += ` (${i18nService.translate(`common.aggregate_labels.${(_d = filter === null || filter === void 0 ? void 0 : filter.column) === null || _d === void 0 ? void 0 : _d.aggregate.toLowerCase()}`)})`;
78
77
  }
79
78
  tokens.push({
80
- token: columnLabel + ":",
79
+ token: `${columnLabel}:`,
81
80
  type: FILTER_TOKENS_STRUCTURE_TYPE.COLUMN_NAME,
82
81
  });
83
82
  const property = getFilterPropertyLabel(filter, settings.translate);
@@ -2,4 +2,5 @@ import { FILTER_TOKENS_STRUCTURE_TYPE } from "../constants/common/FILTER_TOKENS_
2
2
  export interface IFFilterTokens {
3
3
  token: string;
4
4
  type: FILTER_TOKENS_STRUCTURE_TYPE;
5
+ id?: string;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.8.0-7",
3
+ "version": "1.8.0-8",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",