Filter grouping support to DataViewFilters

Đang mở
#735 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@katarinazaprazna đang làm issue này rồi.

Từ ngày 20/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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)
Ngôn ngữ chính
TypeScript
Star
4
Fork
21
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
15

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của patternfly/react-data-view

Tất cả issue của patternfly/react-data-view

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.