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 button refactoring server role #11715

Conversation

romanblanco
Copy link
Member

@romanblanco romanblanco commented Oct 5, 2016

Toolbar buttons for ServerRole class moved from toolbar builder to separate button class

Toolbar buttons id Toolbar buttons 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

@romanblanco
Copy link
Member Author

romanblanco commented Oct 5, 2016

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

@romanblanco romanblanco changed the title Toolbar button refactoring server role [WIP] Toolbar button refactoring server role Oct 5, 2016
@miq-bot miq-bot added the wip label Oct 5, 2016
@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch 3 times, most recently from 45bb9a1 to 0bec807 Compare October 6, 2016 14:28
@romanblanco romanblanco changed the title [WIP] Toolbar button refactoring server role Toolbar button refactoring server role Oct 6, 2016
@miq-bot miq-bot removed the wip label Oct 6, 2016
@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch from 0bec807 to 804c4e9 Compare October 7, 2016 09:49
@PanSpagetka
Copy link
Contributor

PanSpagetka commented Oct 7, 2016

When you select some node in Diagnostic tree, like Zone and then Region, toolbar stays same for Region and depends on what was selected before.

Buttons in toolbar seems to be little bit weird, for example when you select Zone you can delete one server from this Zone, but this was same before this PR so I guess its right.

needs :@record

def visible?
@record.class == AssignedServerRole && @record.miq_server_started?
Copy link
Member Author

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.

@miq-bot miq-bot added the wip label Oct 7, 2016
@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch 3 times, most recently from d22722d to db69128 Compare October 7, 2016 15:44
@miq-bot
Copy link
Member

miq-bot commented Oct 7, 2016

Checked commits romanblanco/manageiq@192bf58~...db69128 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
12 files checked, 20 offenses detected

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

  • ❗ - Line 52, Col 11 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 71, Col 11 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.
  • ❗ - Line 72, Col 11 - Style/AlignHash - Align the elements of a hash literal if they span more than one line.

spec/helpers/application_helper/toolbar_builder_spec.rb

@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch 2 times, most recently from 07b9e6f to 71721ca Compare October 7, 2016 16:42
@miq-bot miq-bot removed the wip label Oct 7, 2016
@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch from 74965c4 to de4d098 Compare October 10, 2016 09:06
@romanblanco
Copy link
Member Author

@PanSpagetka

When you select some node in Diagnostic tree, like Zone and then Region, toolbar stays same for Region and depends on what was selected before.

issues fixed. thanks! 👍

@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch from de4d098 to a510904 Compare October 10, 2016 11:59
@miq-bot
Copy link
Member

miq-bot commented Oct 10, 2016

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

@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch from a510904 to d0ab20d Compare October 10, 2016 13:07
@PanSpagetka
Copy link
Contributor

Looks good un UI

@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch from 70934b5 to 19cc41a Compare November 2, 2016 16:01
@romanblanco
Copy link
Member Author

@martinpovolny PR is updated. Once Travis is green I believe this can be merged

@miq-bot
Copy link
Member

miq-bot commented Nov 2, 2016

<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.
@romanblanco romanblanco force-pushed the toolbar_button_refactoring_server_role branch from 19cc41a to eadc3fc Compare November 2, 2016 16:26
@martinpovolny martinpovolny merged commit 716e611 into ManageIQ:master Nov 2, 2016
@martinpovolny martinpovolny added this to the Sprint 49 Ending Nov 14, 2016 milestone Nov 2, 2016
@romanblanco romanblanco deleted the toolbar_button_refactoring_server_role branch November 2, 2016 17:27
@romanblanco romanblanco restored the toolbar_button_refactoring_server_role branch November 2, 2016 18:54
@romanblanco romanblanco deleted the toolbar_button_refactoring_server_role branch November 4, 2016 15:51
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