Bug #19988
closedIn project view, when clicking the button to sort by modified_at, it actually sorts by created_at
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.)
Updated by Peter Amstutz almost 2 years ago
- Target version changed from Future to To be scheduled
Updated by Peter Amstutz almost 2 years ago
- Target version changed from To be scheduled to 2023-03-01 sprint
Updated by Stephen Smith almost 2 years ago
- Status changed from New to In Progress
Updated by Stephen Smith almost 2 years ago
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
Updated by Lucas Di Pentima almost 2 years ago
Just a few of comments:
- I think the
getOrder()
utility func atsrc/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
andsrc/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?
Updated by Peter Amstutz almost 2 years ago
Just so I'm clear, does this mean you'll be able to order by any column now?
Updated by Stephen Smith almost 2 years ago
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
Updated by Stephen Smith almost 2 years ago
- Status changed from In Progress to Resolved