@optimiser/common 1.0.250 → 1.0.254
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/utility.js +16 -9
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -257,7 +257,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
257
257
|
ExtraLookupFields: [
|
|
258
258
|
"UserStatus",
|
|
259
259
|
"IsAppUser"
|
|
260
|
-
]
|
|
260
|
+
],
|
|
261
|
+
OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
|
|
261
262
|
}
|
|
262
263
|
};
|
|
263
264
|
createdDateObj = {
|
|
@@ -295,7 +296,8 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
295
296
|
ExtraLookupFields: [
|
|
296
297
|
"UserStatus",
|
|
297
298
|
"IsAppUser"
|
|
298
|
-
]
|
|
299
|
+
],
|
|
300
|
+
OnLinkRender: "if(lookupRecord.IsAppUser==true){isHyperlink=false;}"
|
|
299
301
|
}
|
|
300
302
|
};
|
|
301
303
|
modDateObj = {
|
|
@@ -390,13 +392,13 @@ function GetPageFieldData(pageName, db, mdb, msp_d, next, callback) {
|
|
|
390
392
|
};
|
|
391
393
|
pageData.Fields.splice(0, 0, idObject);
|
|
392
394
|
//By Kashish : To handle System Info Fields in Grid
|
|
393
|
-
if (!pageData.Fields.find(function (x) { return x.Name == 'CreatedBy'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName) && pageData.ObjectName != 'Task')
|
|
395
|
+
if (!pageData.Fields.find(function (x) { return x.Name == 'CreatedBy'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName) && pageData.ObjectName != 'Task' && pageData.ObjectName != 'Session')
|
|
394
396
|
pageData.Fields.push(createdByObj);
|
|
395
|
-
if (!pageData.Fields.find(function (x) { return x.Name == 'CreatedDate'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName))
|
|
397
|
+
if (!pageData.Fields.find(function (x) { return x.Name == 'CreatedDate'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName) && pageData.ObjectName != 'Session')
|
|
396
398
|
pageData.Fields.push(createdDateObj);
|
|
397
|
-
if (!pageData.Fields.find(function (x) { return x.Name == 'ModifiedBy'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName))
|
|
399
|
+
if (!pageData.Fields.find(function (x) { return x.Name == 'ModifiedBy'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName) && pageData.ObjectName != 'Session')
|
|
398
400
|
pageData.Fields.push(modByObj);
|
|
399
|
-
if (!pageData.Fields.find(function (x) { return x.Name == 'ModifiedDate'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName))
|
|
401
|
+
if (!pageData.Fields.find(function (x) { return x.Name == 'ModifiedDate'; }) && !['CompanySessionLogList', 'CompanyTransactionLogsList'].includes(pageData.PageName) && pageData.ObjectName != 'Session')
|
|
400
402
|
pageData.Fields.push(modDateObj);
|
|
401
403
|
}
|
|
402
404
|
if (pageData.Fields && pageData.Type == "ObjectDetail") {
|
|
@@ -1695,8 +1697,10 @@ function CheckDataBeforeUpdate(updateObj, objectData, objectSchema, db) {
|
|
|
1695
1697
|
if (fieldSchema.UIDataType == 'multiselect' || fieldSchema.UIDataType == 'multilookup') {
|
|
1696
1698
|
isSame = IsEqualArrays(oldValue, newValue);
|
|
1697
1699
|
}
|
|
1698
|
-
else
|
|
1699
|
-
|
|
1700
|
+
else {
|
|
1701
|
+
if (fldName !== "ModifiedBy")
|
|
1702
|
+
isSame = IsEqualValue(oldValue, newValue);
|
|
1703
|
+
}
|
|
1700
1704
|
if (!isSame) return [3 /*break*/, 3];
|
|
1701
1705
|
delete updateObj[fldName];
|
|
1702
1706
|
return [3 /*break*/, 5];
|
|
@@ -2611,12 +2615,15 @@ paratemter : {
|
|
|
2611
2615
|
function SignoutUserFromAllDevices(options, dbMaster, redisClient) {
|
|
2612
2616
|
if (dbMaster) {
|
|
2613
2617
|
var updateQuery_1 = { "IsActive": false, "Description": options.Description, "ModifiedBy": options.RemovedBy, "ModifiedDate": new Date() };
|
|
2614
|
-
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 0, "SessionKey": 1 } }).toArray(function (err, data) {
|
|
2618
|
+
dbMaster.collection('Session').find({ "UserID": options.UserID, "IsActive": true }, { projection: { "_id": 0, "SessionKey": 1, "Platform": 1 } }).toArray(function (err, data) {
|
|
2615
2619
|
if (err) {
|
|
2616
2620
|
if (options.callback)
|
|
2617
2621
|
options.callback({ message: 'error', error: err });
|
|
2618
2622
|
}
|
|
2619
2623
|
if (data) {
|
|
2624
|
+
if (options.Platform) {
|
|
2625
|
+
data = data.filter(function (x) { return (x.Platform == options.Platform); });
|
|
2626
|
+
}
|
|
2620
2627
|
for (var i = 0; i < data.length; i++) {
|
|
2621
2628
|
try {
|
|
2622
2629
|
redisClient.del(data[i].SessionKey.toString());
|