-
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 button refactoring server role #11715
Toolbar button refactoring server role #11715
Conversation
@martinpovolny @PanSpagetka I'm not sure it it makes sense to have buttons like this in toolbar. I've checked if there is some way to make the buttons visible in JS, but couldn't find any. So it doesn't seem to me as one of those exceptions, where the button is not visible, but can be enabled by JS. EDIT: I might have been wrong, the buttons seems to be hidden by default, but there are some conditions for them in separate method for Ops. So far I'm marking this PR as WIP. |
45bb9a1
to
0bec807
Compare
0bec807
to
804c4e9
Compare
When you select some node in Diagnostic tree, like Buttons in toolbar seems to be little bit weird, for example when you select |
needs :@record | ||
|
||
def visible? | ||
@record.class == AssignedServerRole && @record.miq_server_started? |
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 just discovered typo here, I'll fix it with other changes, please don't merge yet.
d22722d
to
db69128
Compare
Checked commits romanblanco/manageiq@192bf58~...db69128 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/helpers/application_helper/button/role_suspend.rb
app/helpers/application_helper/button/server_promote.rb
app/helpers/application_helper/toolbar/diagnostics_region_center.rb
app/helpers/application_helper/toolbar/diagnostics_zone_center.rb
spec/helpers/application_helper/buttons/role_start_spec.rb
spec/helpers/application_helper/toolbar_builder_spec.rb
|
07b9e6f
to
71721ca
Compare
74965c4
to
de4d098
Compare
issues fixed. thanks! 👍 |
de4d098
to
a510904
Compare
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
a510904
to
d0ab20d
Compare
Looks good un UI |
70934b5
to
19cc41a
Compare
@martinpovolny PR is updated. Once Travis is green I believe this can be merged |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
`@sb` variable is not called directly in the button class, but needs to be set, because `x_active_tree` and `x_node` are wrappers for the `@sb`.
…er methods Buttons in 'diagnostics_servers_roles' and 'diagnostics_roles_servers' that were converted to separate classes were still getting hide, because in `toolbar_builder.rb` the method `build_toolbar_hide_button_ops` returns `true` for the buttons that are not listed in the case. By setting `false` and listing the buttons that are not converted yet in the case switch, the converted buttons are getting displayed correctly.
19cc41a
to
eadc3fc
Compare
Toolbar buttons for ServerRole class moved from toolbar builder to separate button class
zone_role_start
,zone_role_suspend
RolePowerOptions
role_start
RoleStart < RolePowerOptions
role_suspend
RoleSuspend < RolePowerOptions
zone_promote_server
,zone_demote_server
ServerLevelOptions
promote_server
ServerPromote < ServerLevelOptions
demote_server
ServerDemote < ServerLevelOptions
server_delete
Links
Parent issue: #6259
Related issue: #6554
Pivotal Tracker: https://www.pivotaltracker.com/story/show/126786645