Filter grouping support to DataViewFilters

未关闭
#735 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@katarinazaprazna 已经在做这个了。

开始于 2026年11月20日。

评估

这个 Issue 还没有评估数据。

描述

Overview

Insights Inventory binds filters from multiple backend services (Inventory, Advisor, Vulnerability) in the same toolbar. There's no way to communicate to users which filter belongs to which service when using the flat attribute dropdown. Inventory needs the Menu's titled groups of items functionality to be accessible from data-view

Currently, they're using a custom component of DataViewFilters to work around this. The goal is to get the requested changes merged so Inventory can delete their fork

Proposed API

Proposed API (purely additive - all new props are optional):

  interface DataViewFilterGroup {
    id: string;
    label: React.ReactNode;
    filterIds: string[];  // filterIds belonging to this group, in display order
  }

  // added to DataViewFiltersProps:
  groups?: DataViewFilterGroup[];
  groupLabelHeadingLevel?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';  // default 'h3'
  ungroupedPosition?: 'start' | 'end';  // default 'start'

Non-breaking requirement: When groups is omitted, the output must be byte-identical to today. No existing consumer can be affected. This is verifiable against PF's own existing snapshot tests - if a snapshot moves, the patch is wrong.

Reference ticket from Insights Inventory: https://redhat.atlassian.net/browse/RHINENG-34064

Acceptance criteria

  • Existing consumers passing no groups see no change in behaviour or DOM
  • Attribute menu shows a labelled heading per group, in groups array order
  • Dividers render between groups, not before the first
  • A group whose filterIds match no children is dropped entirely
  • A filterId listed in two groups appears only in the first
  • Filters not listed in any group render at ungroupedPosition
  • groupLabelHeadingLevel controls the heading element (default h3 — h1 is wrong inside a dropdown)
主要语言
TypeScript
星标
4
派生
21
平均合并
4 天 9 小时
30 天内合并 PR
15

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

patternfly/react-data-view 的其他 Issue

查看 patternfly/react-data-view 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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