-
Notifications
You must be signed in to change notification settings - Fork 36
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
Assets UI pagination #1202
base: main
Are you sure you want to change the base?
Assets UI pagination #1202
Conversation
Signed-off-by: joshuaunity <[email protected]>
Signed-off-by: joshuaunity <[email protected]>
I think it is a small new feature :) |
Signed-off-by: joshuaunity <[email protected]>
I see all tests passing!
…On October 3, 2024 1:31:00 PM GMT+02:00, JDev ***@***.***> wrote:
@nhoening @Flix6x do you have any idea what the failed test means? Its not pointing to the part of the code that may have an issue.
--
Reply to this email directly or view it on GitHub:
#1202 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
ok, so I go ahead to add it under features? |
Yes |
Signed-off-by: joshuaunity <[email protected]>
I've added the log 👍 |
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.
It works technically!
Two larger things:
- You have not replaced the expensive server-side part yet:
The previous loading of all the assets (happening backend-side, here, both lines 56 and 57) still happens, so get rid of that please. No need for the CRUD endpoint to return assets
.
- Including public assets
Here is the dilemma I found:
We included public assets (where account_id
is None
) in this table before, and maybe that is why you used all_accessible=true
. Indeed, the asset index API endpoint is not equipped to return assets from an account and the public ones in the same response.
Our options:
- Show two separate tables (for account assets and the public ones). Only the former would be paginated, however, and the second one might also be large.
- Do it like the backend did, and call the asset index twice, for each set separately, then merge the result. However, this doesn't work with pagination.
- Adapt the index endpoint to be able to add public assets separately. We'd add a parameter called
include_public
(defaults toFalse
). Line 161 in the asset API would then happen ifall_accessible is True
or ifinclude_public is True
. Also adapt the docstring, of course.
I propose to do the third option.
P.S. As a user, I'd try to limit the search to PUBLIC assets only, by typing "PUBLIC" in the search box, but that isn't working. Maybe query_assets_by_search_terms()
could accept that special case to then include public assets? It could add another query for public assets in the union_all
if PUBLIC in search_terms
.
Signed-off-by: joshuaunity <[email protected]>
Signed-off-by: joshuaunity <[email protected]>
…ard compatibiity Signed-off-by: joshuaunity <[email protected]>
Description
Added pagination to the asset table under the account detail page
Look & Feel
How to test
Further Improvements
Bug with icons not displaying for assets in all assets tables
Related Items
This PR resolves the issue #1201