@optimiser/common 1.0.251 → 1.0.255
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 +23 -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());
|
|
@@ -3657,6 +3664,8 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
|
|
|
3657
3664
|
setQuery_1['TotalEnterpriseLicence'] = 0;
|
|
3658
3665
|
var totalNoOfFeatureLicence = 0;
|
|
3659
3666
|
var totalNoOfAppLicence = 0;
|
|
3667
|
+
//Added by Chetan on 22Feb2022, for domain licence
|
|
3668
|
+
var totalNoOfDomainLicence = 0;
|
|
3660
3669
|
for (var c = 0; c < companyLicences.length; c++) {
|
|
3661
3670
|
var licenceType = companyLicences[c]._id['LicenceType'];
|
|
3662
3671
|
var licenceName = companyLicences[c]._id['LicenceName'];
|
|
@@ -3670,6 +3679,9 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
|
|
|
3670
3679
|
else if (licenceType == 'App') {
|
|
3671
3680
|
totalNoOfAppLicence += parseInt(companyLicenceTotal);
|
|
3672
3681
|
}
|
|
3682
|
+
else if (licenceType == 'Domain') {
|
|
3683
|
+
totalNoOfDomainLicence += parseInt(companyLicenceTotal); /*Added by Chetan on 22Feb2022, for domain licence*/
|
|
3684
|
+
}
|
|
3673
3685
|
for (var i in companyLicencesData_2) {
|
|
3674
3686
|
if (i == licenceType) {
|
|
3675
3687
|
var companyLicenceType = companyLicencesData_2[i];
|
|
@@ -3683,6 +3695,8 @@ function SyncCompanyLicenceInMasterCompanyAfterAdd(fieldsObj, dbMaster) {
|
|
|
3683
3695
|
}
|
|
3684
3696
|
setQuery_1['TotalFeatureLicence'] = totalNoOfFeatureLicence;
|
|
3685
3697
|
setQuery_1['TotalAppLicence'] = totalNoOfAppLicence;
|
|
3698
|
+
//Added by Chetan on 22Feb2022, for domain licence
|
|
3699
|
+
setQuery_1['TotalDomainLicence'] = totalNoOfDomainLicence;
|
|
3686
3700
|
setQuery_1.Setting["Licences"] = companyLicencesData_2;
|
|
3687
3701
|
dbMaster.collection('Company').updateOne({ _id: companyId_1, 'IsActive': true }, { $set: setQuery_1 });
|
|
3688
3702
|
}
|