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: Buttons ending with _new or _discover #173

Merged
merged 7 commits into from
Feb 28, 2017

Conversation

vecerek
Copy link

@vecerek vecerek commented Jan 17, 2017

Button classes created:

Toolbar button ids Toolbar button classes created
arbitration_profile_new, cloud_network_new, cloud_tenant_new, condition_new, ab_group_new, ems_cloud_new, ems_container_new, ems_datawarehouse_new, ems_infra_new, ems_middleware_new, host_aggregate_new, host_miq_request_new, host_new, host_miq_request_new, iso_datastore_new, action_new, alert_profile_new, alert_new, old_dialogs_new, policy_new, profile_new, db_new, network_router_new, persistent_volume_new, pxe_image_type_new, pxe_server_new, security_group_new, st_catalog_new, atomic_catalogitem_new, catalogitem_new, storage_manager_new, image_miq_request_new, miq_template_miq_request_new, timeprofile_new, vm_miq_request_new, zone_new, ems_cloud_discover, ems_infra_discover, host_discover ButtonNewDiscover < Basic
dialog_new DialogNew < DialogAction
ems_network_new EmsNetworkNew < EmsNetwork
miq_ae_domain_new MiqAeDefaultNoRecordNew < MiqAeDefault
miq_ae_namespace_new, miq_ae_instance_new, miq_ae_method_new, miq_ae_namespace_new, miq_ae_class_new MiqAeNew < MiqAeDefault
miq_report_new MiqReportNew < MiqReportAction
miq_template_miq_request_new, image_miq_request_new MiqTemplateMiqRequestNew < GenericFeatureButtonWithDisable
ab_group_new, ab_button_new, CatalogItemButtonNew < CatalogItemButton

Button class hierarchy edited:

From To
AbButtonNew < Basic AbButtonNew < ButtonNewDiscover
AuthKeyPairCloudCreate < Basic AuthKeyPairCloudCreate < ButtonNewDiscover
ChargebackRates < Basic ChargebackRates < ButtonNewDiscover
CloudSubnetNew < Basic CloudSubnetNew < ButtonNewDiscover
CloudVolumeNew < Basic CloudVolumeNew < ButtonNewDiscover
InstanceMiqRequestNew < Basic InstanceMiqRequestNew < ButtonNewDiscover
VmMiqRequestNew < Basic VmMiqRequestNew < ButtonNewDiscover
WidgetNew < Basic WidgetNew < ButtonNewDiscover

Links

Parent issue: ManageIQ/manageiq#6259
Related issue: ManageIQ/manageiq#6554
Pivotal Tracker: https://www.pivotaltracker.com/story/show/136441199
Original PR: ManageIQ/manageiq#13281

@miq-bot
Copy link
Member

miq-bot commented Jan 17, 2017

@vecerek Cannot apply the following label because they are not recognized: ui

@miq-bot
Copy link
Member

miq-bot commented Feb 7, 2017

This pull request is not mergeable. Please rebase and repush.

@vecerek
Copy link
Author

vecerek commented Feb 17, 2017

@romanblanco @PanSpagetka could you review, pls?

@vecerek vecerek changed the title [WIP] Toolbar refactoring: Buttons ending with _new or _discover Toolbar refactoring: Buttons ending with _new or _discover Feb 17, 2017
@vecerek
Copy link
Author

vecerek commented Feb 17, 2017

@miq-bot remove_label wip

@miq-bot
Copy link
Member

miq-bot commented Feb 20, 2017

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Feb 20, 2017

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Feb 24, 2017

This pull request is not mergeable. Please rebase and repush.

@romanblanco
Copy link
Member

@vecerek please rebase

Attila Vecerek added 2 commits February 24, 2017 16:05
…e_button?

(cherry picked from commit 7dadbe20d2e35ca6f3eab6b975825457c3f4a999)
(cherry picked from commit fe926f173c46e51847ebd7e5f05f007132dc7764)
@@ -390,7 +386,9 @@ def hide_button?(id)
id !~ /^history_\d*/ &&
!id.starts_with?("dialog_") && !id.starts_with?("miq_task_") &&
Copy link
Member

Choose a reason for hiding this comment

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

@vecerek Shouldn't this be removed with adding DialogNew button?

Copy link
Member

Choose a reason for hiding this comment

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

Nevermind, I think I understand now, (thanks @PanSpagetka)

Copy link
Author

Choose a reason for hiding this comment

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

@romanblanco without this condition, the #hide_button? method would return true for all the dialog buttons thus skipping the call of their #visible? method.

@romanblanco
Copy link
Member

romanblanco commented Feb 27, 2017

@vecerek Seems like your changes are breaking the Automate area:

I'm getting issues by clicking in Automate -> Customization:

[----] F, [2017-02-27T15:38:40.045167 #16311:2ada037320a0] FATAL -- : Error caught: [NoMethodError] undefined method `decorate' for MiqAeNamespaceDecorator:Class
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:18:in `decorate'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_node/miq_ae_namespace.rb:10:in `block in <class:MiqAeNamespace>'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_node/node.rb:37:in `instance_eval'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_node/node.rb:37:in `block (2 levels) in set_attributes'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_node/node.rb:123:in `to_h'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:280:in `x_build_single_node'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:257:in `x_build_node'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:267:in `block in x_build_node'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:266:in `map'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:266:in `x_build_node'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:287:in `x_build_node_tree'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:212:in `block in x_build_tree'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.1/lib/active_record/relation/delegation.rb:38:in `map'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.1/lib/active_record/relation/delegation.rb:38:in `map'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:207:in `x_build_tree'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:142:in `build_tree'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder.rb:26:in `initialize'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/presenters/tree_builder_automate.rb:8:in `initialize'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:468:in `new'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:468:in `build_ae_tree'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/miq_ae_customization_controller.rb:220:in `replace_right_cell'

or

[----] F, [2017-02-27T15:45:57.576122 #22492:2b0b30583f0c] FATAL -- : Error caught: [Draper::UninferrableDecoratorError] Could not infer a decorator for ActiveRecord::Base.
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:81:in `rescue in decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:73:in `decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:78:in `rescue in decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:73:in `decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:78:in `rescue in decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:73:in `decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:23:in `decorator_class'
/home/rblanco/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/draper-3.0.0.pre1/lib/draper/decoratable.rb:18:in `decorate'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:980:in `listicon_image'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:879:in `block in view_to_hash'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:866:in `each'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:866:in `view_to_hash'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/application_controller.rb:1591:in `get_view'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/miq_ae_customization_controller/dialogs.rb:87:in `dialog_list'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/miq_ae_customization_controller/dialogs.rb:1384:in `dialog_get_node_info'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/miq_ae_customization_controller.rb:275:in `get_specific_node_info'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/miq_ae_customization_controller.rb:264:in `get_node_info'
/home/rblanco/devel/manageiq/plugins/manageiq-ui-classic/app/controllers/miq_ae_customization_controller.rb:103:in `accordion_select'

Rebasing didn't help.

Seems to happen after changes in c84f8e1

UPDATE: should be fixed by merging ManageIQ/manageiq#14044.

Copy link
Contributor

@PanSpagetka PanSpagetka left a comment

Choose a reason for hiding this comment

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

Reviewed from action_new to the end in UI, seems to be OK so far, continue tomorrow

Copy link
Contributor

@PanSpagetka PanSpagetka left a comment

Choose a reason for hiding this comment

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

After million years I clicked through this and didn't find anything wrong. So for me, It looks good 👍 @romanblanco ?

Attila Vecerek added 5 commits February 28, 2017 15:09
(cherry picked from commit acbed62f458da898bfb2545d9251d7a4c0c0be16)
(cherry picked from commit 57fc0506911779f1b386821d18a8bd71012ea7e4)
…classes

(cherry picked from commit a5e6ea690bb3163285a4e471640272efd9f37d40)
@miq-bot
Copy link
Member

miq-bot commented Feb 28, 2017

Checked commits vecerek/manageiq-ui-classic@d6817e6~...eb40b66 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
72 files checked, 54 offenses detected

app/helpers/application_helper/toolbar/arbitration_profiles_center.rb

app/helpers/application_helper/toolbar/catalogitem_button_set_center.rb

app/helpers/application_helper/toolbar/catalogitem_buttons_center.rb

app/helpers/application_helper/toolbar/cloud_networks_center.rb

app/helpers/application_helper/toolbar/cloud_tenants_center.rb

app/helpers/application_helper/toolbar/conditions_center.rb

app/helpers/application_helper/toolbar/custom_button_set_center.rb

app/helpers/application_helper/toolbar/dialogs_center.rb

app/helpers/application_helper/toolbar/ems_cloud_center.rb

app/helpers/application_helper/toolbar/ems_clouds_center.rb

app/helpers/application_helper/toolbar/ems_containers_center.rb

app/helpers/application_helper/toolbar/ems_datawarehouses_center.rb

app/helpers/application_helper/toolbar/ems_infras_center.rb

app/helpers/application_helper/toolbar/ems_middlewares_center.rb

app/helpers/application_helper/toolbar/ems_networks_center.rb

app/helpers/application_helper/toolbar/host_aggregates_center.rb

app/helpers/application_helper/toolbar/hosts_center.rb

app/helpers/application_helper/toolbar/iso_datastores_center.rb

app/helpers/application_helper/toolbar/miq_actions_center.rb

app/helpers/application_helper/toolbar/miq_ae_domain_center.rb

app/helpers/application_helper/toolbar/miq_ae_domains_center.rb

app/helpers/application_helper/toolbar/miq_ae_instances_center.rb

app/helpers/application_helper/toolbar/miq_ae_methods_center.rb

app/helpers/application_helper/toolbar/miq_ae_namespace_center.rb

app/helpers/application_helper/toolbar/miq_alert_profiles_center.rb

app/helpers/application_helper/toolbar/miq_alerts_center.rb

app/helpers/application_helper/toolbar/miq_dialogs_center.rb

app/helpers/application_helper/toolbar/miq_policies_center.rb

app/helpers/application_helper/toolbar/miq_policy_profiles_center.rb

app/helpers/application_helper/toolbar/miq_report_center.rb

app/helpers/application_helper/toolbar/miq_reports_center.rb

app/helpers/application_helper/toolbar/miq_widget_sets_center.rb

app/helpers/application_helper/toolbar/persistent_volumes_center.rb

app/helpers/application_helper/toolbar/pxe_image_types_center.rb

app/helpers/application_helper/toolbar/pxe_servers_center.rb

app/helpers/application_helper/toolbar/security_groups_center.rb

app/helpers/application_helper/toolbar/servicetemplatecatalogs_center.rb

app/helpers/application_helper/toolbar/servicetemplates_center.rb

app/helpers/application_helper/toolbar/storage_managers_center.rb

app/helpers/application_helper/toolbar/template_clouds_center.rb

app/helpers/application_helper/toolbar/template_infras_center.rb

app/helpers/application_helper/toolbar/time_profiles_center.rb

app/helpers/application_helper/toolbar/vms_center.rb

app/helpers/application_helper/toolbar/zones_center.rb

@romanblanco
Copy link
Member

@vecerek LGTM now 👍
@miq-bot assign @martinpovolny

@martinpovolny martinpovolny merged commit 62e6568 into ManageIQ:master Feb 28, 2017
@martinpovolny martinpovolny added this to the Sprint 56 Ending Mar 13, 2017 milestone Feb 28, 2017
@vecerek vecerek deleted the miq_pr_13281 branch March 7, 2017 21:32
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.

5 participants