@visns-studio/visns-components 5.8.3 → 5.8.4
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/package.json
CHANGED
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
83
83
|
},
|
|
84
84
|
"name": "@visns-studio/visns-components",
|
|
85
|
-
"version": "5.8.
|
|
85
|
+
"version": "5.8.4",
|
|
86
86
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
87
87
|
"main": "src/index.js",
|
|
88
88
|
"files": [
|
|
@@ -411,8 +411,10 @@ function TableFilter({
|
|
|
411
411
|
)
|
|
412
412
|
: [];
|
|
413
413
|
|
|
414
|
-
// Add the new filter
|
|
415
|
-
|
|
414
|
+
// Add the new filter only if both filterId and filterValue have values
|
|
415
|
+
if (filterId && filterValue !== '') {
|
|
416
|
+
_where.push({ id: filterId, value: filterValue });
|
|
417
|
+
}
|
|
416
418
|
|
|
417
419
|
updatedSettings = {
|
|
418
420
|
...updatedSettings,
|
|
@@ -430,19 +432,27 @@ function TableFilter({
|
|
|
430
432
|
// Remove any existing filters that might conflict
|
|
431
433
|
w = w.filter((item) => item.id !== filterId);
|
|
432
434
|
|
|
433
|
-
// Add the new filter
|
|
434
|
-
|
|
435
|
+
// Add the new filter only if both filterId and filterValue have values
|
|
436
|
+
if (filterId && filterValue !== '') {
|
|
437
|
+
w.push({ id: filterId, value: filterValue });
|
|
438
|
+
}
|
|
435
439
|
|
|
436
440
|
updatedSettings = { ...updatedSettings, where: w };
|
|
437
441
|
} else {
|
|
438
442
|
// If neither ajaxSetting.where nor where exists, create a new ajaxSetting
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
...
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
443
|
+
// Only apply the filter if both filterId and filterValue have values
|
|
444
|
+
if (filterId && filterValue !== '') {
|
|
445
|
+
updatedSettings = {
|
|
446
|
+
...settings,
|
|
447
|
+
ajaxSetting: {
|
|
448
|
+
...(settings.ajaxSetting || {}),
|
|
449
|
+
where: [{ id: filterId, value: filterValue }],
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
} else {
|
|
453
|
+
// If either filterId or filterValue is empty, just copy the existing settings
|
|
454
|
+
updatedSettings = { ...settings };
|
|
455
|
+
}
|
|
446
456
|
}
|
|
447
457
|
}
|
|
448
458
|
}
|