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 摘要。