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

Toolbar refactoring miq server and region #11879

Conversation

vecerek
Copy link

@vecerek vecerek commented Oct 12, 2016

@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.

Toolbar buttons id Action taken or Toolbar buttons class created
refresh_workers RefreshWorkers < Basic
log_download deleted
refresh_logs deleted
log_collect deleted
log_reload deleted
logdepot_edit deleted
processmanager_restart deleted

Links

Parent issue: #6259
Related issue: #6554
Pivotal Tracker: https://www.pivotaltracker.com/story/show/126784961

Copy link
Member

@romanblanco romanblanco left a 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
Copy link
Member

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
Copy link
Member

@martinpovolny martinpovolny Oct 13, 2016

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|
Copy link
Member

Choose a reason for hiding this comment

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

%w(...)?

Copy link
Author

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?

@martinpovolny
Copy link
Member

@romanblanco, @PanSpagetka : pls, review and test

@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from 9547bbf to 3f23825 Compare October 13, 2016 10:08
@romanblanco
Copy link
Member

@vecerek please rebase.

@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from 3f23825 to 840d91f Compare October 17, 2016 13:30
@vecerek
Copy link
Author

vecerek commented Oct 18, 2016

@romanblanco @martinpovolny the tests that failed on Travis are passing locally

@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from b35d5a7 to 8888534 Compare October 18, 2016 11:30
@romanblanco
Copy link
Member

romanblanco commented Oct 18, 2016

@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:
Configuration (Ops) -> Diagnostics -> Select server -> Workers tab, but it doesn't seem so

@vecerek
Copy link
Author

vecerek commented Oct 20, 2016

@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.

@romanblanco
Copy link
Member

romanblanco commented Oct 20, 2016

@vecerek

@romanblanco just deleted the misplaced comment, thanks

No problem 👍 ☺️

About the converted button refresh_workers, do you know, how to get to the button in UI? I wasn't able to find it.

@vecerek
Copy link
Author

vecerek commented Oct 20, 2016

@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 @record's class is being evaluated over here. What do you think?

@romanblanco
Copy link
Member

@vecerek I've found another occurrence of refresh_workers button here. This might be also the reason why it's getting hidden.

Can you remove all existing occurrences, so we can make sure the behaviour is not influenced from more places?

@miq-bot
Copy link
Member

miq-bot commented Oct 20, 2016

<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush.

@vecerek
Copy link
Author

vecerek commented Oct 21, 2016

@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.

refresh_workers

@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch 2 times, most recently from bc81627 to cd42461 Compare October 21, 2016 18:39
@vecerek
Copy link
Author

vecerek commented Oct 21, 2016

@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.

@vecerek vecerek changed the title Toolbar refactoring miq server and region [WIP] Toolbar refactoring miq server and region Oct 24, 2016
@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from 59a5a62 to 1297896 Compare October 24, 2016 09:39
@vecerek vecerek changed the title [WIP] Toolbar refactoring miq server and region Toolbar refactoring miq server and region Oct 24, 2016
@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from 1297896 to f56ea33 Compare October 24, 2016 16:57
@vecerek
Copy link
Author

vecerek commented Oct 24, 2016

@romanblanco
"Oops, Travis did it again
He played with my code, got lost in the game
Oh baby, baby..."

Tests do pass locally and I do have the latest changes applied from master. Checked twice 😄 What could have gone wrong?

Copy link

@jzigmund jzigmund left a 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

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

Copy link
Author

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.

@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from f56ea33 to 59b6d12 Compare October 26, 2016 18:31
@vecerek vecerek force-pushed the toolbar_refactoring__miq_server_and_region branch from 59b6d12 to 2797d55 Compare October 27, 2016 14:12
@miq-bot
Copy link
Member

miq-bot commented Oct 27, 2016

Checked commits vecerek/manageiq@e6515c0~...2797d55 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
5 files checked, 0 offenses detected
Everything looks good. 🏆

@vecerek
Copy link
Author

vecerek commented Nov 2, 2016

@romanblanco Travis finally likes my PR! 😄 Could you do a review, pls?

Copy link

@jzigmund jzigmund 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 to me. @martinpovolny please review or/and merge

@martinpovolny martinpovolny added this to the Sprint 49 Ending Nov 14, 2016 milestone Nov 2, 2016
@martinpovolny martinpovolny merged commit af903bf into ManageIQ:master Nov 2, 2016
@vecerek vecerek deleted the toolbar_refactoring__miq_server_and_region branch November 2, 2016 17:08
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.

6 participants