-
Notifications
You must be signed in to change notification settings - Fork 64
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 sort order and pagination of the process and search result list #5358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomaslow Thanks for the pull request. Great that there was a dedicated attribute for PrimeFaces datatables to facilitate this functionality.
Just two little remarks/questions:
- with the current implementation, the view state of the process list is kept, no matter from where the user comes. I think it would be preferable to only retain the sorting and pagination of the list when the user returns to it from some page which is located "deeper" (e.g. corresponding to the breadcrumb depth) than the list, e.g. the "Process edit" and "Metadata editor" pages. In all other cases - when the user navigates to the process list from 1) main menu "Processes" option, 2) desktop "All processes" button and 3) the breadcrumb "Processes" link - the view state should be reset to a default sorting and pagination. Perhaps this could be achieved by saving and updating the
multiViewState
value to a bean property instead of setting it to a statictrue
? - Kitodo already contains a makeshift way to at least store the pagination of a list when returning to if from another page. This utilizes a custom URL parameter called
keepPagination
(see BaseForm line 71 and - for example - the command link to open the metadata editor in ProcessList line 163). To avoid potential confusion and functional conflicts, I would suggest to remove at least those usages of thekeepPagination
parameter that correspond to the search result or process lists in this pull request.
@solth I understand what you are saying. Personally, I'm also not a fan of keeping the state of the process list alive over the whole session. I certainly can add code that resets the For example, suppose there is a user that:
In the long run, in my opinion, the more user-friendly way would be to implement a classic URL routing mechanism that includes state information in the URL (e.g. |
Yes, it could become quite confusing if the view state of the datatable component was reset everytime the user moved away from the process list to some different page - and it would nullify or at least diminish the advantages of this pull request, I think. But that is not what I was suggesting. Instead, my idea was to only reset the view state when the user explicitly uses one of the three main entry points listed above - main menu, desktop link, breadcrumb - to navigate towards the process list. For example, this could be done using a corresponding "reset" I agree that we should eventually have parameters to control sorting, pagination and filtering ( |
…k. Remove keepPagination url parameter for processes page.
@solth When clicking on the dashboard
clicking on
Clicking the I also removed the |
I understand your reasoning but I think the |
Removed the state-resetting from the breadcrumb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and works as advertised! Found just one tiny part which might be improved (see comment in code with change suggestion). Otherwise, I have no further change requests for this PR!
Kitodo/src/main/java/org/kitodo/production/forms/ProcessForm.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Arved Solth <[email protected]>
Related Issues:
This push request enables the option "multiViewState" for the process list and search result list. It preserves the state of the pagination and column sorting in the current session (while visiting other pages).
Process List Demo:
simplescreenrecorder-2022-09-21_12.21.45.mp4
The same is enabled for the search result list. However, the state is reset (page=1, ordering=default) for each new search request (in order to show the results in their default ordering by relevance).
Search Result Demo:
simplescreenrecorder-2022-09-21_12.36.34.mp4