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
Allow editing and other actions on selected Host Aggregate #6267
Allow editing and other actions on selected Host Aggregate #6267
Conversation
@miq-bot add_label bug |
e0962f3
to
5641b4c
Compare
683af15
to
37185db
Compare
Also add spec for proper redirecting for editing selected Host Aggregate.
37185db
to
631f2bf
Compare
Checked commits hstastna/manageiq-ui-classic@0af0514~...631f2bf with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
This looks good to me codewise. Can you ask someone to test it in detail in the UI (I do not have much time until the next Monday). @h-kataria, @ZitaNemeckova, @mzazrivec, any other volunteers? |
I dont' have working Provider so all actions end with Error message @hstastna It looks really good 👍 I'm not sure about those two 👆 redirects to "wrong" page. Maybe it should be a followup PR. WDYT? |
@ZitaNemeckova Thanks very moch for testing. That's another issue (what's going on after clicking on Cancel button vs. what's going on after success), and I've seen it also in other screens (other than Hosts or Host Aggregates). I think that it can be fixed via another PR. Maybe I should also open a separate issue for it. What do you think? :) |
@hstastna Sounds good to me :) @martinpovolny Tested in UI. LGTM 👍 |
Issue: #6227
Various errors occurred after displaying Host Aggregates from Relationships table of a Cloud Provider and providing selected actions on a selected Host Aggregate. Only tagging and Download worked for selected Host Aggregates. The same problems occurred for actions of Host Aggregates displayed in a list directly thru Compute > Clouds > Host Aggregates and also actions provided from details page of a Host Aggregate. This PR fixes errors and allows us to provide selected actions.
Editing Host Aggregate:
The DoubleRenderError regarding editing a Host Aggregate was fixed by removing an extra unnecessary code here (because we already call
javascript_redirect
with same parameters here) and addingunless performed?
here. But that was not enough, we also had to prevent calling unnecessaryshow
method.Adding Host to Host Aggregate:
This action did not work because of calling
javascript_redirect
here andshow
method here. After solving this problem, I also had to specify the name of the controller for redirecting and settingid
properly, too, to make it work.Removing Host from Host Aggregate:
Similarly as for adding Host to Host Aggregate.
Deleting Host Aggregate:
I've refactored
delete_host_aggregates
little bit, in host_aggregate controller. I've usedchecked_or_params
here which works well, no matter ifparams[:pressed]
orparams[:miq_grid_checks]
is set.I've also had to solve calling
show_list
and displaying the list of Host Aggregates after deleting the selected ones. This is solved here.For displaying flash message about deleting Host Aggregates, I had to call
flash_to_session
here. These changes work well for Host Aggregates displayed also in a nested list or also for individual Host Aggregates (while displaying details page of a Host Aggregate). I've also removed some unnecessary code asadd_flash
was already called earlier.But how do we call
delete_host_aggregates
properly? I had to make another change to solve this (also with solving calling unnecessaryshow
method here). And finally, I've addeddelete_host_aggregates
to routes. The reasons for this change, are, hopefully, obvious.Also note that, originally,
delete_host_aggregates
method was in the same file as thebutton
method, which is now in ems_common.rb (see ManageIQ/manageiq#11980).I've also refactored the specs little bit.
After: