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

Remember table sorting #1009

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

Arnei
Copy link
Member

@Arnei Arnei commented Dec 12, 2024

Tables can be sorted by columns, ascending or descending. However, when switching to a different tab and back again, the sorting reverts to the default. With this change, the sorting is remembered.

Does not persist the sorting, meaning it still reverts to the default after a page reload. I did not do this because the only to way to get rid of persisted sorting would be to the clear the browsers cache, and I did not want alienate people.

Also sneakily changes the default sorting of the series table in the same way as #1008.

How to test this

PR can be tested as is, no other dependencies or configuration necessary.

Bildschirmaufzeichnung.vom.2024-12-12.11-44-03.webm

Tables can be sorted by columns, ascending or
descending. However, when switching to a
different tab and back again, the sorting reverts
to the default. With this change, the sorting is
remembered.

Does not persist the sorting, meaning it still
reverts to the default after a page reload.
I did not do this because the only to way to
get rid of persisted sorting would be to the
clear the browsers cache, and I did not want
alienate people.

Also sneakily changes the default sorting
of the series table in the same way as opencast#1008.
@Arnei Arnei added the type:usability Improves the UX label Dec 12, 2024
Copy link
Contributor

github-actions bot commented Dec 12, 2024

This pull request is deployed at test.admin-interface.opencast.org/1009/2025-02-18_08-23-43/ .
It might take a few minutes for it to become available.

Copy link
Contributor

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-1009

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/opencast-admin-interface:pr-1009

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

Copy link
Member

@gregorydlogan gregorydlogan left a comment

Choose a reason for hiding this comment

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

This appears to be causing the following exception every time the page is started (eg F5, or a fresh navigation).

2025-01-16 17:00:51,271 | WARN  | (WebApplicationExceptionMapper:73) - javax.ws.rs.WebApplicationException: HTTP 400 Bad Request                                                                                                
        at org.opencastproject.index.service.util.RestUtils.parseSortQueryParameter(RestUtils.java:233)                                                                                                                         
        at org.opencastproject.adminui.endpoint.AbstractEventEndpoint.getEvents(AbstractEventEndpoint.java:2668).
...

Note that it doesn't continually do this with the normal content requests, just the first-boot. Seems to work just fine, just an ugly trace in the logs.

Not only do we not want the empty string, we in
fact don't want any falsy values.
Copy link
Contributor

@owi92 owi92 left a comment

Choose a reason for hiding this comment

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

Can confirm that this is working. @gregorydlogan did you want to take another look at the thing you commented on? Otherwise I'd say it can get merged.

Copy link
Contributor

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:usability Improves the UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants