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

Fixes #36469 - Fix Ansible Roles and Variables sub-tabs pagination #678

Closed
wants to merge 9 commits into from

Conversation

Ron-Lavi
Copy link
Member

@Ron-Lavi Ron-Lavi commented Jan 1, 2024

Since there is no easy way to do pagination with Graphql at the moment,
we are using first and last variables in the query.
to make the pagination work on tables where page * per_page > totalCount,
we needed to add the following calculation for the last variable

@nofaralfasi
Copy link
Contributor

nofaralfasi commented Jan 1, 2024

Clicking the "Next" icon on the Roles tab alters the displayed item count when moving between page.

Update:
After adding more variables (16 total), I encountered the same issue in the Variables tab as in the Roles tab.

@Ron-Lavi
Copy link
Member Author

Ron-Lavi commented Jan 2, 2024

@nofaralfasi Hey, can you check again?

@nofaralfasi
Copy link
Contributor

The Variables tab works well.
However, on the Roles tab, if I try to go to the last page, I get No roles assigned directly to the host, instead of the list of the remaining roles.

@nofaralfasi
Copy link
Contributor

Now, both tabs are working well.
One interesting thing that I noticed is that when the number of displayed roles/variables is 5 or fewer, the issue with the disappearing sub-tabs is resolved.

@Ron-Lavi
Copy link
Member Author

Ron-Lavi commented Jan 3, 2024

@nofaralfasi I am having a real difficulty to solve those tests that are failing..
I invested quite some time on trying to fix the tests with no success, I think this implementation relies on updating the URL with pagination search params and that doesn't work well in the test itself, also the mocks are very hardcoded :/
@MariaAga would appreciate some help if you got some time, thanks

@MariaAga
Copy link
Member

MariaAga commented Jan 3, 2024

I have some tests failing also on master branch btw, @Ron-Lavi Can you open a separate pr for those tests?

@Ron-Lavi
Copy link
Member Author

Ron-Lavi commented Jan 10, 2024

for visibility, not sure I will have much time to continue work on this PR soon, in case you want to continue from here..
cc @nofaralfasi @stejskalleos @girijaasoni

@nofaralfasi
Copy link
Contributor

The issue can no longer be reproduced. Therefore, I am closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants