-
Notifications
You must be signed in to change notification settings - Fork 898
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
Toolbar refactoring miq server and region #11879
Toolbar refactoring miq server and region #11879
Conversation
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.
@vecerek please remove the empty files:
app/helpers/application_helper/button/configured_system_provision.rb
spec/helpers/application_helper/buttons/configured_system_provision_spec.rb
def visible? | ||
@record.provisionable? | ||
end | ||
end |
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.
pls, fix you editor setting so add the newline here
it_behaves_like 'will not be skipped for this record' | ||
end | ||
end | ||
end |
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.
and here....
@@ -759,8 +759,7 @@ def method_missing(sym, *args) | |||
stub_user(:features => :all) | |||
end | |||
|
|||
["role_start", "role_suspend", "promote_server", "demote_server", | |||
"log_download", "refresh_logs", "log_collect", "log_reload", "logdepot_edit", "processmanager_restart", "refresh_workers"].each do |id| | |||
["role_start", "role_suspend", "promote_server", "demote_server"].each do |id| |
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.
%w(...)
?
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.
The usage with brackets is seen throughout the whole spec file. It may rather be changed globally using sed. Should it be done as a new branch for standardization?
@romanblanco, @PanSpagetka : pls, review and test |
9547bbf
to
3f23825
Compare
@vecerek please rebase. |
3f23825
to
840d91f
Compare
@romanblanco @martinpovolny the tests that failed on Travis are passing locally |
b35d5a7
to
8888534
Compare
@vecerek Are you sure that your comment belongs to this PR? It seems to me that it belongs to #11982, doesn't it? @martinpovolny code looks fine, but I can't find the button in UI. I'd expect it to be in: |
@romanblanco just deleted the misplaced comment, thanks @martinpovolny @dclarizio could I ask for another restart of Travis, please? This time, the failed tests were different. However, they have passed locally, too. |
No problem 👍 About the converted button |
@romanblanco I think I might know why it does not get displayed over there. The refresh_workers button gets hidden on miq server and region items in the diagnostic tree. The |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@romanblanco it is the reload button left to the configuration. We couldn't find it anywhere, since my local master branch was not up-to-date. |
bc81627
to
cd42461
Compare
@romanblanco I had to put back the refresh_workers into #build_toolbar_hide_button_ops. The missing refresh_workers array item had caused the method to return true and hide the button before the button's #visible? method would have got executed. Those failing 12 examples on Travis are finally not passing locally. However they do fail on master, as well. |
59a5a62
to
1297896
Compare
1297896
to
f56ea33
Compare
@romanblanco Tests do pass locally and I do have the latest changes applied from master. Checked twice 😄 What could have gone wrong? |
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.
Please edit the tests according to the simplified button class
@@ -0,0 +1,23 @@ | |||
class ApplicationHelper::Button::RefreshWorkers < ApplicationHelper::Button::Basic |
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.
I've found that sufficient for the refresh_workers
button is
class ApplicationHelper::Button::RefreshWorkers < ApplicationHelper::Button::Basic
needs :@record, :@sb
def visible?
@view_context.x_active_tree == :diagnostics_tree && @sb[:active_tab] == 'diagnostics_workers'
end
end
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.
Thanks, you're right. I included your suggestion into my last commit.
f56ea33
to
59b6d12
Compare
…ples from toolbar_builder_spec
…end the #visible? method by additional cases and add new spec examples accordingly
… to make the button visible again
… miq_server or miq_region only if layout != ops and tailors the spec file accordingly
59b6d12
to
2797d55
Compare
Checked commits vecerek/manageiq@e6515c0~...2797d55 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@romanblanco Travis finally likes my PR! 😄 Could you do a review, pls? |
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.
Looks good to me. @martinpovolny please review or/and merge
@romanblanco @PanSpagetka @martinpovolny
Removed the appearances of unused buttons including from within the specs and created a button class for refresh_workers button for its use outside the toolbar_builder method.
Links
Parent issue: #6259
Related issue: #6554
Pivotal Tracker: https://www.pivotaltracker.com/story/show/126784961