Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9194 +/- ##
=======================================
Coverage 80.71% 80.71%
=======================================
Files 477 477
Lines 26380 26407 +27
Branches 7025 7036 +11
=======================================
+ Hits 21292 21314 +22
- Misses 5088 5093 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9193
Since paging landed the Tables grid couldn't be sorted at all, and before that a header click only sorted the rows on screen. Clicking a column header now sorts the whole table by that column. It's the first of the 3.4 pieces of #9160.
The first click sorts largest first, the second smallest first, and the third goes back to the table's own order, the same cycle every other grid in the app uses. Changing the sort takes you back to the first page, paging carries on in the sorted order, and switching to another table drops the sort. While the sorted page loads the grid shows the same placeholder rows it does when changing page.
The data API takes
sortanddirfor this. The sorted column goes first and the primary key (or the row position when there isn't one) stays behind it, so rows holding the same value keep a fixed order from one page to the next. Empty values go wherever Postgres puts them, last when ascending and first when descending. The route also has its own query schema now instead of the shared pagination one, since it pages by number and has no cursor or search. A column that doesn't exist, or one whose values can't be put in order (plainjsonfor one), comes back as a 400 with a readable message instead of a 500, and the page shows it as a warning.Not every column offers sorting. JSON, binary and list columns don't, and neither do types the page has no friendly name for, since Postgres can't order some of those. Text sorts the way Postgres sorts text, so "item 9" comes after "item 57".
The shared
ff-data-tablegot a smallserver-side-sortswitch so it shows the rows in the order they arrive rather than sorting the page itself. It's off by default, so no other table changes. The Sort button from the mockups isn't here, the header does the same job while there's one column to sort by.Checked in the browser on a 57 row table: both directions, the reset on the third click, paging through a sorted table, switching tables, and the columns that don't offer sorting. Also called the API directly for a missing column, a
jsoncolumn and where empty values land, and added tests for the query, the route, the store, the grid and the page.