@followupus/common 0.9.8 → 0.9.10
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/shared/shared.js +21 -5
- package/package.json +1 -1
package/dist/shared/shared.js
CHANGED
|
@@ -388,6 +388,7 @@ const checkItemMatched = (item, validConditions, headers) => {
|
|
|
388
388
|
if (isLinkedColumn) {
|
|
389
389
|
checkHeader = header?.linked;
|
|
390
390
|
}
|
|
391
|
+
const isPeople = checkHeader?.type === COLUMN_TYPES.PEOPLE;
|
|
391
392
|
const valueType = getColumnValueType(checkHeader?.type ?? "");
|
|
392
393
|
const checkConditionFn = (itemVal) => {
|
|
393
394
|
let match = false;
|
|
@@ -450,13 +451,28 @@ const checkItemMatched = (item, validConditions, headers) => {
|
|
|
450
451
|
? item.data?.[condition.columnId]
|
|
451
452
|
: item.data?.[condition.columnId]?.value;
|
|
452
453
|
if (isLinkedColumn) {
|
|
453
|
-
isItemMatched =
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
isItemMatched =
|
|
455
|
+
!!itemValue?.some((item) => {
|
|
456
|
+
const val = item.value;
|
|
457
|
+
return checkConditionFn(val);
|
|
458
|
+
}) ||
|
|
459
|
+
(isPeople &&
|
|
460
|
+
!!item.subs?.some(sub => {
|
|
461
|
+
const subValue = sub.data?.[condition.columnId];
|
|
462
|
+
return !!subValue?.some((item) => {
|
|
463
|
+
const val = item.value;
|
|
464
|
+
return checkConditionFn(val);
|
|
465
|
+
});
|
|
466
|
+
}));
|
|
457
467
|
}
|
|
458
468
|
else {
|
|
459
|
-
isItemMatched =
|
|
469
|
+
isItemMatched =
|
|
470
|
+
checkConditionFn(itemValue) ||
|
|
471
|
+
(isPeople &&
|
|
472
|
+
!!item.subs?.some(sub => {
|
|
473
|
+
const subValue = sub.data?.[condition.columnId]?.value;
|
|
474
|
+
return checkConditionFn(subValue);
|
|
475
|
+
}));
|
|
460
476
|
}
|
|
461
477
|
if (!isItemMatched)
|
|
462
478
|
return false;
|