patternfly / patternfly/patternfly-react

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

Offen
#12,536 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
862
Forks
392
Ø Merge
4 T. 8 Std.
Gemergte PRs (30 T.)
9

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne bei der Implementierung von DataViewFilters und reproduziere den zyklischen Objektwert mithilfe der verknüpften CodeSandbox, mit einem untergeordneten DataViewCheckboxFilter, dessen Optionslabel eine React-Komponente ist. Vergleiche das Verhalten mit dem verknüpften Workaround und überprüfe, dass Komponentenlabels, einschließlich Icons oder Tooltips, ohne den JSON.stringify-Fehler gerendert werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
58/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.