Bug - Collection Sorting Not Working in TinaCMS
Requested by: @jakebayliss via YakShaver.ai cc: @jakebayliss, @kulesy, @adamcogan, @JackDevAU
Hi Team!
Watch the video (1 min 26 sec)
Url from screen share: http://localhost:3000/rules-beta/admin/index.html/collections/rule/~
Pain
Sorting by date does nothing in the folder view of a collection, which is where the admin always lands.
In a collection that stores one folder per document, every row in the list is a folder. Folder rows are written into every sort index with a key taken from their alphabetical position, so they carry no date at all.
The same collection sorts correctly by date when it is queried without the folder view.
Approach
Order the folder view's rows from the flat sort index that already returns the right answer.
Acceptance Criteria
- In the folder view, sorting by a date field orders rows by that date, not alphabetically.
- Collections queried without the folder view keep their current, correct ordering.
Reproduce Steps
- Navigate to the rules collection in TinaCMS.
- Attempt to sort by 'created by newest first' or 'last updated newest first'.
- Observe that the sorting is done alphabetically instead of by date.
Screenshot
Figure: Sorting by date is broken, defaults to alphabetical order.
Source: tinacms/tinacms