Skip to content

Adding goToPage(0) to Filters from within the Table and the Stats Bar #1266

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ciegler
Copy link

@ciegler ciegler commented May 14, 2025

As described in Issue #1089 when filtering the Event Table via the addFilter functionality of the links within the table or the stats bar the offset was not reset, leading to an empty table. This filter functionality is available for:

  • series names
  • locations
  • presenter
  • date
  • all field in the stats bar

This PR fixes the bug by making sure that before fetching the Events with the Filter the UI returns to the first page of the table and thereby resetting the offset to 0. The same behavior was already implemented for filtering the table via the Filter Bar.

How to test:

  • go to the last page of the table (or at least not page 1)
  • click on a link/field for filtering the table (one of the fields named above)

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

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

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.

@ciegler ciegler added the type:bug Something isn't working label May 14, 2025
Copy link
Contributor

This pull request is deployed at test.admin-interface.opencast.org/1266/2025-05-14_08-32-25/ .
It might take a few minutes for it to become available.

@Piriya-VM Piriya-VM self-requested a review May 14, 2025 08:35
Copy link
Contributor

@luniki luniki left a comment

Choose a reason for hiding this comment

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

Please fix the indentation issues. Otherwise the code is fine and it works as described.

Comment on lines +28 to 29
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: presenter}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the indentation:

Suggested change
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: presenter}));
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: presenter}));

Comment on lines +26 to 27
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: seriesId}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix indentation:

Suggested change
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: seriesId}));
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: seriesId}));

Comment on lines +29 to 30
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: date + "/" + date}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix indentation:

Suggested change
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: date + "/" + date}));
dispatch(goToPage(0));
await dispatch(editFilterValue({filterName: filter.name, value: date + "/" + date}));

Comment on lines +41 to 42
dispatch(goToPage(0));
dispatch(editFilterValue({filterName: filter.name, value: filterValue}));
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix indentation:

Suggested change
dispatch(goToPage(0));
dispatch(editFilterValue({filterName: filter.name, value: filterValue}));
dispatch(goToPage(0));
dispatch(editFilterValue({filterName: filter.name, value: filterValue}));

@Arnei
Copy link
Member

Arnei commented May 14, 2025

Impressive review speed luniki :o

@Piriya-VM
Copy link
Contributor

Sooo I tested

  • series names
  • presenter
  • date
  • all field in the stats bar

and it works like expected. :)

I only have one issue. When I choose a filter, a small temporary table shows up first, and then the filtered table is shown.
zwischentabelle.webm

I know the ETH had the same issue and @Arnei fixed it? 🤔

@Arnei
Copy link
Member

Arnei commented May 14, 2025

I only have one issue. When I choose a filter, a small temporary table shows up first, and then the filtered table is shown.
zwischentabelle.webm

I know the ETH had the same issue and @Arnei fixed it? 🤔

Maybe related to #1231.

@ferishili
Copy link
Contributor

Please note that I have fixed this in other PR introducing a more comprehensive solution, namely with debounce & co.
#1258

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.

5 participants