Bug #19988
closed
In project view, when clicking the button to sort by modified_at, it actually sorts by created_at
Added by Peter Amstutz almost 2 years ago.
Updated almost 2 years ago.
Release relationship:
Auto
Description
Reported by user & confirmed, in project view, when clicking on the arrow next to the modified at column to sort by modified_at, it actually sorts by created_at (confirmed by looking at the order
clause of the request that was sent in the network panel.)
- Description updated (diff)
- Target version changed from Future to To be scheduled
- Target version changed from To be scheduled to 2023-03-01 sprint
- Assigned To set to Stephen Smith
- Status changed from New to In Progress
Changes at arvados-workbench2|ea39c941f858898a9c701c818daee2b53714d19d
Tests developer-tests-workbench2: #1102
- Added type parameter to DataColumn(s) to allow constraining the sort.field value to a keyof a specific type
- For data explorers used with multiple types, this works as long as you use a type that includes all the keys you want to sort by, alternatively casting should work fine too
- Fixed sorting for fields other than name and modified_at/created_at in all data explorers
- Removed sorting from favorites/public favorites since it was never connected to the api and the multiple separate queries would break the sorting anyway
Just a few of comments:
- I think the
getOrder()
utility func at src/store/collections-content-address-panel/collections-content-address-middleware-service.ts:L121
and others *-middleware-service.ts
files could generalized into one func that accepts the resource type, saving us from a lot of duplicated code, wdyt?
- There's some commented out code that should be just removed in
src/views/favorite-panel/favorite-panel.tsx
and src/views/public-favorites-panel/public-favorites-panel.tsx
- I haven't seen any significant test update/addition that would exercise this now fixed behavior. Do you think it would be convenient to write some integration tests for this?
Just so I'm clear, does this mean you'll be able to order by any column now?
This makes it easier to make any column sortable since every sortable column won't need to be hard coded into getOrder - the type checking is a bonus to help reduce mistakes like trashAt vs trashedAt.
Changes at arvados-workbench2|ab598e2d31f8ec72c602e59c11f9a59e4c860463
Tests developer-tests-workbench2: #1105
- Refactored getOrder helper into data explorer middleware service except for data explorers that need more custom behavior (for example users which needs to add 2 api orders to sort by first+last name combined or data explorers that request multiple types which need to be prefixed)
- Removed comments
- Added cypress test to exercise all the sortable columns on project panel and verify the query contains the correct field name
- Status changed from In Progress to Resolved
Also available in: Atom
PDF