DataView filters: match rows where the field is an array
维护者通常 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 setnotin(is none of): match if no item in the row is in the selected seteq/neqforselect: 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
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
raystack/apsara 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 6 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
维护者通常 6 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 6 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
TomerAberbach/profiler-md#733 ·
维护者通常 1 天内回复
-
bug priority: medium
难度 2/5 1-3 小时 新手友好度 68/100
brentspine/brents-toasts#143 ·
-
🐛 bug 🗺️ DB Models & Ops
难度 2/5 1-3 小时 新手友好度 83/100
LibreChat-AI/LibreChat#17214 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
Wavvon/Wavvon-clients#136 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
umami-software/umami#4637 ·
维护者通常 3 天内回复