@qrvey/utils 1.9.0-filter-visibility-0 → 1.9.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.
- package/README.md +1 -1
- package/dist/cjs/constants/Charts.Const.d.ts +2 -1
- package/dist/cjs/constants/Charts.Const.js +1 -0
- package/dist/cjs/filters/adapters/FDToFlatUI.js +1 -5
- package/dist/cjs/filters/adapters/UIToFlatUI.js +0 -4
- package/dist/cjs/filters/adapters/UIToOldLogic.js +0 -1
- package/dist/cjs/filters/adapters/flatUIToFD.js +0 -4
- package/dist/cjs/filters/adapters/flatUIToUI.js +0 -4
- package/dist/cjs/filters/adapters/logicToFlatUI.js +4 -7
- package/dist/cjs/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +0 -2
- package/dist/cjs/filters/helpers/backend/buildExpression.js +0 -1
- package/dist/cjs/filters/helpers/common/resolveDatasetConditions.js +0 -5
- package/dist/cjs/filters/helpers/common/resolveFilterConditions.js +0 -5
- package/dist/cjs/filters/helpers/common/resolveScopeConditions.js +0 -5
- package/dist/cjs/filters/helpers/getTokensFromFilters.js +5 -2
- package/dist/cjs/filters/interfaces/OLD_IFilterDetail.d.ts +0 -4
- package/dist/cjs/filters/interfaces/builder/IFilterBuilderSettings.d.ts +0 -5
- package/dist/cjs/filters/interfaces/common/IFSFilter.d.ts +0 -3
- package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilter.d.ts +0 -2
- package/dist/cjs/filters/interfaces/common/index.d.ts +0 -1
- package/dist/cjs/filters/interfaces/common/index.js +0 -1
- package/dist/cjs/filters/interfaces/settings/IFSettingsFilterBuilder.d.ts +0 -1
- package/dist/cjs/filters/interfaces/settings/IFSettingsFilterPanel.d.ts +0 -1
- package/dist/cjs/filters/services/UChartApi.d.ts +7 -0
- package/dist/cjs/filters/services/UChartApi.js +24 -16
- package/dist/cjs/filters/services/UChartPaginationApi.d.ts +7 -0
- package/dist/cjs/filters/services/UChartPaginationApi.js +14 -10
- package/dist/cjs/globalization/interfaces/tabular_view/II18nTabularView.d.ts +20 -1
- package/dist/cjs/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +20 -1
- package/dist/cjs/globalization/service/i18nextBuilder.js +4 -1
- package/dist/cjs/qrvey/constants/APP_DATASET_TYPE_LIST.js +1 -0
- package/dist/cjs/qrvey/constants/APP_TYPE.d.ts +2 -1
- package/dist/cjs/qrvey/constants/APP_TYPE.js +1 -0
- package/dist/cjs/qrvey/helpers/transformValue.js +8 -4
- package/dist/cjs/services/api/Charts.api.js +1 -1
- package/dist/cjs/services/constants/UCHART_ENDPOINT.js +2 -2
- package/dist/cjs/services/constants/UCHART_PAGINATION_ENDPOINT.js +2 -2
- package/dist/constants/Charts.Const.d.ts +2 -1
- package/dist/constants/Charts.Const.js +1 -0
- package/dist/filters/adapters/FDToFlatUI.js +1 -5
- package/dist/filters/adapters/UIToFlatUI.js +0 -4
- package/dist/filters/adapters/UIToOldLogic.js +0 -1
- package/dist/filters/adapters/flatUIToFD.js +0 -4
- package/dist/filters/adapters/flatUIToUI.js +0 -4
- package/dist/filters/adapters/logicToFlatUI.js +4 -7
- package/dist/filters/constants/settings/FILTER_SETTINGS_DEFAULT.js +0 -2
- package/dist/filters/helpers/backend/buildExpression.js +0 -1
- package/dist/filters/helpers/common/resolveDatasetConditions.js +0 -5
- package/dist/filters/helpers/common/resolveFilterConditions.js +0 -5
- package/dist/filters/helpers/common/resolveScopeConditions.js +0 -5
- package/dist/filters/helpers/getTokensFromFilters.js +5 -2
- package/dist/filters/interfaces/OLD_IFilterDetail.d.ts +0 -4
- package/dist/filters/interfaces/builder/IFilterBuilderSettings.d.ts +0 -5
- package/dist/filters/interfaces/common/IFSFilter.d.ts +0 -3
- package/dist/filters/interfaces/common/IFSParamsToGetFilter.d.ts +0 -2
- package/dist/filters/interfaces/common/index.d.ts +0 -1
- package/dist/filters/interfaces/common/index.js +0 -1
- package/dist/filters/interfaces/settings/IFSettingsFilterBuilder.d.ts +0 -1
- package/dist/filters/interfaces/settings/IFSettingsFilterPanel.d.ts +0 -1
- package/dist/filters/services/UChartApi.d.ts +7 -0
- package/dist/filters/services/UChartApi.js +24 -16
- package/dist/filters/services/UChartPaginationApi.d.ts +7 -0
- package/dist/filters/services/UChartPaginationApi.js +14 -10
- package/dist/globalization/interfaces/tabular_view/II18nTabularView.d.ts +20 -1
- package/dist/globalization/labels/tabular_view/I18N_TABULAR_VIEW.js +20 -1
- package/dist/globalization/service/i18nextBuilder.js +4 -1
- package/dist/qrvey/constants/APP_DATASET_TYPE_LIST.js +1 -0
- package/dist/qrvey/constants/APP_TYPE.d.ts +2 -1
- package/dist/qrvey/constants/APP_TYPE.js +1 -0
- package/dist/qrvey/helpers/transformValue.js +8 -4
- package/dist/services/api/Charts.api.js +1 -1
- package/dist/services/constants/UCHART_ENDPOINT.js +2 -2
- package/dist/services/constants/UCHART_PAGINATION_ENDPOINT.js +2 -2
- package/package.json +1 -1
- package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.d.ts +0 -9
- package/dist/cjs/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.js +0 -2
- package/dist/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.d.ts +0 -9
- package/dist/filters/interfaces/common/IFSParamsToGetFilterDisplayeds.js +0 -1
package/README.md
CHANGED
|
@@ -25,7 +25,8 @@ export declare enum CHART_TYPE {
|
|
|
25
25
|
DIAL_METRIC = "DIAL",
|
|
26
26
|
BULLET_METRIC = "BULLET",
|
|
27
27
|
SUMMARY_CHART = "SUMMARY_CHART",
|
|
28
|
-
MINMAX_CHART = "MINMAX_CHART"
|
|
28
|
+
MINMAX_CHART = "MINMAX_CHART",
|
|
29
|
+
COMBINED_CHART = "COMBINED_CHART"
|
|
29
30
|
}
|
|
30
31
|
export declare enum CHART_DIMENSION {
|
|
31
32
|
CATEGORIES = "categories",
|
|
@@ -30,6 +30,7 @@ var CHART_TYPE;
|
|
|
30
30
|
CHART_TYPE["BULLET_METRIC"] = "BULLET";
|
|
31
31
|
CHART_TYPE["SUMMARY_CHART"] = "SUMMARY_CHART";
|
|
32
32
|
CHART_TYPE["MINMAX_CHART"] = "MINMAX_CHART";
|
|
33
|
+
CHART_TYPE["COMBINED_CHART"] = "COMBINED_CHART";
|
|
33
34
|
})(CHART_TYPE = exports.CHART_TYPE || (exports.CHART_TYPE = {}));
|
|
34
35
|
var CHART_DIMENSION;
|
|
35
36
|
(function (CHART_DIMENSION) {
|
|
@@ -40,7 +40,6 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
40
40
|
scope.datasets.forEach((dataset) => {
|
|
41
41
|
if (dataset.filters.length > 0) {
|
|
42
42
|
dataset.filters.forEach((filter) => {
|
|
43
|
-
var _a, _b, _c, _d;
|
|
44
43
|
const datasetInfo = datasetsInfo.find((dInfo) => dInfo.qrveyid === dataset.qrveyid);
|
|
45
44
|
let columnInfo;
|
|
46
45
|
if (!(0, isEmpty_1.isEmpty)(datasetInfo))
|
|
@@ -66,11 +65,8 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
66
65
|
type: (columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.type) || filter.column.type,
|
|
67
66
|
},
|
|
68
67
|
dateSection: filter.dateSection,
|
|
69
|
-
|
|
70
|
-
displayed: (_b = filter.displayed) !== null && _b !== void 0 ? _b : true,
|
|
71
|
-
editable: (_c = filter.editable) !== null && _c !== void 0 ? _c : true,
|
|
68
|
+
displayed: filter.displayed,
|
|
72
69
|
enabled: filter.enabled,
|
|
73
|
-
enableable: (_d = filter.enableable) !== null && _d !== void 0 ? _d : true,
|
|
74
70
|
extras: Object.assign(Object.assign({}, filter.extras), { panelid: filter.extras.panelid, filterLabel: filter.extras.filterLabel, info, scope: filter.extras.scope, scopeid: filter.extras.scopeid, section: filter.extras.section, scopeInfo: {
|
|
75
71
|
collapsed: scope.collapsed,
|
|
76
72
|
enabled: scope.enabled,
|
|
@@ -38,7 +38,6 @@ function UI21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
38
38
|
scope.datasets.forEach((dataset) => {
|
|
39
39
|
if (dataset.filters.length > 0) {
|
|
40
40
|
dataset.filters.forEach((filter) => {
|
|
41
|
-
var _a, _b, _c;
|
|
42
41
|
const datasetInfo = datasetsInfo.find((dInfo) => dInfo.qrveyid === dataset.qrveyid);
|
|
43
42
|
let columnInfo;
|
|
44
43
|
if (!(0, isEmpty_1.isEmpty)(datasetInfo))
|
|
@@ -64,10 +63,7 @@ function UI21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
64
63
|
type: filter.column.type,
|
|
65
64
|
},
|
|
66
65
|
dateSection: filter.dateSection,
|
|
67
|
-
deletable: (_a = filter.deletable) !== null && _a !== void 0 ? _a : true,
|
|
68
66
|
displayed: filter.displayed,
|
|
69
|
-
editable: (_b = filter.editable) !== null && _b !== void 0 ? _b : true,
|
|
70
|
-
enableable: (_c = filter.enableable) !== null && _c !== void 0 ? _c : true,
|
|
71
67
|
enabled: filter.enabled,
|
|
72
68
|
extras: Object.assign(Object.assign({}, filter.extras), { panelid: filter.extras.panelid, filterLabel: filter.extras.filterLabel, info, scope: filter.extras.scope, scopeid: filter.extras.scopeid, section: filter.extras.section, scopeInfo: {
|
|
73
69
|
collapsed: scope.collapsed,
|
|
@@ -136,6 +136,5 @@ const getFilterDetail = (filter, scope, dataset) => {
|
|
|
136
136
|
uiValue: (0, getUIValues_1.getUIValues)(filter, { addEnableds: true }),
|
|
137
137
|
validator: filter.validator,
|
|
138
138
|
values: (0, adaptFilterValues_1.adaptFilterValues)(filter),
|
|
139
|
-
_newFilters: Object.assign({}, filter),
|
|
140
139
|
};
|
|
141
140
|
};
|
|
@@ -85,7 +85,6 @@ function buildDataset(uFilter) {
|
|
|
85
85
|
* @returns an filter structure
|
|
86
86
|
*/
|
|
87
87
|
function buildFilter(uFilter) {
|
|
88
|
-
var _a, _b, _c;
|
|
89
88
|
const _uFilter = (0, cloneDeep_1.cloneDeep)(uFilter);
|
|
90
89
|
const info = !(0, isEmpty_1.isEmpty)(_uFilter.extras.info)
|
|
91
90
|
? { icon: _uFilter.extras.info.icon, label: _uFilter.extras.info.label }
|
|
@@ -104,10 +103,7 @@ function buildFilter(uFilter) {
|
|
|
104
103
|
type: _uFilter.column.type,
|
|
105
104
|
},
|
|
106
105
|
dateSection: _uFilter.dateSection,
|
|
107
|
-
deletable: (_a = _uFilter.deletable) !== null && _a !== void 0 ? _a : true,
|
|
108
106
|
displayed: _uFilter.displayed,
|
|
109
|
-
editable: (_b = _uFilter.editable) !== null && _b !== void 0 ? _b : true,
|
|
110
|
-
enableable: (_c = _uFilter.enableable) !== null && _c !== void 0 ? _c : true,
|
|
111
107
|
filterid: _uFilter.filterid,
|
|
112
108
|
enabled: _uFilter.enabled,
|
|
113
109
|
extras: Object.assign(Object.assign({}, _uFilter.extras), { panelid: _uFilter.extras.panelid, filterLabel: _uFilter.extras.filterLabel, info, scope: _uFilter.extras.scope, scopeid: _uFilter.extras.scopeid, section: _uFilter.extras.section }),
|
|
@@ -95,7 +95,6 @@ function buildDataset(uFilter) {
|
|
|
95
95
|
* @returns an filter structure
|
|
96
96
|
*/
|
|
97
97
|
function buildFilter(uFilter) {
|
|
98
|
-
var _a, _b, _c;
|
|
99
98
|
const _uFilter = (0, cloneDeep_1.cloneDeep)(uFilter);
|
|
100
99
|
const info = !(0, isEmpty_1.isEmpty)(_uFilter.extras.info)
|
|
101
100
|
? { icon: _uFilter.extras.info.icon, label: _uFilter.extras.info.label }
|
|
@@ -119,10 +118,7 @@ function buildFilter(uFilter) {
|
|
|
119
118
|
type: _uFilter.column.type,
|
|
120
119
|
},
|
|
121
120
|
dateSection: _uFilter.dateSection,
|
|
122
|
-
deletable: (_a = _uFilter.deletable) !== null && _a !== void 0 ? _a : true,
|
|
123
121
|
displayed: _uFilter.displayed,
|
|
124
|
-
editable: (_b = _uFilter.editable) !== null && _b !== void 0 ? _b : true,
|
|
125
|
-
enableable: (_c = _uFilter.enableable) !== null && _c !== void 0 ? _c : true,
|
|
126
122
|
filterid: _uFilter.filterid,
|
|
127
123
|
enabled: _uFilter.enabled,
|
|
128
124
|
extras: Object.assign(Object.assign({}, _uFilter.extras), { panelid: _uFilter.extras.panelid, filterLabel: _uFilter.extras.filterLabel, info, scope: _uFilter.extras.scope, scopeid: _uFilter.extras.scopeid, section: _uFilter.extras.section }),
|
|
@@ -65,7 +65,7 @@ function buildFilterByExpression(expression, scopeItem, uFilters) {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
function getFilterByExpression(expression, scopeItem) {
|
|
68
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
68
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
69
69
|
const uiExtras = expression.uiExtras;
|
|
70
70
|
const scopeid = scopeItem.scope !== FILTER_SCOPE_1.FILTER_SCOPE.GLOBAL
|
|
71
71
|
? (0, get_1._get)(scopeItem, "uiExtras.scopeid")
|
|
@@ -91,14 +91,11 @@ function getFilterByExpression(expression, scopeItem) {
|
|
|
91
91
|
type: (_l = uiExtras.column) === null || _l === void 0 ? void 0 : _l.type,
|
|
92
92
|
},
|
|
93
93
|
dateSection: uiExtras.dateSection,
|
|
94
|
-
|
|
95
|
-
displayed: (_q = (_p = uiExtras._newFilters) === null || _p === void 0 ? void 0 : _p.displayed) !== null && _q !== void 0 ? _q : true,
|
|
96
|
-
editable: (_s = (_r = uiExtras._newFilters) === null || _r === void 0 ? void 0 : _r.editable) !== null && _s !== void 0 ? _s : true,
|
|
97
|
-
enableable: (_u = (_t = uiExtras._newFilters) === null || _t === void 0 ? void 0 : _t.enableable) !== null && _u !== void 0 ? _u : true,
|
|
94
|
+
displayed: true,
|
|
98
95
|
enabled: uiExtras.enabled,
|
|
99
96
|
extras: Object.assign(Object.assign({}, uiExtras.extras), { panelid: uiExtras.panelid, filterLabel: uiExtras.panelName, info,
|
|
100
97
|
scopeid, scope: scopeItem.scope, section: uiExtras.section, scopeInfo: {
|
|
101
|
-
collapsed: (
|
|
98
|
+
collapsed: (_m = scopeItem.uiExtras) === null || _m === void 0 ? void 0 : _m.collapsed,
|
|
102
99
|
enabled: scopeItem.enabled,
|
|
103
100
|
displayed: true,
|
|
104
101
|
scope: scopeItem.scope,
|
|
@@ -107,7 +104,7 @@ function getFilterByExpression(expression, scopeItem) {
|
|
|
107
104
|
collapsed: false,
|
|
108
105
|
enabled: true,
|
|
109
106
|
displayed: true,
|
|
110
|
-
qrveyid: (
|
|
107
|
+
qrveyid: (_o = uiExtras.column) === null || _o === void 0 ? void 0 : _o.qrveyid,
|
|
111
108
|
label: (0, get_1._get)(uiExtras.column, "dataset.name") ||
|
|
112
109
|
(0, get_1._get)(uiExtras.column, "label"),
|
|
113
110
|
} }),
|
|
@@ -12,7 +12,6 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
12
12
|
filterBuilder: {
|
|
13
13
|
scopeSelectorDisplayed: true,
|
|
14
14
|
scopeSelectorEnabled: true,
|
|
15
|
-
strictlyInteractivity: false,
|
|
16
15
|
},
|
|
17
16
|
filterDisplayer: {
|
|
18
17
|
addFilterDisplayed: true,
|
|
@@ -75,7 +74,6 @@ exports.FILTER_SETTINGS_DEFAULT = {
|
|
|
75
74
|
},
|
|
76
75
|
iconsDisplayed: true,
|
|
77
76
|
readonly: false,
|
|
78
|
-
strictlyInteractivity: false,
|
|
79
77
|
updateFilterInfo: true,
|
|
80
78
|
},
|
|
81
79
|
filterPanelSettings: {
|
|
@@ -16,7 +16,6 @@ function buildExpression(filter) {
|
|
|
16
16
|
const expression = {
|
|
17
17
|
groupValue: (0, getBackendGroupValue_1.getBackendGroupValue)(filter),
|
|
18
18
|
questionid: filter.column.id,
|
|
19
|
-
questionType: filter.column.type,
|
|
20
19
|
property: (0, getBackendProperty_1.getBackendProperty)(filter),
|
|
21
20
|
validationType: (0, getBackendValidator_1.getBackendValidator)(filter),
|
|
22
21
|
value: (0, getBackendValues_1.getBackendValues)(filter),
|
|
@@ -17,11 +17,6 @@ function resolveDatasetConditions(dataset, params, letPassUndefinedProperties =
|
|
|
17
17
|
(letPassUndefinedProperties && dataset.enabled == null) ||
|
|
18
18
|
(letPassUndefinedParams && params.enableds.datasets == null) ||
|
|
19
19
|
params.enableds.datasets === dataset.enabled) &&
|
|
20
|
-
(!(0, hasProperty_1._hasProperty)(params, "displayeds") ||
|
|
21
|
-
!(0, hasProperty_1._hasProperty)(params.displayeds, "datasets") ||
|
|
22
|
-
(letPassUndefinedProperties && dataset.displayed == null) ||
|
|
23
|
-
(letPassUndefinedParams && params.displayeds.datasets == null) ||
|
|
24
|
-
params.displayeds.datasets === dataset.displayed) &&
|
|
25
20
|
(!(0, hasProperty_1._hasProperty)(params, "qrveyid") ||
|
|
26
21
|
(letPassUndefinedProperties && dataset.qrveyid == null) ||
|
|
27
22
|
(letPassUndefinedParams && (0, isEmpty_1.isEmpty)(params.qrveyid)) ||
|
|
@@ -18,11 +18,6 @@ function resolveFilterConditions(filter, params, letPassUndefinedProperties = fa
|
|
|
18
18
|
(letPassUndefinedProperties && filter.enabled == null) ||
|
|
19
19
|
(letPassUndefinedParams && params.enableds.filters == null) ||
|
|
20
20
|
params.enableds.filters === filter.enabled) &&
|
|
21
|
-
(!(0, hasProperty_1._hasProperty)(params, "displayeds") ||
|
|
22
|
-
!(0, hasProperty_1._hasProperty)(params.displayeds, "filters") ||
|
|
23
|
-
(letPassUndefinedProperties && filter.displayed == null) ||
|
|
24
|
-
(letPassUndefinedParams && params.displayeds.filters == null) ||
|
|
25
|
-
params.displayeds.filters === filter.displayed) &&
|
|
26
21
|
(!(0, hasProperty_1._hasProperty)(params, "dateSection") ||
|
|
27
22
|
(letPassUndefinedProperties && filter.dateSection == null) ||
|
|
28
23
|
(letPassUndefinedParams && (0, isEmpty_1.isEmpty)(params.dateSection)) ||
|
|
@@ -17,11 +17,6 @@ function resolveScopeConditions(scope, params, letPassUndefinedProperties = fals
|
|
|
17
17
|
(letPassUndefinedProperties && scope.enabled == null) ||
|
|
18
18
|
(letPassUndefinedParams && params.enableds.scopes == null) ||
|
|
19
19
|
params.enableds.scopes === scope.enabled) &&
|
|
20
|
-
(!(0, hasProperty_1._hasProperty)(params, "displayeds") ||
|
|
21
|
-
!(0, hasProperty_1._hasProperty)(params.displayeds, "scopes") ||
|
|
22
|
-
(letPassUndefinedProperties && scope.displayed == null) ||
|
|
23
|
-
(letPassUndefinedParams && params.displayeds.scopes == null) ||
|
|
24
|
-
params.displayeds.scopes === scope.displayed) &&
|
|
25
20
|
(!(0, hasProperty_1._hasProperty)(params, "scope") ||
|
|
26
21
|
(letPassUndefinedProperties && scope.scope == null) ||
|
|
27
22
|
(letPassUndefinedParams && (0, isEmpty_1.isEmpty)(params.scope)) ||
|
|
@@ -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)
|
|
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")})`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IColumn } from "../../columns/interfaces/IColumn";
|
|
2
2
|
import { IDataset } from "../../qrvey/interfaces/IDataset";
|
|
3
|
-
import { IFSFilter } from "./common/IFSFilter";
|
|
4
3
|
import { IFSFilterExtrasInfo } from "./common/IFSFilterExtrasInfo";
|
|
5
4
|
import { IFDateSection } from "./IFDateSection";
|
|
6
5
|
import { IFOperator } from "./IFOperator";
|
|
@@ -10,8 +9,6 @@ import { IFSection } from "./IFSection";
|
|
|
10
9
|
import { IFValidator } from "./IFValidator";
|
|
11
10
|
import { IFValue } from "./IFValue";
|
|
12
11
|
import { IFUChartSettings } from "./ui/IFUChartSettings";
|
|
13
|
-
import { IFUFilter } from "./ui/IFUFilter";
|
|
14
|
-
import { IFUFlattenedFilter } from "./ui/IFUFlattenedFilter";
|
|
15
12
|
import { IFUValue } from "./ui/IFUValue";
|
|
16
13
|
export interface OLD_IFilterDetail {
|
|
17
14
|
column?: Omit<IColumn, "label"> & {
|
|
@@ -47,5 +44,4 @@ export interface OLD_IFilterDetail {
|
|
|
47
44
|
section?: IFSection;
|
|
48
45
|
groupValue?: IFProperty;
|
|
49
46
|
extras?: any;
|
|
50
|
-
_newFilters?: IFUFilter | IFSFilter | IFUFlattenedFilter;
|
|
51
47
|
}
|
|
@@ -8,9 +8,4 @@ export interface IFilterBuilderSettings {
|
|
|
8
8
|
chart?: IFUChartSettings;
|
|
9
9
|
mode?: FILTER_FLOW;
|
|
10
10
|
returningFilterStructureType?: IFStructureType;
|
|
11
|
-
displayed?: boolean;
|
|
12
|
-
displayable?: boolean;
|
|
13
|
-
deletable?: boolean;
|
|
14
|
-
editable?: boolean;
|
|
15
|
-
enableable?: boolean;
|
|
16
11
|
}
|
|
@@ -12,11 +12,8 @@ export interface IFSFilter {
|
|
|
12
12
|
collapsed: boolean;
|
|
13
13
|
column: IFSColumn;
|
|
14
14
|
dateSection?: IFDateSection;
|
|
15
|
-
deletable: boolean;
|
|
16
15
|
displayed: boolean;
|
|
17
|
-
editable: boolean;
|
|
18
16
|
enabled: boolean;
|
|
19
|
-
enableable: boolean;
|
|
20
17
|
extras: IFSFilterExtras;
|
|
21
18
|
filterid: string;
|
|
22
19
|
lookupDisplayIndex?: number;
|
|
@@ -4,7 +4,6 @@ import { IFScope } from "../IFScope";
|
|
|
4
4
|
import { IFValidator } from "../IFValidator";
|
|
5
5
|
import { IFUChartSettings } from "../ui/IFUChartSettings";
|
|
6
6
|
import { IFSColumn } from "./IFSColumn";
|
|
7
|
-
import { IFSParamsToGetFilterDisplayeds } from "./IFSParamsToGetFilterDisplayeds";
|
|
8
7
|
import { IFSParamsToGetFilterEnableds } from "./IFSParamsToGetFilterEnableds";
|
|
9
8
|
/**
|
|
10
9
|
* Structure for filter properties
|
|
@@ -12,7 +11,6 @@ import { IFSParamsToGetFilterEnableds } from "./IFSParamsToGetFilterEnableds";
|
|
|
12
11
|
export interface IFSParamsToGetFilter {
|
|
13
12
|
column?: Partial<IFSColumn>;
|
|
14
13
|
dateSection?: IFDateSection;
|
|
15
|
-
displayeds?: IFSParamsToGetFilterDisplayeds;
|
|
16
14
|
enableds?: IFSParamsToGetFilterEnableds;
|
|
17
15
|
chart?: IFUChartSettings;
|
|
18
16
|
panelid?: string;
|
|
@@ -23,7 +23,6 @@ export * from "./IFSFilterExtras";
|
|
|
23
23
|
export * from "./IFSFilterExtrasInfo";
|
|
24
24
|
export * from "./IFSGetDataValues";
|
|
25
25
|
export * from "./IFSParamsToGetFilter";
|
|
26
|
-
export * from "./IFSParamsToGetFilterDisplayeds";
|
|
27
26
|
export * from "./IFSParamsToGetFilterEnableds";
|
|
28
27
|
export * from "./IFSScope";
|
|
29
28
|
export * from "./IFSScopeID";
|
|
@@ -39,7 +39,6 @@ __exportStar(require("./IFSFilterExtras"), exports);
|
|
|
39
39
|
__exportStar(require("./IFSFilterExtrasInfo"), exports);
|
|
40
40
|
__exportStar(require("./IFSGetDataValues"), exports);
|
|
41
41
|
__exportStar(require("./IFSParamsToGetFilter"), exports);
|
|
42
|
-
__exportStar(require("./IFSParamsToGetFilterDisplayeds"), exports);
|
|
43
42
|
__exportStar(require("./IFSParamsToGetFilterEnableds"), exports);
|
|
44
43
|
__exportStar(require("./IFSScope"), exports);
|
|
45
44
|
__exportStar(require("./IFSScopeID"), exports);
|
|
@@ -89,6 +89,13 @@ export default class UChartApi {
|
|
|
89
89
|
* @returns The resulting data
|
|
90
90
|
*/
|
|
91
91
|
private _getDataFromResponse;
|
|
92
|
+
/**
|
|
93
|
+
* Tranform response in array of object with value key
|
|
94
|
+
* Null or undefined values are avoided
|
|
95
|
+
* @param records The data from preview response
|
|
96
|
+
* @returns the sumaries
|
|
97
|
+
*/
|
|
98
|
+
private static _getResponse;
|
|
92
99
|
/**
|
|
93
100
|
* Gets summaries from preview response
|
|
94
101
|
* @param records The data from preview response
|
|
@@ -46,20 +46,21 @@ class UChartApi {
|
|
|
46
46
|
const data = { data: [] };
|
|
47
47
|
if ((0, isRangeValidator_1.isRangeValidator)(uFilter.validator)) {
|
|
48
48
|
data.data = (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
49
|
-
? (0, get_1._get)(response, "[0].summary", [])
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
? (0, get_1._get)(response, "[0].summary", [])
|
|
50
|
+
.map((summary) => {
|
|
51
|
+
if (!(0, isEmpty_1.isEmpty)(summary))
|
|
52
|
+
return { value: summary };
|
|
53
|
+
})
|
|
54
|
+
.filter(Boolean)
|
|
52
55
|
: [
|
|
53
|
-
{ value: (0, get_1._get)(response, "[0].min") },
|
|
54
|
-
{ value: (0, get_1._get)(response, "[0].max") },
|
|
56
|
+
{ value: (0, get_1._get)(response, "[0].extras.summary.min") },
|
|
57
|
+
{ value: (0, get_1._get)(response, "[0].extras.summary.max") },
|
|
55
58
|
];
|
|
56
59
|
}
|
|
57
60
|
else if (!UChartApi.isResultEmpty(response)) {
|
|
58
61
|
const records = (0, get_1._get)(response, "data");
|
|
59
62
|
data.data = (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
60
|
-
?
|
|
61
|
-
value: record.key.toString(),
|
|
62
|
-
}))
|
|
63
|
+
? UChartApi._getResponse(records)
|
|
63
64
|
: this._getResponseSummaries(records);
|
|
64
65
|
}
|
|
65
66
|
return data;
|
|
@@ -122,6 +123,19 @@ class UChartApi {
|
|
|
122
123
|
}
|
|
123
124
|
return filterCharts;
|
|
124
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Tranform response in array of object with value key
|
|
128
|
+
* Null or undefined values are avoided
|
|
129
|
+
* @param records The data from preview response
|
|
130
|
+
* @returns the sumaries
|
|
131
|
+
*/
|
|
132
|
+
static _getResponse(records) {
|
|
133
|
+
return records.reduce((store, record) => {
|
|
134
|
+
const value = record.key;
|
|
135
|
+
!(0, isEmpty_1.isEmpty)(value) && store.push({ value: String(value) });
|
|
136
|
+
return store;
|
|
137
|
+
}, []);
|
|
138
|
+
}
|
|
125
139
|
}
|
|
126
140
|
exports.default = UChartApi;
|
|
127
141
|
/**
|
|
@@ -144,7 +158,6 @@ UChartApi._getPreviewRequestBody = (uFilter, filterLogic = [], chartSettings) =>
|
|
|
144
158
|
return {
|
|
145
159
|
charts: chartsBody,
|
|
146
160
|
logic: filters,
|
|
147
|
-
qrveyid: uFilter.column.qrveyid,
|
|
148
161
|
};
|
|
149
162
|
};
|
|
150
163
|
/**
|
|
@@ -171,11 +184,8 @@ UChartApi._getDimensionsBody = (uFilter, chartSettings) => {
|
|
|
171
184
|
dimensions = [
|
|
172
185
|
{
|
|
173
186
|
questionid: column.id,
|
|
174
|
-
qrveyid: column.qrveyid,
|
|
175
187
|
maxDataPoints: UChartApi._getMaxDataPoints(column, chartSettings),
|
|
176
|
-
|
|
177
|
-
formulaType: column.type === "FORMULA" ? column.formulaType : undefined,
|
|
178
|
-
sortOption: UChartApi._getSortOption(column),
|
|
188
|
+
sort: UChartApi._getSortOption(column),
|
|
179
189
|
},
|
|
180
190
|
];
|
|
181
191
|
dimensions = UChartApi._refineBodies([...dimensions], uFilter);
|
|
@@ -207,7 +217,7 @@ UChartApi._getSortOption = (column) => {
|
|
|
207
217
|
if (sortDirection == null)
|
|
208
218
|
sortDirection = "DESC";
|
|
209
219
|
}
|
|
210
|
-
return { sortBy, sortDirection };
|
|
220
|
+
return { by: sortBy, direction: sortDirection };
|
|
211
221
|
};
|
|
212
222
|
/**
|
|
213
223
|
* Gets summaries body structure
|
|
@@ -222,7 +232,6 @@ UChartApi._getSummariesBody = (uFilter) => {
|
|
|
222
232
|
property: !(0, isDateColumn_1.isDateColumn)(uFilter.column) && uFilter.column.type !== COLUMN_1.COLUMN.TIME
|
|
223
233
|
? uFilter.property
|
|
224
234
|
: undefined,
|
|
225
|
-
type: column.type,
|
|
226
235
|
};
|
|
227
236
|
let summaries = [summary];
|
|
228
237
|
if ((0, isNumericalColumn_1.isNumericalColumn)(column) || (0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
@@ -245,7 +254,6 @@ UChartApi._refineBodies = (bodies, uFilter) => {
|
|
|
245
254
|
_bodies.forEach((body) => {
|
|
246
255
|
if ((0, isDateColumn_1.isDateColumn)(uFilter.column) ||
|
|
247
256
|
uFilter.column.type === COLUMN_1.COLUMN.TIME) {
|
|
248
|
-
body.groupType = "DATE";
|
|
249
257
|
body.groupValue = uFilter.property.toUpperCase();
|
|
250
258
|
}
|
|
251
259
|
else {
|
|
@@ -95,6 +95,13 @@ export default class UChartPaginationApi {
|
|
|
95
95
|
* @returns The resulting data
|
|
96
96
|
*/
|
|
97
97
|
private _getDataFromResponse;
|
|
98
|
+
/**
|
|
99
|
+
* Tranform response in array of object with value key
|
|
100
|
+
* Null or undefined values are avoided
|
|
101
|
+
* @param records The data from preview response
|
|
102
|
+
* @returns the sumaries
|
|
103
|
+
*/
|
|
104
|
+
private static _getResponse;
|
|
98
105
|
/**
|
|
99
106
|
* Gets summaries from preview response
|
|
100
107
|
* @param records The data from preview response
|
|
@@ -56,9 +56,7 @@ class UChartPaginationApi {
|
|
|
56
56
|
if (!UChartPaginationApi.isResultPaginationEmpty(response)) {
|
|
57
57
|
const records = (0, get_1._get)(response, "data");
|
|
58
58
|
data.data = (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
59
|
-
?
|
|
60
|
-
value: record.key.toString(),
|
|
61
|
-
}))
|
|
59
|
+
? UChartPaginationApi._getResponse(records)
|
|
62
60
|
: UChartPaginationApi._getResponseSummaries(records);
|
|
63
61
|
data.data = (0, getUniqueArray_1.getUniqueArray)(data.data, "value");
|
|
64
62
|
data.total = (_a = (0, get_1._get)(response, "totalGroups", 0)) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -134,6 +132,19 @@ class UChartPaginationApi {
|
|
|
134
132
|
}
|
|
135
133
|
return filterCharts;
|
|
136
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Tranform response in array of object with value key
|
|
137
|
+
* Null or undefined values are avoided
|
|
138
|
+
* @param records The data from preview response
|
|
139
|
+
* @returns the sumaries
|
|
140
|
+
*/
|
|
141
|
+
static _getResponse(records) {
|
|
142
|
+
return records.reduce((store, record) => {
|
|
143
|
+
const value = record.key;
|
|
144
|
+
!(0, isEmpty_1.isEmpty)(value) && store.push({ value: String(value) });
|
|
145
|
+
return store;
|
|
146
|
+
}, []);
|
|
147
|
+
}
|
|
137
148
|
}
|
|
138
149
|
exports.default = UChartPaginationApi;
|
|
139
150
|
/**
|
|
@@ -171,8 +182,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
171
182
|
dimensions = [
|
|
172
183
|
{
|
|
173
184
|
questionid: column.id,
|
|
174
|
-
type: column.type,
|
|
175
|
-
formulaType: column.type === COLUMN_1.COLUMN.FORMULA ? column.formulaType : undefined,
|
|
176
185
|
sort: UChartPaginationApi._getSortOption(column),
|
|
177
186
|
},
|
|
178
187
|
];
|
|
@@ -187,9 +196,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
187
196
|
*/
|
|
188
197
|
UChartPaginationApi._getDimensionsBodyAdapter = (dimensions = []) => dimensions.map((dimension) => ({
|
|
189
198
|
questionid: dimension.questionid,
|
|
190
|
-
type: dimension.type,
|
|
191
|
-
formulaType: dimension.type === COLUMN_1.COLUMN.FORMULA ? dimension.formulaType : undefined,
|
|
192
|
-
groupType: dimension.groupType,
|
|
193
199
|
groupValue: dimension.groupValue,
|
|
194
200
|
sort: {
|
|
195
201
|
by: (0, get_1._get)(dimension, "sortOption.sortBy", "VALUE"),
|
|
@@ -236,7 +242,6 @@ UChartPaginationApi._getSummariesBody = (uFilter) => {
|
|
|
236
242
|
property: !(0, isDateColumn_1.isDateColumn)(uFilter.column) && uFilter.column.type !== COLUMN_1.COLUMN.TIME
|
|
237
243
|
? uFilter.property
|
|
238
244
|
: undefined,
|
|
239
|
-
type: column.type,
|
|
240
245
|
};
|
|
241
246
|
let summaries = [summary];
|
|
242
247
|
if ((0, isNumericalColumn_1.isNumericalColumn)(column) || (0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
@@ -259,7 +264,6 @@ UChartPaginationApi._refineBodies = (bodies, uFilter) => {
|
|
|
259
264
|
_bodies.forEach((body) => {
|
|
260
265
|
if ((0, isDateColumn_1.isDateColumn)(uFilter.column) ||
|
|
261
266
|
uFilter.column.type === COLUMN_1.COLUMN.TIME) {
|
|
262
|
-
body.groupType = "DATE";
|
|
263
267
|
body.groupValue = uFilter.property.toUpperCase();
|
|
264
268
|
}
|
|
265
269
|
else {
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
export interface II18nTabularView {
|
|
2
|
-
|
|
2
|
+
add_access_point: string;
|
|
3
|
+
add_modal_title: string;
|
|
4
|
+
add_modal_add_option: string;
|
|
5
|
+
add_modal_cancel_option: string;
|
|
6
|
+
delete_access_point: string;
|
|
7
|
+
delete_modal_title: string;
|
|
8
|
+
delete_modal_description_one: string;
|
|
9
|
+
delete_modal_description_other: string;
|
|
10
|
+
delete_modal_delete_option: string;
|
|
11
|
+
delete_modal_cancel_option: string;
|
|
12
|
+
edit_access_point: string;
|
|
13
|
+
edit_modal_title: string;
|
|
14
|
+
edit_modal_edit_option: string;
|
|
15
|
+
edit_modal_cancel_option: string;
|
|
16
|
+
filter_access_point: string;
|
|
17
|
+
no_records_found_message: string;
|
|
18
|
+
select_columns_all_option: string;
|
|
19
|
+
select_columns_date_option: string;
|
|
20
|
+
select_columns_time_option: string;
|
|
3
21
|
select_columns: string;
|
|
22
|
+
sort_access_point: string;
|
|
4
23
|
}
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.I18N_TABULAR_VIEW = void 0;
|
|
4
4
|
exports.I18N_TABULAR_VIEW = {
|
|
5
|
-
|
|
5
|
+
add_access_point: "Add",
|
|
6
|
+
add_modal_title: "Add Record",
|
|
7
|
+
add_modal_add_option: "Add",
|
|
8
|
+
add_modal_cancel_option: "Cancel",
|
|
9
|
+
delete_access_point: "Delete",
|
|
10
|
+
delete_modal_title: "Delete Record",
|
|
11
|
+
delete_modal_description_one: "I confirm I want to delete {{number_records}} record",
|
|
12
|
+
delete_modal_description_other: "I confirm I want to delete {{number_records}} records",
|
|
13
|
+
delete_modal_delete_option: "Delete",
|
|
14
|
+
delete_modal_cancel_option: "Cancel",
|
|
15
|
+
edit_access_point: "Edit",
|
|
16
|
+
edit_modal_title: "Edit Record",
|
|
17
|
+
edit_modal_edit_option: "Update",
|
|
18
|
+
edit_modal_cancel_option: "Cancel",
|
|
19
|
+
filter_access_point: "Filter",
|
|
20
|
+
no_records_found_message: "No Records Found",
|
|
21
|
+
select_columns_all_option: "All",
|
|
22
|
+
select_columns_date_option: "Date",
|
|
23
|
+
select_columns_time_option: "Time",
|
|
6
24
|
select_columns: "Select Columns",
|
|
25
|
+
sort_access_point: "Sort",
|
|
7
26
|
};
|
|
@@ -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);
|