patternfly / patternfly/patternfly-react
Bug - DataViewFilters - childrenHash from JSON.stringify results in cyclic object value
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 862
- Fork
- 392
- Merge medio
- 4g 8h
- PR unite (30g)
- 9
Descrizione
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:
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Parti dall’implementazione di DataViewFilters e riproduci il valore dell’oggetto ciclico usando il CodeSandbox collegato, con un DataViewCheckboxFilter figlio la cui etichetta dell’opzione è un componente React. Confronta il comportamento con la soluzione alternativa collegata e verifica che le etichette dei componenti, comprese icone o tooltip, vengano visualizzate senza l’errore JSON.stringify.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react, typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 58/100