Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

DataView filters: match rows where the field is an array

未关闭 适合新手
#943 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 6 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, typescript
领域
frontend

调研方向

在代码库中搜索 String(row.getValue(columnId)),以定位 DataView 针对 select/multiselect(in、notin、eq、neq)的过滤操作。阅读这些运算符目前如何对值进行强制转换,然后添加一个 Array.isArray(cellValue) 分支,为 in/eq 实现 any-match,为 notin/neq 实现 no-match,同时保持标量行为不变。添加覆盖数组单元格以及现有字符串/数字用例的测试;完成的标志是旧测试和新测试都通过,且 groupable 不在范围内。

由索引模型根据 Issue 内容生成。

描述

Right now a select/multiselect filter only works when each row has one value in that column. A lot of real data has several: tags on a ticket, labels on an issue, all the projects someone is on.

What happens today

Say a row has labels: ['bug', 'urgent'] and you filter labels with "is any of: urgent". The in check does String(row.getValue(columnId)), which turns the array into "bug,urgent". It never matches. eq has the same problem.

There's also no way to pass a custom filterFn for a field, so you can't work around it from the outside.

What I'd expect

When the cell value is an array:

  • in (is any of): match if any item in the row is in the selected set
  • notin (is none of): match if no item in the row is in the selected set
  • eq / neq for select: same idea with one value

Strings and numbers keep working exactly like they do now, so nothing changes for existing tables.

Grouping by an array field is a separate question (one row in several groups?). I'd leave that out of this, and maybe just not allow groupable on array fields for now.

Possible shape

Probably just checking Array.isArray(cellValue) inside the select and multiselect operations. Or an explicit flag like field.multiValue: true, if you'd rather be strict about it.

主要语言
TypeScript
星标
69
派生
13
平均合并
4 天 14 小时
30 天内合并 PR
34

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

raystack/apsara 的其他 Issue

查看 raystack/apsara 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。