Skip to content

Conversation

@dbutenhof
Copy link
Member

PBENCH-1126

With pagination, a client (e.g., the dashboard) can't rely on client-side column sorting. Instead, add generalized sorting to GET /datasets, allowing the returned datasets to be sorted by any column or metadata value, either ascending (default) or descending.

GET /api/v1/datasets?sort=user.dashboard.favorite:desc,dataset.uploaded will return all accessible datasets, sorted first by whether the authenticated user has marked the dataset "favorite" and second by the upload timestamp. (All "favorited" datasets will appear first, in upload order, followed by all "non- favorited" datasets in upload order.)

@dbutenhof dbutenhof added Server Dashboard Of and relating to the Dashboard GUI API Of and relating to application programming interfaces to services and functions labels Apr 7, 2023
@dbutenhof dbutenhof self-assigned this Apr 7, 2023
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great (I'm pleased that it was so easy, although some of the code looks familiar, which makes me wonder if there should be a refactoring somewhere), however, it could use some polishing.

webbnh
webbnh previously approved these changes Apr 10, 2023
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough...unless you still want to change something.... 😉

PBENCH-1126

With pagination, a client (e.g., the dashboard) can't rely on client-side
column sorting. Instead, add generalize sorting to `GET /datasets`, allowing
the returned datasets to be sorted by any column or metadata value, either
ascending (default) or descending.

`GET /api/v1/datasets?sort=user.dashboard.favorite:desc,dataset.uploaded` will
return all accessible datasets, sorted first by whether the authenticated user
has marked the dataset "favorite" and second by the upload timestamp. (All
"favorited" datasets will appear first, in upload order, followed by all "non-
favorited" datasets in upload order.)
Copy link
Member

@webbnh webbnh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@siddardh-ra siddardh-ra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@dbutenhof dbutenhof merged commit 677ae18 into distributed-system-analysis:main Apr 12, 2023
@dbutenhof dbutenhof deleted the sort branch April 12, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Of and relating to application programming interfaces to services and functions Dashboard Of and relating to the Dashboard GUI Server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants