Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - Can't sort table #280

Open
ajpanton opened this issue Dec 16, 2024 · 3 comments
Open

[BUG] - Can't sort table #280

ajpanton opened this issue Dec 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ajpanton
Copy link

ajpanton commented Dec 16, 2024

Describe the bug
When viewing a table (Postgres), I can click on the column headers, which kind of sorts the items, but only whatever is visible on that page of (by default) 100 rows. There doesn't seem to be a way to sort the whole table.

To Reproduce
Steps to reproduce the behavior:

  1. Open a Postgres table with multiple pages of rows.
  2. Try to sort by a column. It will sort, but only the visible rows on the page.
  3. Change page. It appears to randomly keep the items sorted, but only one way.

Expected behavior
Being able to sort them whichever way we want, and to sort the whole table.

Desktop (please complete the following information):

  • OS: Which one is being asked here? My desktop is running Windows, but WhoDB is in a Docker container on a server running Linux.
  • Browser: Firefox
  • Version: Windows? 10. WhoDB? I can't find it anywhere. "image: clidey/whodb:latest" when this post was made.
@ajpanton ajpanton added the bug Something isn't working label Dec 16, 2024
@hkdeman
Copy link
Contributor

hkdeman commented Dec 19, 2024

Hello! Thank you for pointing out the bug. Love the detailing!

Definitely an improvement from our end. We will update this thread as soon as we have a PR for it!

@HarshDodiya1
Copy link
Contributor

Can anyone please guide me through this issue, I would like to work on this and require a point to start with.

@hkdeman
Copy link
Contributor

hkdeman commented Dec 23, 2024

@HarshDodiya1 thanks for picking this issue!

We currently only support sorting in frontend (this was done for smaller tables - dev - majorly). To achieve sorting at a query level, you would need to send the sortBy column name to the GraphQL query made. This way you will ensure that the entire data received is sorted in the correct order.

You would have to make changes to this "useGetStorageUnitRowsLazyQuery" (like we have where, pageSize, and pageOffset - you would need sortBy).

Similarly, add this capability to the backend in all the plugins for all the databases (as we need to sort across the board).

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants