patternfly / patternfly/patternfly-react

Bug - DataViewFilters - childrenHash from JSON.stringify results in cyclic object value

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

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
862
Fork
392
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
9

Mô tả

Describe the problem
When using DataViewFilters with a child DataViewCheckboxFilter where the options have a label with a component (e.g. with an icon), the calculation of childrenHash via JSON.stringify results in a JavaScript cyclic object value error.

How do you reproduce the problem?
Provide steps to reproduce. A codesandbox demonstrating the problem is appreciated.

Expected behavior
I expect to be able to use a React component in the option labels. The goal is to render select list with options having icons and possibly tool tips.

Is this issue blocking you?
Worked around this by creating a copy of DataViewFilters in our project with a stricter set of properties provided to JSON.stringify [1].

Screenshots
Desired component:

image

What is your environment?

  • OS: Fedora 43
  • Browser: Firefox
  • Version: 151

What is your product and what release date are you targeting?
StreamsHub Console [2] (user interface for Kafka clusters), planning to release in a week or so, likely with described work-around.

Any other information?
[1] https://github.com/MikeEdgar/streamshub-console/blob/418cb07cb05290e7d9be03ff67e39012d9b3095a/api/src/main/webui/src/components/common/DataViewFilters.tsx
[2] https://github.com/streamshub/console


Jira Issue: PF-4412

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu từ phần triển khai DataViewFilters và tái hiện giá trị đối tượng tuần hoàn bằng CodeSandbox được liên kết, với một DataViewCheckboxFilter con có nhãn tùy chọn là một component React. So sánh hành vi với workaround được liên kết và xác minh rằng các nhãn component, bao gồm icon hoặc tooltip, được render mà không có lỗi JSON.stringify.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
react, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
58/100

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.