@resolveio/server-lib 4.4.22 → 4.4.24
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/methods/cron-jobs.js
CHANGED
|
@@ -414,7 +414,12 @@ function loadCronJobMethods(methodManager) {
|
|
|
414
414
|
result[field.id] = result[field.id] === true ? 'Yes' : 'No';
|
|
415
415
|
});
|
|
416
416
|
}
|
|
417
|
-
else if (field.fieldType === 'Boolean' && field.leafFormatType === '
|
|
417
|
+
else if (field.fieldType === 'Boolean' && (!field.leafFormatType || field.leafFormatType === 'Boolean')) {
|
|
418
|
+
results_1.filter(function (a) { return a[field.id] !== null; }).forEach(function (result) {
|
|
419
|
+
result[field.id] = result[field.id] === true ? 'True' : 'False';
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
else if (field.fieldType === 'Boolean' && field.leafFormatType === 'Boolean_Number') {
|
|
418
423
|
results_1.filter(function (a) { return a[field.id] !== null; }).forEach(function (result) {
|
|
419
424
|
result[field.id] = result[field.id] === true ? 1 : 0;
|
|
420
425
|
});
|
|
@@ -187,7 +187,7 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
187
187
|
if (date_field === void 0) { date_field = ''; }
|
|
188
188
|
if (date_interval === void 0) { date_interval = ''; }
|
|
189
189
|
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
190
|
-
var _a, _b, uniqueSelectedFieldCollections, modelCollection, queryMatchCondition, queryLookups, queryUnwindCollectionPaths, queryGroups, queryGroupUnwind, queryGroup_1, correctSort_1, _loop_1, i, queryProjection, queryTotals, query, queryMatchConditionLookup, tmpProj_1, tmpAnds_1, res, err_1;
|
|
190
|
+
var _a, _b, uniqueSelectedFieldCollections, modelCollection, queryMatchCondition, queryLookups, queryGroupUnwindCollectionPaths, queryUnwindCollectionPaths, queryGroups, queryGroupUnwind, queryGroup_1, correctSort_1, _loop_1, i, queryProjection, queryTotals, query, queryMatchConditionLookup, tmpProj_1, tmpAnds_1, res, err_1;
|
|
191
191
|
var _this = this;
|
|
192
192
|
return __generator(this, function (_c) {
|
|
193
193
|
switch (_c.label) {
|
|
@@ -244,23 +244,24 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
var arrayPartData = field.fieldPath.split('.$');
|
|
247
|
+
queryGroupUnwindCollectionPaths = [];
|
|
248
|
+
groupsRow.filter(function (a) { return a.treeItem.fieldPath.includes('$'); }).forEach(function (field) {
|
|
249
|
+
var arrayPartData = field.treeItem.fieldPath.split('.$');
|
|
250
250
|
var path = '$';
|
|
251
251
|
for (var i = 0; i < arrayPartData.length - 1; i++) {
|
|
252
252
|
path += arrayPartData[i];
|
|
253
|
-
if (!
|
|
254
|
-
|
|
253
|
+
if (!queryGroupUnwindCollectionPaths.filter(function (a) { return a === path; })[0]) {
|
|
254
|
+
queryGroupUnwindCollectionPaths.push(path);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
queryUnwindCollectionPaths = [];
|
|
259
|
+
selectedFields.filter(function (a) { return a.fieldPath.includes('$'); }).forEach(function (field) {
|
|
260
|
+
var arrayPartData = field.fieldPath.split('.$');
|
|
260
261
|
var path = '$';
|
|
261
262
|
for (var i = 0; i < arrayPartData.length - 1; i++) {
|
|
262
263
|
path += arrayPartData[i];
|
|
263
|
-
if (!queryUnwindCollectionPaths.
|
|
264
|
+
if (!queryUnwindCollectionPaths.some(function (a) { return a === path; }) && !queryGroupUnwindCollectionPaths.some(function (a) { return a === path; })) {
|
|
264
265
|
queryUnwindCollectionPaths.push(path);
|
|
265
266
|
}
|
|
266
267
|
}
|
|
@@ -471,6 +472,14 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
471
472
|
}
|
|
472
473
|
});
|
|
473
474
|
});
|
|
475
|
+
queryGroupUnwindCollectionPaths.filter(function (a) { return !a.includes('(Lookup)'); }).forEach(function (path) {
|
|
476
|
+
query.push({
|
|
477
|
+
$unwind: {
|
|
478
|
+
path: path,
|
|
479
|
+
preserveNullAndEmptyArrays: false
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
});
|
|
474
483
|
// Look Ups
|
|
475
484
|
queryLookups.forEach(function (lookup) {
|
|
476
485
|
query.push({
|
|
@@ -488,6 +497,16 @@ function loadReportBuilderMethods(methodManager) {
|
|
|
488
497
|
});
|
|
489
498
|
}
|
|
490
499
|
});
|
|
500
|
+
queryGroupUnwindCollectionPaths.filter(function (a) { return a.includes('(Lookup)'); }).forEach(function (path) {
|
|
501
|
+
if (!query.filter(function (a) { return a.$unwind && a.$unwind.path === path; }).length) {
|
|
502
|
+
query.push({
|
|
503
|
+
$unwind: {
|
|
504
|
+
path: path,
|
|
505
|
+
preserveNullAndEmptyArrays: false
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
});
|
|
491
510
|
// Group Unwinds
|
|
492
511
|
if (groupsRow.length) {
|
|
493
512
|
query = query.concat(queryGroupUnwind.filter(function (a) { return !query.some(function (b) { return b.$unwind && (b.$unwind.path === a.$unwind.path); }); }));
|