@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
|
@@ -33,7 +33,8 @@ exports.transformValue = transformValue;
|
|
|
33
33
|
* @returns the outputformat settings
|
|
34
34
|
*/
|
|
35
35
|
function getOutputFormat(settings) {
|
|
36
|
-
|
|
36
|
+
var _a, _b;
|
|
37
|
+
let type, format, decimals;
|
|
37
38
|
const isDateTime = [
|
|
38
39
|
DATE_GROUPING_TIME_PROPERTY_1.DATE_GROUPING_TIME_PROPERTY.HOUR,
|
|
39
40
|
DATE_GROUPING_TIME_PROPERTY_1.DATE_GROUPING_TIME_PROPERTY.MINUTE,
|
|
@@ -51,19 +52,22 @@ function getOutputFormat(settings) {
|
|
|
51
52
|
}
|
|
52
53
|
else if ((0, isNumericalColumn_1.isNumericalColumn)(settings.column)) {
|
|
53
54
|
type = "NUMERIC";
|
|
55
|
+
format = "Default";
|
|
56
|
+
decimals = (_b = (_a = settings === null || settings === void 0 ? void 0 : settings.column) === null || _a === void 0 ? void 0 : _a.outputFormat) === null || _b === void 0 ? void 0 : _b.decimals;
|
|
54
57
|
}
|
|
55
58
|
return {
|
|
56
59
|
type,
|
|
57
60
|
format,
|
|
61
|
+
decimals,
|
|
58
62
|
originalFormat: isDateTime ? settings.column.outputFormat : undefined,
|
|
59
63
|
};
|
|
60
64
|
}
|
|
61
65
|
/**
|
|
62
|
-
* Gets the format config
|
|
66
|
+
* Gets the format config if the locale exists in i18n settings
|
|
63
67
|
* @param settings The settings of the transformValue function
|
|
64
68
|
* @returns the format config
|
|
65
69
|
*/
|
|
66
70
|
function getFormatConfig(settings) {
|
|
67
|
-
var _a;
|
|
68
|
-
return { lang: (
|
|
71
|
+
var _a, _b;
|
|
72
|
+
return ((_a = settings.i18n) === null || _a === void 0 ? void 0 : _a.locale) && { lang: (_b = settings.i18n) === null || _b === void 0 ? void 0 : _b.locale };
|
|
69
73
|
}
|
|
@@ -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/
|
|
6
|
-
version:
|
|
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/
|
|
6
|
-
version:
|
|
5
|
+
uri: "/app/:app_id/qrvey/:qrvey_id/analytics/results/groups",
|
|
6
|
+
version: 5,
|
|
7
7
|
};
|
|
@@ -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",
|
|
@@ -27,6 +27,7 @@ export var CHART_TYPE;
|
|
|
27
27
|
CHART_TYPE["BULLET_METRIC"] = "BULLET";
|
|
28
28
|
CHART_TYPE["SUMMARY_CHART"] = "SUMMARY_CHART";
|
|
29
29
|
CHART_TYPE["MINMAX_CHART"] = "MINMAX_CHART";
|
|
30
|
+
CHART_TYPE["COMBINED_CHART"] = "COMBINED_CHART";
|
|
30
31
|
})(CHART_TYPE || (CHART_TYPE = {}));
|
|
31
32
|
export var CHART_DIMENSION;
|
|
32
33
|
(function (CHART_DIMENSION) {
|
|
@@ -36,7 +36,6 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
36
36
|
scope.datasets.forEach((dataset) => {
|
|
37
37
|
if (dataset.filters.length > 0) {
|
|
38
38
|
dataset.filters.forEach((filter) => {
|
|
39
|
-
var _a, _b, _c, _d;
|
|
40
39
|
const datasetInfo = datasetsInfo.find((dInfo) => dInfo.qrveyid === dataset.qrveyid);
|
|
41
40
|
let columnInfo;
|
|
42
41
|
if (!isEmpty(datasetInfo))
|
|
@@ -62,11 +61,8 @@ function FD21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
62
61
|
type: (columnInfo === null || columnInfo === void 0 ? void 0 : columnInfo.type) || filter.column.type,
|
|
63
62
|
},
|
|
64
63
|
dateSection: filter.dateSection,
|
|
65
|
-
|
|
66
|
-
displayed: (_b = filter.displayed) !== null && _b !== void 0 ? _b : true,
|
|
67
|
-
editable: (_c = filter.editable) !== null && _c !== void 0 ? _c : true,
|
|
64
|
+
displayed: filter.displayed,
|
|
68
65
|
enabled: filter.enabled,
|
|
69
|
-
enableable: (_d = filter.enableable) !== null && _d !== void 0 ? _d : true,
|
|
70
66
|
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: {
|
|
71
67
|
collapsed: scope.collapsed,
|
|
72
68
|
enabled: scope.enabled,
|
|
@@ -34,7 +34,6 @@ function UI21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
34
34
|
scope.datasets.forEach((dataset) => {
|
|
35
35
|
if (dataset.filters.length > 0) {
|
|
36
36
|
dataset.filters.forEach((filter) => {
|
|
37
|
-
var _a, _b, _c;
|
|
38
37
|
const datasetInfo = datasetsInfo.find((dInfo) => dInfo.qrveyid === dataset.qrveyid);
|
|
39
38
|
let columnInfo;
|
|
40
39
|
if (!isEmpty(datasetInfo))
|
|
@@ -60,10 +59,7 @@ function UI21ToFlatUI(scopes = [], datasetsInfo = []) {
|
|
|
60
59
|
type: filter.column.type,
|
|
61
60
|
},
|
|
62
61
|
dateSection: filter.dateSection,
|
|
63
|
-
deletable: (_a = filter.deletable) !== null && _a !== void 0 ? _a : true,
|
|
64
62
|
displayed: filter.displayed,
|
|
65
|
-
editable: (_b = filter.editable) !== null && _b !== void 0 ? _b : true,
|
|
66
|
-
enableable: (_c = filter.enableable) !== null && _c !== void 0 ? _c : true,
|
|
67
63
|
enabled: filter.enabled,
|
|
68
64
|
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: {
|
|
69
65
|
collapsed: scope.collapsed,
|
|
@@ -81,7 +81,6 @@ function buildDataset(uFilter) {
|
|
|
81
81
|
* @returns an filter structure
|
|
82
82
|
*/
|
|
83
83
|
function buildFilter(uFilter) {
|
|
84
|
-
var _a, _b, _c;
|
|
85
84
|
const _uFilter = cloneDeep(uFilter);
|
|
86
85
|
const info = !isEmpty(_uFilter.extras.info)
|
|
87
86
|
? { icon: _uFilter.extras.info.icon, label: _uFilter.extras.info.label }
|
|
@@ -100,10 +99,7 @@ function buildFilter(uFilter) {
|
|
|
100
99
|
type: _uFilter.column.type,
|
|
101
100
|
},
|
|
102
101
|
dateSection: _uFilter.dateSection,
|
|
103
|
-
deletable: (_a = _uFilter.deletable) !== null && _a !== void 0 ? _a : true,
|
|
104
102
|
displayed: _uFilter.displayed,
|
|
105
|
-
editable: (_b = _uFilter.editable) !== null && _b !== void 0 ? _b : true,
|
|
106
|
-
enableable: (_c = _uFilter.enableable) !== null && _c !== void 0 ? _c : true,
|
|
107
103
|
filterid: _uFilter.filterid,
|
|
108
104
|
enabled: _uFilter.enabled,
|
|
109
105
|
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 }),
|
|
@@ -91,7 +91,6 @@ function buildDataset(uFilter) {
|
|
|
91
91
|
* @returns an filter structure
|
|
92
92
|
*/
|
|
93
93
|
function buildFilter(uFilter) {
|
|
94
|
-
var _a, _b, _c;
|
|
95
94
|
const _uFilter = cloneDeep(uFilter);
|
|
96
95
|
const info = !isEmpty(_uFilter.extras.info)
|
|
97
96
|
? { icon: _uFilter.extras.info.icon, label: _uFilter.extras.info.label }
|
|
@@ -115,10 +114,7 @@ function buildFilter(uFilter) {
|
|
|
115
114
|
type: _uFilter.column.type,
|
|
116
115
|
},
|
|
117
116
|
dateSection: _uFilter.dateSection,
|
|
118
|
-
deletable: (_a = _uFilter.deletable) !== null && _a !== void 0 ? _a : true,
|
|
119
117
|
displayed: _uFilter.displayed,
|
|
120
|
-
editable: (_b = _uFilter.editable) !== null && _b !== void 0 ? _b : true,
|
|
121
|
-
enableable: (_c = _uFilter.enableable) !== null && _c !== void 0 ? _c : true,
|
|
122
118
|
filterid: _uFilter.filterid,
|
|
123
119
|
enabled: _uFilter.enabled,
|
|
124
120
|
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 }),
|
|
@@ -61,7 +61,7 @@ function buildFilterByExpression(expression, scopeItem, uFilters) {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
function getFilterByExpression(expression, scopeItem) {
|
|
64
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o
|
|
64
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
65
65
|
const uiExtras = expression.uiExtras;
|
|
66
66
|
const scopeid = scopeItem.scope !== FILTER_SCOPE.GLOBAL
|
|
67
67
|
? _get(scopeItem, "uiExtras.scopeid")
|
|
@@ -87,14 +87,11 @@ function getFilterByExpression(expression, scopeItem) {
|
|
|
87
87
|
type: (_l = uiExtras.column) === null || _l === void 0 ? void 0 : _l.type,
|
|
88
88
|
},
|
|
89
89
|
dateSection: uiExtras.dateSection,
|
|
90
|
-
|
|
91
|
-
displayed: (_q = (_p = uiExtras._newFilters) === null || _p === void 0 ? void 0 : _p.displayed) !== null && _q !== void 0 ? _q : true,
|
|
92
|
-
editable: (_s = (_r = uiExtras._newFilters) === null || _r === void 0 ? void 0 : _r.editable) !== null && _s !== void 0 ? _s : true,
|
|
93
|
-
enableable: (_u = (_t = uiExtras._newFilters) === null || _t === void 0 ? void 0 : _t.enableable) !== null && _u !== void 0 ? _u : true,
|
|
90
|
+
displayed: true,
|
|
94
91
|
enabled: uiExtras.enabled,
|
|
95
92
|
extras: Object.assign(Object.assign({}, uiExtras.extras), { panelid: uiExtras.panelid, filterLabel: uiExtras.panelName, info,
|
|
96
93
|
scopeid, scope: scopeItem.scope, section: uiExtras.section, scopeInfo: {
|
|
97
|
-
collapsed: (
|
|
94
|
+
collapsed: (_m = scopeItem.uiExtras) === null || _m === void 0 ? void 0 : _m.collapsed,
|
|
98
95
|
enabled: scopeItem.enabled,
|
|
99
96
|
displayed: true,
|
|
100
97
|
scope: scopeItem.scope,
|
|
@@ -103,7 +100,7 @@ function getFilterByExpression(expression, scopeItem) {
|
|
|
103
100
|
collapsed: false,
|
|
104
101
|
enabled: true,
|
|
105
102
|
displayed: true,
|
|
106
|
-
qrveyid: (
|
|
103
|
+
qrveyid: (_o = uiExtras.column) === null || _o === void 0 ? void 0 : _o.qrveyid,
|
|
107
104
|
label: _get(uiExtras.column, "dataset.name") ||
|
|
108
105
|
_get(uiExtras.column, "label"),
|
|
109
106
|
} }),
|
|
@@ -9,7 +9,6 @@ export const FILTER_SETTINGS_DEFAULT = {
|
|
|
9
9
|
filterBuilder: {
|
|
10
10
|
scopeSelectorDisplayed: true,
|
|
11
11
|
scopeSelectorEnabled: true,
|
|
12
|
-
strictlyInteractivity: false,
|
|
13
12
|
},
|
|
14
13
|
filterDisplayer: {
|
|
15
14
|
addFilterDisplayed: true,
|
|
@@ -72,7 +71,6 @@ export const FILTER_SETTINGS_DEFAULT = {
|
|
|
72
71
|
},
|
|
73
72
|
iconsDisplayed: true,
|
|
74
73
|
readonly: false,
|
|
75
|
-
strictlyInteractivity: false,
|
|
76
74
|
updateFilterInfo: true,
|
|
77
75
|
},
|
|
78
76
|
filterPanelSettings: {
|
|
@@ -13,7 +13,6 @@ export function buildExpression(filter) {
|
|
|
13
13
|
const expression = {
|
|
14
14
|
groupValue: getBackendGroupValue(filter),
|
|
15
15
|
questionid: filter.column.id,
|
|
16
|
-
questionType: filter.column.type,
|
|
17
16
|
property: getBackendProperty(filter),
|
|
18
17
|
validationType: getBackendValidator(filter),
|
|
19
18
|
value: getBackendValues(filter),
|
|
@@ -14,11 +14,6 @@ export function resolveDatasetConditions(dataset, params, letPassUndefinedProper
|
|
|
14
14
|
(letPassUndefinedProperties && dataset.enabled == null) ||
|
|
15
15
|
(letPassUndefinedParams && params.enableds.datasets == null) ||
|
|
16
16
|
params.enableds.datasets === dataset.enabled) &&
|
|
17
|
-
(!_hasProperty(params, "displayeds") ||
|
|
18
|
-
!_hasProperty(params.displayeds, "datasets") ||
|
|
19
|
-
(letPassUndefinedProperties && dataset.displayed == null) ||
|
|
20
|
-
(letPassUndefinedParams && params.displayeds.datasets == null) ||
|
|
21
|
-
params.displayeds.datasets === dataset.displayed) &&
|
|
22
17
|
(!_hasProperty(params, "qrveyid") ||
|
|
23
18
|
(letPassUndefinedProperties && dataset.qrveyid == null) ||
|
|
24
19
|
(letPassUndefinedParams && isEmpty(params.qrveyid)) ||
|
|
@@ -15,11 +15,6 @@ export function resolveFilterConditions(filter, params, letPassUndefinedProperti
|
|
|
15
15
|
(letPassUndefinedProperties && filter.enabled == null) ||
|
|
16
16
|
(letPassUndefinedParams && params.enableds.filters == null) ||
|
|
17
17
|
params.enableds.filters === filter.enabled) &&
|
|
18
|
-
(!_hasProperty(params, "displayeds") ||
|
|
19
|
-
!_hasProperty(params.displayeds, "filters") ||
|
|
20
|
-
(letPassUndefinedProperties && filter.displayed == null) ||
|
|
21
|
-
(letPassUndefinedParams && params.displayeds.filters == null) ||
|
|
22
|
-
params.displayeds.filters === filter.displayed) &&
|
|
23
18
|
(!_hasProperty(params, "dateSection") ||
|
|
24
19
|
(letPassUndefinedProperties && filter.dateSection == null) ||
|
|
25
20
|
(letPassUndefinedParams && isEmpty(params.dateSection)) ||
|
|
@@ -14,11 +14,6 @@ export function resolveScopeConditions(scope, params, letPassUndefinedProperties
|
|
|
14
14
|
(letPassUndefinedProperties && scope.enabled == null) ||
|
|
15
15
|
(letPassUndefinedParams && params.enableds.scopes == null) ||
|
|
16
16
|
params.enableds.scopes === scope.enabled) &&
|
|
17
|
-
(!_hasProperty(params, "displayeds") ||
|
|
18
|
-
!_hasProperty(params.displayeds, "scopes") ||
|
|
19
|
-
(letPassUndefinedProperties && scope.displayed == null) ||
|
|
20
|
-
(letPassUndefinedParams && params.displayeds.scopes == null) ||
|
|
21
|
-
params.displayeds.scopes === scope.displayed) &&
|
|
22
17
|
(!_hasProperty(params, "scope") ||
|
|
23
18
|
(letPassUndefinedProperties && scope.scope == null) ||
|
|
24
19
|
(letPassUndefinedParams && isEmpty(params.scope)) ||
|
|
@@ -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)
|
|
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")})`;
|
|
@@ -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";
|
|
@@ -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";
|
|
@@ -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
|
|
@@ -41,20 +41,21 @@ export default class UChartApi {
|
|
|
41
41
|
const data = { data: [] };
|
|
42
42
|
if (isRangeValidator(uFilter.validator)) {
|
|
43
43
|
data.data = isEmpty(uFilter.column.aggregate)
|
|
44
|
-
? _get(response, "[0].summary", [])
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
? _get(response, "[0].summary", [])
|
|
45
|
+
.map((summary) => {
|
|
46
|
+
if (!isEmpty(summary))
|
|
47
|
+
return { value: summary };
|
|
48
|
+
})
|
|
49
|
+
.filter(Boolean)
|
|
47
50
|
: [
|
|
48
|
-
{ value: _get(response, "[0].min") },
|
|
49
|
-
{ value: _get(response, "[0].max") },
|
|
51
|
+
{ value: _get(response, "[0].extras.summary.min") },
|
|
52
|
+
{ value: _get(response, "[0].extras.summary.max") },
|
|
50
53
|
];
|
|
51
54
|
}
|
|
52
55
|
else if (!UChartApi.isResultEmpty(response)) {
|
|
53
56
|
const records = _get(response, "data");
|
|
54
57
|
data.data = isEmpty(uFilter.column.aggregate)
|
|
55
|
-
?
|
|
56
|
-
value: record.key.toString(),
|
|
57
|
-
}))
|
|
58
|
+
? UChartApi._getResponse(records)
|
|
58
59
|
: this._getResponseSummaries(records);
|
|
59
60
|
}
|
|
60
61
|
return data;
|
|
@@ -117,6 +118,19 @@ export default class UChartApi {
|
|
|
117
118
|
}
|
|
118
119
|
return filterCharts;
|
|
119
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Tranform response in array of object with value key
|
|
123
|
+
* Null or undefined values are avoided
|
|
124
|
+
* @param records The data from preview response
|
|
125
|
+
* @returns the sumaries
|
|
126
|
+
*/
|
|
127
|
+
static _getResponse(records) {
|
|
128
|
+
return records.reduce((store, record) => {
|
|
129
|
+
const value = record.key;
|
|
130
|
+
!isEmpty(value) && store.push({ value: String(value) });
|
|
131
|
+
return store;
|
|
132
|
+
}, []);
|
|
133
|
+
}
|
|
120
134
|
}
|
|
121
135
|
/**
|
|
122
136
|
* Gets request body structure
|
|
@@ -138,7 +152,6 @@ UChartApi._getPreviewRequestBody = (uFilter, filterLogic = [], chartSettings) =>
|
|
|
138
152
|
return {
|
|
139
153
|
charts: chartsBody,
|
|
140
154
|
logic: filters,
|
|
141
|
-
qrveyid: uFilter.column.qrveyid,
|
|
142
155
|
};
|
|
143
156
|
};
|
|
144
157
|
/**
|
|
@@ -165,11 +178,8 @@ UChartApi._getDimensionsBody = (uFilter, chartSettings) => {
|
|
|
165
178
|
dimensions = [
|
|
166
179
|
{
|
|
167
180
|
questionid: column.id,
|
|
168
|
-
qrveyid: column.qrveyid,
|
|
169
181
|
maxDataPoints: UChartApi._getMaxDataPoints(column, chartSettings),
|
|
170
|
-
|
|
171
|
-
formulaType: column.type === "FORMULA" ? column.formulaType : undefined,
|
|
172
|
-
sortOption: UChartApi._getSortOption(column),
|
|
182
|
+
sort: UChartApi._getSortOption(column),
|
|
173
183
|
},
|
|
174
184
|
];
|
|
175
185
|
dimensions = UChartApi._refineBodies([...dimensions], uFilter);
|
|
@@ -201,7 +211,7 @@ UChartApi._getSortOption = (column) => {
|
|
|
201
211
|
if (sortDirection == null)
|
|
202
212
|
sortDirection = "DESC";
|
|
203
213
|
}
|
|
204
|
-
return { sortBy, sortDirection };
|
|
214
|
+
return { by: sortBy, direction: sortDirection };
|
|
205
215
|
};
|
|
206
216
|
/**
|
|
207
217
|
* Gets summaries body structure
|
|
@@ -216,7 +226,6 @@ UChartApi._getSummariesBody = (uFilter) => {
|
|
|
216
226
|
property: !isDateColumn(uFilter.column) && uFilter.column.type !== COLUMN.TIME
|
|
217
227
|
? uFilter.property
|
|
218
228
|
: undefined,
|
|
219
|
-
type: column.type,
|
|
220
229
|
};
|
|
221
230
|
let summaries = [summary];
|
|
222
231
|
if (isNumericalColumn(column) || isRangeValidator(validator)) {
|
|
@@ -239,7 +248,6 @@ UChartApi._refineBodies = (bodies, uFilter) => {
|
|
|
239
248
|
_bodies.forEach((body) => {
|
|
240
249
|
if (isDateColumn(uFilter.column) ||
|
|
241
250
|
uFilter.column.type === COLUMN.TIME) {
|
|
242
|
-
body.groupType = "DATE";
|
|
243
251
|
body.groupValue = uFilter.property.toUpperCase();
|
|
244
252
|
}
|
|
245
253
|
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
|
|
@@ -51,9 +51,7 @@ export default class UChartPaginationApi {
|
|
|
51
51
|
if (!UChartPaginationApi.isResultPaginationEmpty(response)) {
|
|
52
52
|
const records = _get(response, "data");
|
|
53
53
|
data.data = isEmpty(uFilter.column.aggregate)
|
|
54
|
-
?
|
|
55
|
-
value: record.key.toString(),
|
|
56
|
-
}))
|
|
54
|
+
? UChartPaginationApi._getResponse(records)
|
|
57
55
|
: UChartPaginationApi._getResponseSummaries(records);
|
|
58
56
|
data.data = getUniqueArray(data.data, "value");
|
|
59
57
|
data.total = (_a = _get(response, "totalGroups", 0)) !== null && _a !== void 0 ? _a : 0;
|
|
@@ -129,6 +127,19 @@ export default class UChartPaginationApi {
|
|
|
129
127
|
}
|
|
130
128
|
return filterCharts;
|
|
131
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Tranform response in array of object with value key
|
|
132
|
+
* Null or undefined values are avoided
|
|
133
|
+
* @param records The data from preview response
|
|
134
|
+
* @returns the sumaries
|
|
135
|
+
*/
|
|
136
|
+
static _getResponse(records) {
|
|
137
|
+
return records.reduce((store, record) => {
|
|
138
|
+
const value = record.key;
|
|
139
|
+
!isEmpty(value) && store.push({ value: String(value) });
|
|
140
|
+
return store;
|
|
141
|
+
}, []);
|
|
142
|
+
}
|
|
132
143
|
}
|
|
133
144
|
/**
|
|
134
145
|
* Gets request body structure
|
|
@@ -165,8 +176,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
165
176
|
dimensions = [
|
|
166
177
|
{
|
|
167
178
|
questionid: column.id,
|
|
168
|
-
type: column.type,
|
|
169
|
-
formulaType: column.type === COLUMN.FORMULA ? column.formulaType : undefined,
|
|
170
179
|
sort: UChartPaginationApi._getSortOption(column),
|
|
171
180
|
},
|
|
172
181
|
];
|
|
@@ -181,9 +190,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
181
190
|
*/
|
|
182
191
|
UChartPaginationApi._getDimensionsBodyAdapter = (dimensions = []) => dimensions.map((dimension) => ({
|
|
183
192
|
questionid: dimension.questionid,
|
|
184
|
-
type: dimension.type,
|
|
185
|
-
formulaType: dimension.type === COLUMN.FORMULA ? dimension.formulaType : undefined,
|
|
186
|
-
groupType: dimension.groupType,
|
|
187
193
|
groupValue: dimension.groupValue,
|
|
188
194
|
sort: {
|
|
189
195
|
by: _get(dimension, "sortOption.sortBy", "VALUE"),
|
|
@@ -230,7 +236,6 @@ UChartPaginationApi._getSummariesBody = (uFilter) => {
|
|
|
230
236
|
property: !isDateColumn(uFilter.column) && uFilter.column.type !== COLUMN.TIME
|
|
231
237
|
? uFilter.property
|
|
232
238
|
: undefined,
|
|
233
|
-
type: column.type,
|
|
234
239
|
};
|
|
235
240
|
let summaries = [summary];
|
|
236
241
|
if (isNumericalColumn(column) || isRangeValidator(validator)) {
|
|
@@ -253,7 +258,6 @@ UChartPaginationApi._refineBodies = (bodies, uFilter) => {
|
|
|
253
258
|
_bodies.forEach((body) => {
|
|
254
259
|
if (isDateColumn(uFilter.column) ||
|
|
255
260
|
uFilter.column.type === COLUMN.TIME) {
|
|
256
|
-
body.groupType = "DATE";
|
|
257
261
|
body.groupValue = uFilter.property.toUpperCase();
|
|
258
262
|
}
|
|
259
263
|
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
|
}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
export const I18N_TABULAR_VIEW = {
|
|
2
|
-
|
|
2
|
+
add_access_point: "Add",
|
|
3
|
+
add_modal_title: "Add Record",
|
|
4
|
+
add_modal_add_option: "Add",
|
|
5
|
+
add_modal_cancel_option: "Cancel",
|
|
6
|
+
delete_access_point: "Delete",
|
|
7
|
+
delete_modal_title: "Delete Record",
|
|
8
|
+
delete_modal_description_one: "I confirm I want to delete {{number_records}} record",
|
|
9
|
+
delete_modal_description_other: "I confirm I want to delete {{number_records}} records",
|
|
10
|
+
delete_modal_delete_option: "Delete",
|
|
11
|
+
delete_modal_cancel_option: "Cancel",
|
|
12
|
+
edit_access_point: "Edit",
|
|
13
|
+
edit_modal_title: "Edit Record",
|
|
14
|
+
edit_modal_edit_option: "Update",
|
|
15
|
+
edit_modal_cancel_option: "Cancel",
|
|
16
|
+
filter_access_point: "Filter",
|
|
17
|
+
no_records_found_message: "No Records Found",
|
|
18
|
+
select_columns_all_option: "All",
|
|
19
|
+
select_columns_date_option: "Date",
|
|
20
|
+
select_columns_time_option: "Time",
|
|
3
21
|
select_columns: "Select Columns",
|
|
22
|
+
sort_access_point: "Sort",
|
|
4
23
|
};
|