@qrvey/utils 1.9.0-2 → 1.9.0-4

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.9.0-2*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.9.0-4*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -18,11 +18,14 @@ function getTokensFromFilters(filters, options) {
18
18
  const i18nService = options.i18nService;
19
19
  const settings = {
20
20
  translate: i18nService.translate.bind(i18nService),
21
+ addEnableds: true,
21
22
  };
22
23
  const getValue = (valueItem) => {
23
- var _a;
24
+ var _a, _b;
24
25
  if (valueItem.value) {
25
- return ((_a = valueItem.displayed) !== null && _a !== void 0 ? _a : true) ? valueItem.value : "";
26
+ return ((_a = valueItem.displayed) !== null && _a !== void 0 ? _a : true) && ((_b = valueItem.enabled) !== null && _b !== void 0 ? _b : true)
27
+ ? valueItem.value
28
+ : "";
26
29
  }
27
30
  else if (valueItem.imageUrl) {
28
31
  return `(${i18nService.translate("filter.value_container.no_label")})`;
@@ -50,8 +50,8 @@ class UChartApi {
50
50
  value: summary,
51
51
  }))
52
52
  : [
53
- { value: (0, get_1._get)(response, "[0].min") },
54
- { value: (0, get_1._get)(response, "[0].max") },
53
+ { value: (0, get_1._get)(response, "[0].extras.summary.min") },
54
+ { value: (0, get_1._get)(response, "[0].extras.summary.max") },
55
55
  ];
56
56
  }
57
57
  else if (!UChartApi.isResultEmpty(response)) {
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.I18nServiceConcrete = exports.I18nService = exports.I18nServiceBuilder = void 0;
16
16
  const i18next_1 = __importDefault(require("i18next"));
17
+ const general_1 = require("../../general");
17
18
  const mergeDeep_1 = require("../../general/object/mergeDeep");
18
19
  class I18nServiceBuilder {
19
20
  static buildI18n(i18nDefault, i18nResource) {
@@ -21,7 +22,9 @@ class I18nServiceBuilder {
21
22
  }
22
23
  static _initI18n(i18nDefault, i18nResource) {
23
24
  return __awaiter(this, void 0, void 0, function* () {
24
- if (!i18next_1.default.isInitialized) {
25
+ if (!i18next_1.default.isInitialized ||
26
+ (0, general_1._get)(i18next_1.default, "store.data.en.translation.common.aggregates") !==
27
+ (0, general_1._get)(i18nResource, "common.aggregates")) {
25
28
  yield this.getI18nInstance(i18nDefault, i18nResource, i18next_1.default);
26
29
  }
27
30
  return new I18nServiceConcrete(i18next_1.default);
@@ -23,7 +23,7 @@ class ChartsApi {
23
23
  data.logic = data.filters;
24
24
  delete data.filters;
25
25
  }
26
- return Request_1.default.post(Object.assign(Object.assign({}, this.config), { endpoint: newEndpoint ? UCHART_ENDPOINT_1.UCHART_ENDPOINT : CHART_ENDPOINT_1.CHART_ENDPOINT, signal }), "/results", data);
26
+ return Request_1.default.post(Object.assign(Object.assign({}, this.config), { endpoint: newEndpoint ? UCHART_ENDPOINT_1.UCHART_ENDPOINT : CHART_ENDPOINT_1.CHART_ENDPOINT, signal }), newEndpoint ? "" : "/results", data);
27
27
  }
28
28
  getResultsPagination(data, ignoreSignal = false) {
29
29
  const signal = ignoreSignal ? undefined : this.createSignal();
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UCHART_ENDPOINT = void 0;
4
4
  exports.UCHART_ENDPOINT = {
5
- uri: "/app/:app_id/qrvey/:qrvey_id/analytiq/uchart",
6
- version: 4,
5
+ uri: "/app/:app_id/qrvey/:qrvey_id/analytics/results/chart",
6
+ version: 5,
7
7
  };
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UCHART_PAGINATION_ENDPOINT = void 0;
4
4
  exports.UCHART_PAGINATION_ENDPOINT = {
5
- uri: "/app/:app_id/qrvey/:qrvey_id/analytiq/uchart/results/pagination",
6
- version: 4,
5
+ uri: "/app/:app_id/qrvey/:qrvey_id/analytics/results/groups",
6
+ version: 5,
7
7
  };
@@ -15,11 +15,14 @@ export function getTokensFromFilters(filters, options) {
15
15
  const i18nService = options.i18nService;
16
16
  const settings = {
17
17
  translate: i18nService.translate.bind(i18nService),
18
+ addEnableds: true,
18
19
  };
19
20
  const getValue = (valueItem) => {
20
- var _a;
21
+ var _a, _b;
21
22
  if (valueItem.value) {
22
- return ((_a = valueItem.displayed) !== null && _a !== void 0 ? _a : true) ? valueItem.value : "";
23
+ return ((_a = valueItem.displayed) !== null && _a !== void 0 ? _a : true) && ((_b = valueItem.enabled) !== null && _b !== void 0 ? _b : true)
24
+ ? valueItem.value
25
+ : "";
23
26
  }
24
27
  else if (valueItem.imageUrl) {
25
28
  return `(${i18nService.translate("filter.value_container.no_label")})`;
@@ -45,8 +45,8 @@ export default class UChartApi {
45
45
  value: summary,
46
46
  }))
47
47
  : [
48
- { value: _get(response, "[0].min") },
49
- { value: _get(response, "[0].max") },
48
+ { value: _get(response, "[0].extras.summary.min") },
49
+ { value: _get(response, "[0].extras.summary.max") },
50
50
  ];
51
51
  }
52
52
  else if (!UChartApi.isResultEmpty(response)) {
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import i18next from "i18next";
11
+ import { _get } from "../../general";
11
12
  import { mergeDeep } from "../../general/object/mergeDeep";
12
13
  export class I18nServiceBuilder {
13
14
  static buildI18n(i18nDefault, i18nResource) {
@@ -15,7 +16,9 @@ export class I18nServiceBuilder {
15
16
  }
16
17
  static _initI18n(i18nDefault, i18nResource) {
17
18
  return __awaiter(this, void 0, void 0, function* () {
18
- if (!i18next.isInitialized) {
19
+ if (!i18next.isInitialized ||
20
+ _get(i18next, "store.data.en.translation.common.aggregates") !==
21
+ _get(i18nResource, "common.aggregates")) {
19
22
  yield this.getI18nInstance(i18nDefault, i18nResource, i18next);
20
23
  }
21
24
  return new I18nServiceConcrete(i18next);
@@ -18,7 +18,7 @@ export default class ChartsApi {
18
18
  data.logic = data.filters;
19
19
  delete data.filters;
20
20
  }
21
- return Request.post(Object.assign(Object.assign({}, this.config), { endpoint: newEndpoint ? UCHART_ENDPOINT : CHART_ENDPOINT, signal }), "/results", data);
21
+ return Request.post(Object.assign(Object.assign({}, this.config), { endpoint: newEndpoint ? UCHART_ENDPOINT : CHART_ENDPOINT, signal }), newEndpoint ? "" : "/results", data);
22
22
  }
23
23
  getResultsPagination(data, ignoreSignal = false) {
24
24
  const signal = ignoreSignal ? undefined : this.createSignal();
@@ -1,4 +1,4 @@
1
1
  export const UCHART_ENDPOINT = {
2
- uri: "/app/:app_id/qrvey/:qrvey_id/analytiq/uchart",
3
- version: 4,
2
+ uri: "/app/:app_id/qrvey/:qrvey_id/analytics/results/chart",
3
+ version: 5,
4
4
  };
@@ -1,4 +1,4 @@
1
1
  export const UCHART_PAGINATION_ENDPOINT = {
2
- uri: "/app/:app_id/qrvey/:qrvey_id/analytiq/uchart/results/pagination",
3
- version: 4,
2
+ uri: "/app/:app_id/qrvey/:qrvey_id/analytics/results/groups",
3
+ version: 5,
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.9.0-2",
3
+ "version": "1.9.0-4",
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",