improve Table API with regards to Sorting

Offen
#302 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

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

Rechercherichtung

Start by reading the Table component API and its sorting implementation, then find the tests that cover sortable columns. Remove columns.isSortable and add sort.sortableColumns as an array of column names; update the API tests to verify sorting uses those names and that columns, rows, and sort configuration stay aligned.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Presently it is possible to express in Table component API invalid configuration.

It is valid to set columns.isSortable = true and not provide the sort object. We could validate this via a custom Prop validation function, but I think it more elegant to:

  • remove the columns.isSortable param
  • add new sort.sortableColumns param holding an array of column names

With this change the user only has to ensure that the column names within params columns, rows, and sort match.

Vorherrschende Sprache
TypeScript
Sterne
23
Forks
10
Ø Merge
5 T. 12 Std.
Gemergte PRs (30 T.)
9

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

  • Kein Dockerfile und keine Docker-Compose-Datei
  • Keine Pull-Request-Vorlage
  • Kein Beitragsleitfaden

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus react-ui-org/react-ui

Alle Issues in react-ui-org/react-ui

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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