-
Notifications
You must be signed in to change notification settings - Fork 356
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
Advanced search modal - only render once, always, hidden #5629
Conversation
|
@miq-bot remove_label wip This could affect any advanced search - please don't only test vm infra :). |
@himdel : please rebase. I'll test and merge. |
to prevent multiple copies of the modal from floating around, the footer is always rendered in application layout
…er} divs we replace those divs' content when doing ajax transitions, so they have to be present unconditionally they don't have to have anything inside though Also, a bunch of url_for calls need to only happen under that condition, so moved too. (Not all controllers have a `adv_search_load_choice` route for example.) (also fixes random missing gettext around Close) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1712872
Rebased, thanks :) |
always use this function to replace adv_searchbox_div overriden in some controllers for extra gtl bits moved the nameonly params to the function caller no functional changes yet
now that the adv_search partial is not included from x_adv_searchbox, we need to replace it separately, each time searchbox would have been replaced
…on when needed the body and footer now have a conditional inside the main div, moved from the _adv_search partial, to make sure the divs are always rendered but all the places rendering the body and footer directly (via ajax) didn't previously need the condition to be true, and it isn't so, adding a force=true param to any place which just replaces the body and footer of advanced search, without goingh through the top partial
…anges we also need to expect an layouts/adv_search render, now that the modal is not part of x_adv_searchbox
Checked commits https://github.com/himdel/manageiq-ui-classic/compare/348f1fb78d3bb24f73785ad606312a5216020939~...3800fd9f4871980fad86882139a39ea66c8b1ada with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Good job! |
Advanced search modal - only render once, always, hidden (cherry picked from commit f8d7131) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1717923
Hammer backport details:
|
Currently the advanced search modal (
layouts/_adv_search
) is rendered twice on most screens:layouts/_footer
, unconditionally called from application layoutlayouts/_x_adv_searchbox
called from explorer controller explorer viewslayouts/_searchbar
called from thecenter_div_with_listnav
layoutAnd the inside of the modal contains logic asking for
show_adv_search?
and@edit[@expkey]
,to deteremine whether to render the inside of the modal too.
But, all the ajax transition logic assumes the modal is always there, hidden, and tries to replace the inner divs' content (
#adv_search_body
,#adv_search_footer
), failing when missing.So.. this PR:
x_adv_searchbox
replaces to also replace the modal divsadv_search_body
andadv_search_footer
replaces to ignore the condition moved inside those templates when rendered standaloneTesting:
Before: the modal won't appear
After: the modal will appear
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1712872