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

Fix selected filter being lost on tab switch #980

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

Conversation

Arnei
Copy link
Member

@Arnei Arnei commented Nov 12, 2024

Fixes #552.

When for example setting a filter for the events table, then switching to the series table and then switching back to the events table, the previously set filter will be lost. This change preserves the filter instead.

When testing this, you may need to clear your browser cache for this to work.

Quick showcase:
Bildschirmaufzeichnung vom 2024-11-12 12-03-42.webm

When for example setting a filter for the events
table, then switching to the series table and then
switching back to the events table, the previously
set filter will be lost. This change preserves the
filter instead.
@Arnei Arnei added the type:bug Something isn't working label Nov 12, 2024
Copy link
Contributor

This pull request is deployed at test.admin-interface.opencast.org/980/2024-11-12_11-05-59/ .
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-980

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-980

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.

@snoesberger
Copy link
Contributor

Thanks for the fix! I have tested it and it works as expected, filters are now persisted when I switch between event and series view.

Copy link
Member

@lkiesow lkiesow left a comment

Choose a reason for hiding this comment

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

Unfortunately, this also breaks the quick filter selection in the admin interface:

opencast-admin-interface-broken-filter-selection.mp4

@Arnei
Copy link
Member Author

Arnei commented Dec 2, 2024

Thanks for catching that.

I am not able to reproduce the bug you found. Do you have futher information? I also tested against develop.opencast.org.
Bildschirmaufzeichnung vom 2024-12-02 16-32-22.webm

@marwyg
Copy link
Member

marwyg commented Jan 9, 2025

I am also not able to reproduce this. I tested the quick filter on a testing server with opencast 16.7. I was also able to use multiple quick filters and the filters from the list. Everything worked es expected.

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-980

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-980

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.

We should also be refetching filters when we open
a new table anyway.
@Arnei Arnei force-pushed the save-selected-filter branch from b7893a2 to 8878c28 Compare January 23, 2025 12:21
Copy link
Contributor

github-actions bot commented Jan 23, 2025

This pull request is deployed at test.admin-interface.opencast.org/980/2025-02-21_10-28-02/ .
It might take a few minutes for it to become available.

Copy link
Contributor

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

Copy link
Contributor

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

@gregorydlogan
Copy link
Member

This doesn't seem to work for me, even after clearing cache and cookies. Looking at the developer console, I see a query to http://localhost/admin-ng/series/series.json?limit=10&offset=0&filter=series:ID-wiki-commons&sort=date:DESC which 400s. Could it be clearing the filter because it's 400-ing?

@Arnei
Copy link
Member Author

Arnei commented Feb 5, 2025

That should not be the cause.

Also, just checked and it still works for me. Do you have more details?

Copy link
Contributor

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

Arnei added a commit to Arnei/opencast-admin-interface that referenced this pull request Feb 17, 2025
Includes opencast#980, supersedes  opencast#1083.

Should achieve the same thing as opencast#1083, but without
reverting to older dependency versions. Meaning
clicking on a series name in the series table
should bring up the events table with the series filter set.
Including opencast#980 as it helps in achieving this.
@owi92
Copy link
Contributor

owi92 commented Feb 17, 2025

This is working for me and the code looks reasonable. When switching from the videos table to series, I also get the error Greg mentioned, but that happens on main as well and has been for a while iirc. Could be the cause of the original error, but I'm not sure.

Also not sure how to proceed here to be honest. It's working for Arne, Martin and me, but Lars and Greg have errors... sooo yeah no clue, sorry for this more or less useless comment.

Arnei added a commit to Arnei/opencast-admin-interface that referenced this pull request Feb 21, 2025
Includes opencast#980, supersedes  opencast#1083.

Should achieve the same thing as opencast#1083, but without
reverting to older dependency versions. Meaning
clicking on a series name in the series table
should bring up the events table with the series filter set.
Including opencast#980 as it helps in achieving this.
The "resource" variable in the table might not be up to date on
page load. Therefore, we pass it to the getFilters method ourselves,
so that api requests immediately use the correct filters.
@geichelberger
Copy link
Contributor

geichelberger commented Feb 26, 2025

I found a problem that I was not able to reproduce on develop.opencast.org, its related to lars comment

presentation-ca627caf-5ed0-48b3-bf9c-c69cf9d8bbcf.mp4

@Arnei
Copy link
Member Author

Arnei commented Feb 26, 2025

I have seen this behaviour on main and am fairly confident that #1121 will fix it.

Copy link
Contributor

@geichelberger geichelberger left a comment

Choose a reason for hiding this comment

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

LGTM, I cannot reproduce the bug @lkiesow mentioned, too.

@geichelberger geichelberger self-assigned this Feb 27, 2025
@geichelberger
Copy link
Contributor

@lkiesow @gregorydlogan I would merge it, and if it introduces bugs, we can fix them later. Any concerns?

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

Successfully merging this pull request may close these issues.

Filters do not persist when I switch between Event and Series views.
7 participants