@optimiser/common 1.0.320 → 1.0.322
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/dist/lib/event.js +3 -1
- package/dist/lib/utility.js +26 -8
- package/package.json +1 -1
package/dist/lib/event.js
CHANGED
|
@@ -69,7 +69,9 @@ var Event = /** @class */ (function () {
|
|
|
69
69
|
}
|
|
70
70
|
_a.label = 2;
|
|
71
71
|
case 2:
|
|
72
|
-
if (userId && data.SocketObj && !data.SocketObj.userId) {
|
|
72
|
+
// if (userId && data.SocketObj && !data.SocketObj.userId) {
|
|
73
|
+
//QPC-7064, Ankush changes added
|
|
74
|
+
if (userId && data.SocketObj && data.SocketObj.userId != userId) {
|
|
73
75
|
data.SocketObj["userId"] = userId;
|
|
74
76
|
}
|
|
75
77
|
uniqueID = uuid_1.v4() + "-" + Math.floor(Math.random() * 100000000);
|
package/dist/lib/utility.js
CHANGED
|
@@ -1456,6 +1456,24 @@ function SyncUserInOtherCollection(options, db, callback, next) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
}
|
|
1458
1458
|
exports.SyncUserInOtherCollection = SyncUserInOtherCollection;
|
|
1459
|
+
function GetObjectByString(o, s) {
|
|
1460
|
+
s = s.replace(/\[(\w+)\]/g, '.$1'); // convert indexes to properties
|
|
1461
|
+
s = s.replace(/^\./, ''); // strip a leading dot
|
|
1462
|
+
var a = s.split('.');
|
|
1463
|
+
for (var i = 0, n = a.length; i < n; ++i) {
|
|
1464
|
+
var k = a[i];
|
|
1465
|
+
if (k in o) {
|
|
1466
|
+
if (o[k] != null)
|
|
1467
|
+
o = o[k];
|
|
1468
|
+
else
|
|
1469
|
+
o = '';
|
|
1470
|
+
}
|
|
1471
|
+
else {
|
|
1472
|
+
return '';
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return o;
|
|
1476
|
+
}
|
|
1459
1477
|
//Build _LookupDataField before save
|
|
1460
1478
|
function BuildLookupDataField(fieldSchema, updateObj, db) {
|
|
1461
1479
|
return new Promise(function (resolve, reject) {
|
|
@@ -1529,8 +1547,8 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
|
|
|
1529
1547
|
if (fieldSchema.ExcludeLookupFieldsOnSearch && fieldSchema.ExcludeLookupFieldsOnSearch.filter(function (x) { return x == fieldSchema.LookupFields[j]; }).length != 0) {
|
|
1530
1548
|
return "continue";
|
|
1531
1549
|
}
|
|
1532
|
-
if (fldLookupData_1
|
|
1533
|
-
result += fldLookupData_1
|
|
1550
|
+
if (GetObjectByString(fldLookupData_1, fieldSchema.LookupFields[j]) != undefined)
|
|
1551
|
+
result += GetObjectByString(fldLookupData_1, fieldSchema.LookupFields[j]).toString() + ' ';
|
|
1534
1552
|
};
|
|
1535
1553
|
for (var j = 0; j < fieldSchema.LookupFields.length; j++) {
|
|
1536
1554
|
_loop_10(j);
|
|
@@ -1573,8 +1591,8 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
|
|
|
1573
1591
|
var lookupRecord = data[i];
|
|
1574
1592
|
if (fieldSchema.LookupFields != undefined) {
|
|
1575
1593
|
for (var j = 0; j < fieldSchema.LookupFields.length; j++) {
|
|
1576
|
-
if (lookupRecord
|
|
1577
|
-
result += lookupRecord
|
|
1594
|
+
if (GetObjectByString(lookupRecord, fieldSchema.LookupFields[j]) != undefined)
|
|
1595
|
+
result += GetObjectByString(lookupRecord, fieldSchema.LookupFields[j]).toString() + ' ';
|
|
1578
1596
|
}
|
|
1579
1597
|
}
|
|
1580
1598
|
}
|
|
@@ -1599,8 +1617,8 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
|
|
|
1599
1617
|
var result = '';
|
|
1600
1618
|
if (fieldSchema.LookupFields != undefined) {
|
|
1601
1619
|
for (var j = 0; j < fieldSchema.LookupFields.length; j++) {
|
|
1602
|
-
if (fldLookupData_1
|
|
1603
|
-
result += fldLookupData_1
|
|
1620
|
+
if (GetObjectByString(fldLookupData_1, fieldSchema.LookupFields[j]) != undefined)
|
|
1621
|
+
result += GetObjectByString(fldLookupData_1, fieldSchema.LookupFields[j]).toString() + ' ';
|
|
1604
1622
|
}
|
|
1605
1623
|
}
|
|
1606
1624
|
updateObj[searchAlias_1] = result === null || result === void 0 ? void 0 : result.trim();
|
|
@@ -1652,8 +1670,8 @@ function BuildLookupDataField(fieldSchema, updateObj, db) {
|
|
|
1652
1670
|
var lookupRecord = data[i];
|
|
1653
1671
|
if (fieldSchema.LookupFields != undefined) {
|
|
1654
1672
|
for (var j = 0; j < fieldSchema.LookupFields.length; j++) {
|
|
1655
|
-
if (lookupRecord
|
|
1656
|
-
result += lookupRecord
|
|
1673
|
+
if (GetObjectByString(lookupRecord, fieldSchema.LookupFields[j]) != undefined)
|
|
1674
|
+
result += GetObjectByString(lookupRecord, fieldSchema.LookupFields[j]).toString() + ' ';
|
|
1657
1675
|
}
|
|
1658
1676
|
}
|
|
1659
1677
|
}
|