@followupus/common 0.9.9 → 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.
@@ -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 = !!itemValue?.some((item) => {
454
- const val = item.value;
455
- return checkConditionFn(val);
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 = checkConditionFn(itemValue);
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;
@@ -472,8 +488,7 @@ export const filterItemsByConditions = (groups, filter, headers, currentUserId)
472
488
  }
473
489
  groups.forEach(g => {
474
490
  g.items = g.items?.filter(item => {
475
- return (checkItemMatched(item, validConditions, headers) ||
476
- item.subs?.some(sub => checkItemMatched(sub, validConditions, headers)));
491
+ return checkItemMatched(item, validConditions, headers);
477
492
  });
478
493
  });
479
494
  return groups;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@followupus/common",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
4
4
  "description": "followup common utils npm package with TypeScript and VSCode",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",