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

host_new>content>errata tab pagination #1152

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

damoore044
Copy link
Contributor

@damoore044 damoore044 commented Jan 12, 2024

Purpose

  • supports robottelo #13767
  • Add new host UI support for reading errata tab pagination.
  • method could be extended to any content>{tab with pagination} in New Host UI page once working.

Solution

-Added new method clear() to SearchInput class (aigun/widgets.py)
-usage in the airgun view like soview.content.errata.searchbar.clear()
-Now using this in apply_erratas() method (entities/host_new.py), to clear the searchbar of any possible value present, when no search passed to apply_erratas(), meaning show and apply all errata with a blank searchbar.
-We also clear the searchbar in apply_erratas() after installing, that way any search value passed does not persist in the searchbar.

Issue, Resolved

  • When reading info from PF4Pagination object in views/host_new.py@362, we get an empty dictionary with no information. Solved
  • When the method apply_erratas(entity, search) is run, it will leave the searchbar filled, and keep it filled until the view is reset.
  • Workaround: Before accessing view.content.errata.pagination, we pass ' ' to searchbar, to display all available errata unfiltered. In case the searchbar was left occupied by a method run previously. I have been looking for a better way or built in method to clear the searchbar /unfilter, before geting pagination.

@damoore044 damoore044 force-pushed the errata-tab-pagination branch from 593616d to 983af33 Compare January 18, 2024 12:09
@damoore044 damoore044 marked this pull request as ready for review January 18, 2024 13:40
Comment on lines 318 to 321
view.content.errata.select()
# pass empty search to show any and all,
# if a previous method left the searchbar filled
view.content.errata.searchbar.fill(' ')

Choose a reason for hiding this comment

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

Please correct this. We won't be applying the ' ' string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we made a new method to clear the SearchInput searchbar (widgets.py), which was unintentionally left occupied by search value passed to apply_erratas method (host_new.py).
Now, we clear the searchbar after selecting and applying erratas by search, so that the passed search does not persist.

Copy link
Contributor

@sambible sambible left a comment

Choose a reason for hiding this comment

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

Pending @omkarkhatavkar comments

@damoore044 damoore044 force-pushed the errata-tab-pagination branch 2 times, most recently from c85c011 to 95dd963 Compare January 23, 2024 18:15
@damoore044 damoore044 requested review from omkarkhatavkar and a team January 24, 2024 19:52
@omkarkhatavkar
Copy link

@damoore044 looks good can you take a look at pre-commit failures?

Copy link
Contributor

@vsedmik vsedmik left a comment

Choose a reason for hiding this comment

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

Looks good, just fix the CI/CQ

airgun/widgets.py Show resolved Hide resolved
@damoore044 damoore044 force-pushed the errata-tab-pagination branch 2 times, most recently from 1bf49f2 to a4339e6 Compare January 25, 2024 19:11
@damoore044 damoore044 force-pushed the errata-tab-pagination branch 2 times, most recently from 6c4ad18 to 4aae50c Compare January 25, 2024 21:43
@damoore044 damoore044 requested a review from vsedmik January 25, 2024 21:44
Click button to clear searchbar

docstring fix
@damoore044 damoore044 force-pushed the errata-tab-pagination branch from 4aae50c to 9aac65b Compare January 26, 2024 12:22
@vsedmik vsedmik merged commit 5b0ca76 into SatelliteQE:master Jan 26, 2024
5 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 26, 2024
Click button to clear searchbar

docstring fix

(cherry picked from commit 5b0ca76)
sambible pushed a commit that referenced this pull request Jan 26, 2024
Click button to clear searchbar

docstring fix

(cherry picked from commit 5b0ca76)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z CherryPick PR needs CherryPick to previous branches Stream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants