@optimiser/common 1.0.308 → 1.0.309
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 +19 -4
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -2130,6 +2130,7 @@ function FilterConditions(condition, match, fields) {
|
|
|
2130
2130
|
sets = match.$or;
|
|
2131
2131
|
}
|
|
2132
2132
|
var _loop_13 = function (i) {
|
|
2133
|
+
var _a, _b, _c;
|
|
2133
2134
|
var obj = condition.Filters[i];
|
|
2134
2135
|
if (obj.Type == "Child") {
|
|
2135
2136
|
var childMatch = {};
|
|
@@ -2178,6 +2179,8 @@ function FilterConditions(condition, match, fields) {
|
|
|
2178
2179
|
break;
|
|
2179
2180
|
}
|
|
2180
2181
|
}
|
|
2182
|
+
// Or Condition code in NOT_CONTAINS filter was added by Shahzaib for QPC-6368
|
|
2183
|
+
var orCondInNotContains = void 0;
|
|
2181
2184
|
// Below If condition added by Nidhi - QPC-5338
|
|
2182
2185
|
if (field.Schema.UIDataType === 'date' || field.Schema.UIDataType === 'datetime') {
|
|
2183
2186
|
var operator = obj.Operator;
|
|
@@ -2187,7 +2190,7 @@ function FilterConditions(condition, match, fields) {
|
|
|
2187
2190
|
endCompareDate = moment_1.default((_b = obj.Value) === null || _b === void 0 ? void 0 : _b.To, "DD-MMM-YYYY").endOf('day');
|
|
2188
2191
|
}
|
|
2189
2192
|
else {
|
|
2190
|
-
var
|
|
2193
|
+
var _d = helper_1.GetDateRangeFromOperatorValue(operator, obj.FiscalMonth, obj.FiscalFrom), startDate = _d.startDate, endDate = _d.endDate;
|
|
2191
2194
|
startCompareDate = moment_1.default(startDate, "DD-MMM-YYYY").startOf('day');
|
|
2192
2195
|
endCompareDate = moment_1.default(endDate, "DD-MMM-YYYY").endOf('day');
|
|
2193
2196
|
}
|
|
@@ -2210,8 +2213,14 @@ function FilterConditions(condition, match, fields) {
|
|
|
2210
2213
|
else if (["dropdown", "multiselect"].includes(field.Schema.UIDataType) || field.Schema.SearchType == 'multiselect') {
|
|
2211
2214
|
matchValue = { '$nin': obj.Value };
|
|
2212
2215
|
}
|
|
2213
|
-
else
|
|
2214
|
-
|
|
2216
|
+
else {
|
|
2217
|
+
// Or Condition code in NOT_CONTAINS filter was added by Shahzaib for QPC-6368
|
|
2218
|
+
orCondInNotContains = [
|
|
2219
|
+
(_a = {}, _a[fldName] = { '$regex': '^((?!' + obj.Value + ').)*$', '$options': 'i' }, _a),
|
|
2220
|
+
(_b = {}, _b[fldName] = { $exists: false }, _b),
|
|
2221
|
+
(_c = {}, _c[fldName] = { '$in': [null, ''] }, _c)
|
|
2222
|
+
];
|
|
2223
|
+
}
|
|
2215
2224
|
break;
|
|
2216
2225
|
case "EQUAL":
|
|
2217
2226
|
if (obj.Value === '')
|
|
@@ -2292,7 +2301,13 @@ function FilterConditions(condition, match, fields) {
|
|
|
2292
2301
|
}
|
|
2293
2302
|
}
|
|
2294
2303
|
var fieldMatch = {};
|
|
2295
|
-
|
|
2304
|
+
// Below only if condition part was added by Shahzaib for QPC-6368
|
|
2305
|
+
if (obj.Operator == 'NOT_CONTAINS' && (orCondInNotContains === null || orCondInNotContains === void 0 ? void 0 : orCondInNotContains.length) > 0) {
|
|
2306
|
+
fieldMatch.$or = orCondInNotContains;
|
|
2307
|
+
}
|
|
2308
|
+
else {
|
|
2309
|
+
fieldMatch[fldName] = matchValue;
|
|
2310
|
+
}
|
|
2296
2311
|
sets.push(fieldMatch);
|
|
2297
2312
|
}
|
|
2298
2313
|
}
|