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

Filter indices in bukuserver aren't assigned correctly when modifying filter types (thus changing their order in UI) #624

Closed
LeXofLeviafan opened this issue Nov 28, 2022 · 2 comments · Fixed by #778

Comments

@LeXofLeviafan
Copy link
Collaborator

According to this StackOverflow response (supported by a direct link to the filters parsing code in flask_admin sources):

image


Meanwhile, in bukuserver these indices are assigned incorrectly (not based on filter row position) when modifying filter types (i.e. by adding/selecting in dropdown).

For example…

For the following filters (indices are reassigned when resubmitting the form/changing the page/etc.)…
image
Changing the type of the first filter to "tags: not contain" (via the dropdown) resulted in the filter index being set to 4, which immediately resulted in the following layout:
image
And of course, when the filters are resubmitted (after hitting Enter in a filter field, or clicking on a page link in the pagination panel), the parameters list gets reordered according to indices, and the indices are recalculated to match their resulting positions:
image


…Considering that the entire point of these indices is to retain the filter ordering (or modify it if needed), the index assigned when changing filter subtype via dropdown should be retained from the previous value, and when a filter is added its index should be based on its position (amount of filter rows at the moment of appending the new one).

@LeXofLeviafan
Copy link
Collaborator Author

…After some checking, it turns out to be the current behaviour of flask-admin.
I've created a ticket in respective repo to find out if this is indeed a bug or actual intended behaviour; depending on its resolution, this issue can be either cancelled (tentatively) or fixed by updating dependency version once a fix is released.

@jarun
Copy link
Owner

jarun commented Dec 1, 2022

Thanks for checking!

LeXofLeviafan added a commit to LeXofLeviafan/buku that referenced this issue Sep 6, 2024
LeXofLeviafan added a commit to LeXofLeviafan/buku that referenced this issue Sep 6, 2024
LeXofLeviafan added a commit to LeXofLeviafan/buku that referenced this issue Sep 6, 2024
LeXofLeviafan added a commit to LeXofLeviafan/buku that referenced this issue Sep 7, 2024
@jarun jarun closed this as completed in #778 Sep 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants