@optimiser/common 1.0.265 → 1.0.266
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 -2
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -2171,9 +2171,19 @@ function GirdHeaderFilters(filters, fields) {
|
|
|
2171
2171
|
var matchValue = null;
|
|
2172
2172
|
var fldName = field.UniqueID;
|
|
2173
2173
|
if (["lookup", "multilookup"].includes(field.Schema.UIDataType)) {
|
|
2174
|
-
|
|
2174
|
+
//added by nirbhay on 12 apr 2022, added dropdown and multiselect for lookup and multilookup field
|
|
2175
|
+
if (field.Schema.SearchType == 'dropdown') {
|
|
2176
|
+
matchValue = { '$eq': bson_1.EJSON.parse(JSON.stringify(obj.Value)) };
|
|
2177
|
+
}
|
|
2178
|
+
else if (field.Schema.SearchType == 'multiselect') {
|
|
2179
|
+
matchValue = { '$in': bson_1.EJSON.parse(JSON.stringify(obj.Value)) };
|
|
2180
|
+
}
|
|
2181
|
+
else {
|
|
2182
|
+
fldName += '_SearchValue';
|
|
2183
|
+
matchValue = { '$regex': obj.Value.trim().replace(/[-[\]{}()*+?.,\\/^$|#\s]/g, "\\$&"), '$options': 'i' };
|
|
2184
|
+
}
|
|
2175
2185
|
}
|
|
2176
|
-
if (["dropdown", "multiselect"].includes(field.Schema.UIDataType)) {
|
|
2186
|
+
else if (["dropdown", "multiselect"].includes(field.Schema.UIDataType)) {
|
|
2177
2187
|
if (field.Schema.LookupObject) {
|
|
2178
2188
|
matchValue = { '$in': bson_1.EJSON.parse(JSON.stringify(obj.Value)) };
|
|
2179
2189
|
}
|
|
@@ -2196,6 +2206,10 @@ function GirdHeaderFilters(filters, fields) {
|
|
|
2196
2206
|
else if (["decimal", "percent"].includes(field.Schema.UIDataType))
|
|
2197
2207
|
matchValue = { '$eq': mongodb_1.Decimal128.fromString(obj.Value) };
|
|
2198
2208
|
else if (field.Schema.UIDataType == 'objectid')
|
|
2209
|
+
matchValue = { '$eq': bson_1.EJSON.parse(JSON.stringify(obj.Value)) };
|
|
2210
|
+
else if (field.Schema.IsEqualAndCaseInsensitiveSearch === true)
|
|
2211
|
+
matchValue = new RegExp('^' + obj.Value + '$', 'i');
|
|
2212
|
+
else if (field.Schema.IsEqualSearch === true)
|
|
2199
2213
|
matchValue = { '$eq': obj.Value };
|
|
2200
2214
|
else
|
|
2201
2215
|
matchValue = { '$regex': obj.Value.trim().replace(/[-[\]{}()*+?.,\\/^$|#\s]/g, "\\$&"), '$options': 'i' };
|