@qrvey/utils 1.9.0-5 → 1.9.0-6
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/filters/helpers/backend/buildExpression.js +0 -1
- package/dist/cjs/filters/services/UChartApi.d.ts +0 -1
- package/dist/cjs/filters/services/UChartApi.js +0 -18
- package/dist/cjs/filters/services/UChartPaginationApi.js +0 -7
- package/dist/filters/helpers/backend/buildExpression.js +0 -1
- package/dist/filters/services/UChartApi.d.ts +0 -1
- package/dist/filters/services/UChartApi.js +0 -18
- package/dist/filters/services/UChartPaginationApi.js +0 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -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),
|
|
@@ -27,8 +27,6 @@ class UChartApi {
|
|
|
27
27
|
* @returns a promise with a resulting data
|
|
28
28
|
*/
|
|
29
29
|
this.getChartResult = (config, uFilter, filterLogic = [], chartSettings, _resetApi = false) => {
|
|
30
|
-
if (chartSettings)
|
|
31
|
-
UChartApi.parseSortOptionForMinimalProperties(chartSettings);
|
|
32
30
|
const requestBody = UChartApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings);
|
|
33
31
|
const customChartApi = new Charts_api_1.default(Object.assign(Object.assign({}, config), { qrvey_id: (0, isEmpty_1.isEmpty)(uFilter.column.aggregate)
|
|
34
32
|
? uFilter.column.qrveyid
|
|
@@ -146,7 +144,6 @@ UChartApi._getPreviewRequestBody = (uFilter, filterLogic = [], chartSettings) =>
|
|
|
146
144
|
return {
|
|
147
145
|
charts: chartsBody,
|
|
148
146
|
logic: filters,
|
|
149
|
-
qrveyid: uFilter.column.qrveyid,
|
|
150
147
|
};
|
|
151
148
|
};
|
|
152
149
|
/**
|
|
@@ -173,10 +170,7 @@ UChartApi._getDimensionsBody = (uFilter, chartSettings) => {
|
|
|
173
170
|
dimensions = [
|
|
174
171
|
{
|
|
175
172
|
questionid: column.id,
|
|
176
|
-
qrveyid: column.qrveyid,
|
|
177
173
|
maxDataPoints: UChartApi._getMaxDataPoints(column, chartSettings),
|
|
178
|
-
type: column.type,
|
|
179
|
-
formulaType: column.type === "FORMULA" ? column.formulaType : undefined,
|
|
180
174
|
sort: UChartApi._getSortOption(column),
|
|
181
175
|
},
|
|
182
176
|
];
|
|
@@ -224,7 +218,6 @@ UChartApi._getSummariesBody = (uFilter) => {
|
|
|
224
218
|
property: !(0, isDateColumn_1.isDateColumn)(uFilter.column) && uFilter.column.type !== COLUMN_1.COLUMN.TIME
|
|
225
219
|
? uFilter.property
|
|
226
220
|
: undefined,
|
|
227
|
-
type: column.type,
|
|
228
221
|
};
|
|
229
222
|
let summaries = [summary];
|
|
230
223
|
if ((0, isNumericalColumn_1.isNumericalColumn)(column) || (0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
@@ -247,7 +240,6 @@ UChartApi._refineBodies = (bodies, uFilter) => {
|
|
|
247
240
|
_bodies.forEach((body) => {
|
|
248
241
|
if ((0, isDateColumn_1.isDateColumn)(uFilter.column) ||
|
|
249
242
|
uFilter.column.type === COLUMN_1.COLUMN.TIME) {
|
|
250
|
-
body.groupType = "DATE";
|
|
251
243
|
body.groupValue = uFilter.property.toUpperCase();
|
|
252
244
|
}
|
|
253
245
|
else {
|
|
@@ -294,13 +286,3 @@ UChartApi.isResultEmpty = (resultObject, validateNesteddata = false) => {
|
|
|
294
286
|
}
|
|
295
287
|
return validation;
|
|
296
288
|
};
|
|
297
|
-
UChartApi.parseSortOptionForMinimalProperties = (chartSettings) => {
|
|
298
|
-
var _a;
|
|
299
|
-
(_a = chartSettings === null || chartSettings === void 0 ? void 0 : chartSettings.chart) === null || _a === void 0 ? void 0 : _a.forEach((chartConfig) => {
|
|
300
|
-
chartConfig.dimensions = chartConfig.dimensions.map((dim) => (Object.assign(Object.assign({}, dim), { sortOption: undefined, sort: {
|
|
301
|
-
by: dim.sortOption.sortBy,
|
|
302
|
-
direction: dim.sortOption.sortDirection,
|
|
303
|
-
order: dim.sortOption.order,
|
|
304
|
-
} })));
|
|
305
|
-
});
|
|
306
|
-
};
|
|
@@ -171,8 +171,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
171
171
|
dimensions = [
|
|
172
172
|
{
|
|
173
173
|
questionid: column.id,
|
|
174
|
-
type: column.type,
|
|
175
|
-
formulaType: column.type === COLUMN_1.COLUMN.FORMULA ? column.formulaType : undefined,
|
|
176
174
|
sort: UChartPaginationApi._getSortOption(column),
|
|
177
175
|
},
|
|
178
176
|
];
|
|
@@ -187,9 +185,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
187
185
|
*/
|
|
188
186
|
UChartPaginationApi._getDimensionsBodyAdapter = (dimensions = []) => dimensions.map((dimension) => ({
|
|
189
187
|
questionid: dimension.questionid,
|
|
190
|
-
type: dimension.type,
|
|
191
|
-
formulaType: dimension.type === COLUMN_1.COLUMN.FORMULA ? dimension.formulaType : undefined,
|
|
192
|
-
groupType: dimension.groupType,
|
|
193
188
|
groupValue: dimension.groupValue,
|
|
194
189
|
sort: {
|
|
195
190
|
by: (0, get_1._get)(dimension, "sortOption.sortBy", "VALUE"),
|
|
@@ -236,7 +231,6 @@ UChartPaginationApi._getSummariesBody = (uFilter) => {
|
|
|
236
231
|
property: !(0, isDateColumn_1.isDateColumn)(uFilter.column) && uFilter.column.type !== COLUMN_1.COLUMN.TIME
|
|
237
232
|
? uFilter.property
|
|
238
233
|
: undefined,
|
|
239
|
-
type: column.type,
|
|
240
234
|
};
|
|
241
235
|
let summaries = [summary];
|
|
242
236
|
if ((0, isNumericalColumn_1.isNumericalColumn)(column) || (0, isRangeValidator_1.isRangeValidator)(validator)) {
|
|
@@ -259,7 +253,6 @@ UChartPaginationApi._refineBodies = (bodies, uFilter) => {
|
|
|
259
253
|
_bodies.forEach((body) => {
|
|
260
254
|
if ((0, isDateColumn_1.isDateColumn)(uFilter.column) ||
|
|
261
255
|
uFilter.column.type === COLUMN_1.COLUMN.TIME) {
|
|
262
|
-
body.groupType = "DATE";
|
|
263
256
|
body.groupValue = uFilter.property.toUpperCase();
|
|
264
257
|
}
|
|
265
258
|
else {
|
|
@@ -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),
|
|
@@ -22,8 +22,6 @@ export default class UChartApi {
|
|
|
22
22
|
* @returns a promise with a resulting data
|
|
23
23
|
*/
|
|
24
24
|
this.getChartResult = (config, uFilter, filterLogic = [], chartSettings, _resetApi = false) => {
|
|
25
|
-
if (chartSettings)
|
|
26
|
-
UChartApi.parseSortOptionForMinimalProperties(chartSettings);
|
|
27
25
|
const requestBody = UChartApi._getPreviewRequestBody(uFilter, filterLogic, chartSettings);
|
|
28
26
|
const customChartApi = new ChartsApi(Object.assign(Object.assign({}, config), { qrvey_id: isEmpty(uFilter.column.aggregate)
|
|
29
27
|
? uFilter.column.qrveyid
|
|
@@ -140,7 +138,6 @@ UChartApi._getPreviewRequestBody = (uFilter, filterLogic = [], chartSettings) =>
|
|
|
140
138
|
return {
|
|
141
139
|
charts: chartsBody,
|
|
142
140
|
logic: filters,
|
|
143
|
-
qrveyid: uFilter.column.qrveyid,
|
|
144
141
|
};
|
|
145
142
|
};
|
|
146
143
|
/**
|
|
@@ -167,10 +164,7 @@ UChartApi._getDimensionsBody = (uFilter, chartSettings) => {
|
|
|
167
164
|
dimensions = [
|
|
168
165
|
{
|
|
169
166
|
questionid: column.id,
|
|
170
|
-
qrveyid: column.qrveyid,
|
|
171
167
|
maxDataPoints: UChartApi._getMaxDataPoints(column, chartSettings),
|
|
172
|
-
type: column.type,
|
|
173
|
-
formulaType: column.type === "FORMULA" ? column.formulaType : undefined,
|
|
174
168
|
sort: UChartApi._getSortOption(column),
|
|
175
169
|
},
|
|
176
170
|
];
|
|
@@ -218,7 +212,6 @@ UChartApi._getSummariesBody = (uFilter) => {
|
|
|
218
212
|
property: !isDateColumn(uFilter.column) && uFilter.column.type !== COLUMN.TIME
|
|
219
213
|
? uFilter.property
|
|
220
214
|
: undefined,
|
|
221
|
-
type: column.type,
|
|
222
215
|
};
|
|
223
216
|
let summaries = [summary];
|
|
224
217
|
if (isNumericalColumn(column) || isRangeValidator(validator)) {
|
|
@@ -241,7 +234,6 @@ UChartApi._refineBodies = (bodies, uFilter) => {
|
|
|
241
234
|
_bodies.forEach((body) => {
|
|
242
235
|
if (isDateColumn(uFilter.column) ||
|
|
243
236
|
uFilter.column.type === COLUMN.TIME) {
|
|
244
|
-
body.groupType = "DATE";
|
|
245
237
|
body.groupValue = uFilter.property.toUpperCase();
|
|
246
238
|
}
|
|
247
239
|
else {
|
|
@@ -288,13 +280,3 @@ UChartApi.isResultEmpty = (resultObject, validateNesteddata = false) => {
|
|
|
288
280
|
}
|
|
289
281
|
return validation;
|
|
290
282
|
};
|
|
291
|
-
UChartApi.parseSortOptionForMinimalProperties = (chartSettings) => {
|
|
292
|
-
var _a;
|
|
293
|
-
(_a = chartSettings === null || chartSettings === void 0 ? void 0 : chartSettings.chart) === null || _a === void 0 ? void 0 : _a.forEach((chartConfig) => {
|
|
294
|
-
chartConfig.dimensions = chartConfig.dimensions.map((dim) => (Object.assign(Object.assign({}, dim), { sortOption: undefined, sort: {
|
|
295
|
-
by: dim.sortOption.sortBy,
|
|
296
|
-
direction: dim.sortOption.sortDirection,
|
|
297
|
-
order: dim.sortOption.order,
|
|
298
|
-
} })));
|
|
299
|
-
});
|
|
300
|
-
};
|
|
@@ -165,8 +165,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
165
165
|
dimensions = [
|
|
166
166
|
{
|
|
167
167
|
questionid: column.id,
|
|
168
|
-
type: column.type,
|
|
169
|
-
formulaType: column.type === COLUMN.FORMULA ? column.formulaType : undefined,
|
|
170
168
|
sort: UChartPaginationApi._getSortOption(column),
|
|
171
169
|
},
|
|
172
170
|
];
|
|
@@ -181,9 +179,6 @@ UChartPaginationApi._getDimensionsBody = (uFilter) => {
|
|
|
181
179
|
*/
|
|
182
180
|
UChartPaginationApi._getDimensionsBodyAdapter = (dimensions = []) => dimensions.map((dimension) => ({
|
|
183
181
|
questionid: dimension.questionid,
|
|
184
|
-
type: dimension.type,
|
|
185
|
-
formulaType: dimension.type === COLUMN.FORMULA ? dimension.formulaType : undefined,
|
|
186
|
-
groupType: dimension.groupType,
|
|
187
182
|
groupValue: dimension.groupValue,
|
|
188
183
|
sort: {
|
|
189
184
|
by: _get(dimension, "sortOption.sortBy", "VALUE"),
|
|
@@ -230,7 +225,6 @@ UChartPaginationApi._getSummariesBody = (uFilter) => {
|
|
|
230
225
|
property: !isDateColumn(uFilter.column) && uFilter.column.type !== COLUMN.TIME
|
|
231
226
|
? uFilter.property
|
|
232
227
|
: undefined,
|
|
233
|
-
type: column.type,
|
|
234
228
|
};
|
|
235
229
|
let summaries = [summary];
|
|
236
230
|
if (isNumericalColumn(column) || isRangeValidator(validator)) {
|
|
@@ -253,7 +247,6 @@ UChartPaginationApi._refineBodies = (bodies, uFilter) => {
|
|
|
253
247
|
_bodies.forEach((body) => {
|
|
254
248
|
if (isDateColumn(uFilter.column) ||
|
|
255
249
|
uFilter.column.type === COLUMN.TIME) {
|
|
256
|
-
body.groupType = "DATE";
|
|
257
250
|
body.groupValue = uFilter.property.toUpperCase();
|
|
258
251
|
}
|
|
259
252
|
else {
|