Project

General

Profile

Actions

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 about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench2
Target version:
Story points:
0.5
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.)


Subtasks 1 (0 open1 closed)

Task #20109: Review 19988-data-explorer-sortingResolvedLucas Di Pentima02/23/2023Actions
Actions #1

Updated by Peter Amstutz about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz about 1 year ago

  • Story points set to 0.5
Actions #3

Updated by Peter Amstutz about 1 year ago

  • Target version changed from Future to To be scheduled
Actions #4

Updated by Peter Amstutz about 1 year ago

  • Target version changed from To be scheduled to 2023-03-01 sprint
Actions #5

Updated by Peter Amstutz about 1 year ago

  • Release set to 57
Actions #6

Updated by Peter Amstutz about 1 year ago

  • Assigned To set to Stephen Smith
Actions #7

Updated by Stephen Smith about 1 year ago

  • Status changed from New to In Progress
Actions #8

Updated by Stephen Smith about 1 year 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
Actions #9

Updated by Lucas Di Pentima about 1 year ago

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?
Actions #10

Updated by Peter Amstutz about 1 year ago

Just so I'm clear, does this mean you'll be able to order by any column now?

Actions #11

Updated by Stephen Smith about 1 year 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
Actions #12

Updated by Lucas Di Pentima about 1 year ago

This LGTM, thanks!

Actions #13

Updated by Stephen Smith about 1 year ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF