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

TreeBuilderAlertProfile - use class decorators for MiqAlert base_tables icons #3382

Merged
merged 1 commit into from
Feb 7, 2018
Merged

TreeBuilderAlertProfile - use class decorators for MiqAlert base_tables icons #3382

merged 1 commit into from
Feb 7, 2018

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Feb 7, 2018

this fixes missing ContainerProject entry in the switch
by removing the switch, since all those entities have class decorators with the same fonticon
(except for middleware, which is gone).

Cc @epwinchell

…es icons

this fixes missing ContainerProject entry in the switch
by removing the switch, since all those entities have class decorators with the same fonticon
(except for middleware, which is gone)
@himdel
Copy link
Contributor Author

himdel commented Feb 7, 2018

These are the failures...

Failures:
  1) MiqPolicyController#explorer when profile param present, but non-existent renders explorer with flash message
     Failure/Error: expect(response).to render_template('explorer')
       expecting <"explorer"> but rendering with <["layouts/exception", "layouts/application"]>
     # ./spec/controllers/miq_policy_controller_spec.rb:152:in `block (4 levels) in <top (required)>'
  2) MiqPolicyController#explorer when profile param not present renders explorer w/o flash message
     Failure/Error: expect(response).to render_template('explorer')
       expecting <"explorer"> but rendering with <["layouts/exception", "layouts/application"]>
     # ./spec/controllers/miq_policy_controller_spec.rb:161:in `block (4 levels) in <top (required)>'
  3) MiqPolicyController#explorer when profile param is valid renders explorer w/o flash and assigns to x_node
     Failure/Error: expect(response).to render_template('explorer')
       expecting <"explorer"> but rendering with <["layouts/exception", "layouts/application"]>
     # ./spec/controllers/miq_policy_controller_spec.rb:172:in `block (4 levels) in <top (required)>'
  4) MiqPolicyController#replace_right_cell should change header
     Failure/Error: {:id => db, :text => text, :tip => text}.merge(graphic)
     TypeError:
       no implicit conversion of nil into Hash
     # ./app/presenters/tree_builder_alert_profile.rb:51:in `merge'
     # ./app/presenters/tree_builder_alert_profile.rb:51:in `block in x_get_tree_roots'
     # ./app/presenters/tree_builder_alert_profile.rb:29:in `map'
     # ./app/presenters/tree_builder_alert_profile.rb:29:in `x_get_tree_roots'
     # ./app/presenters/tree_builder.rb:240:in `x_get_tree_objects'
     # ./app/presenters/tree_builder.rb:207:in `x_build_tree'
     # ./app/presenters/tree_builder.rb:141:in `build_tree'
     # ./app/presenters/tree_builder.rb:24:in `initialize'
     # ./app/controllers/application_controller/feature.rb:28:in `new'
     # ./app/controllers/application_controller/feature.rb:28:in `build_tree'
     # ./app/controllers/miq_policy_controller.rb:491:in `block in replace_right_cell'
     # ./app/controllers/miq_policy_controller.rb:485:in `each'
     # ./app/controllers/miq_policy_controller.rb:485:in `replace_right_cell'
     # ./spec/controllers/miq_policy_controller_spec.rb:231:in `block (3 levels) in <top (required)>'

(all 4 are the same if you add bypass_rescue).

Caused by https://github.com/ManageIQ/manageiq/pull/16903/files#diff-5207b5487aa39adaa85b87eb193abb35R29

@himdel
Copy link
Contributor Author

himdel commented Feb 7, 2018

MiqAlert.base_tables.each_with_object({}) { |db, o| o[db] = db.constantize.decorate.fonticon }

{
  "Vm"=>"pficon pficon-virtual-machine",
  "Host"=>"pficon pficon-screen",
  "Storage"=>"fa fa-database",
  "EmsCluster"=>"pficon pficon-cluster",
  "ExtManagementSystem"=>"pficon pficon-server",
  "MiqServer"=>"pficon pficon-server",
  "ContainerNode"=>"pficon pficon-container-node",
  "ContainerProject"=>"pficon pficon-project"
}

(MiddlewareServer won't crash but "pficon pficon-middleware" is not the wildfly icon.)

@miq-bot
Copy link
Member

miq-bot commented Feb 7, 2018

Checked commit https://github.com/himdel/manageiq-ui-classic/commit/2914b3b25ea7fc687c107f7858e57af281fa222e with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@mzazrivec mzazrivec added the trees label Feb 7, 2018
@mzazrivec mzazrivec added this to the Sprint 79 Ending Feb 12, 2018 milestone Feb 7, 2018
@mzazrivec mzazrivec merged commit f96729e into ManageIQ:master Feb 7, 2018
@himdel himdel deleted the fix-alert-base-class branch February 7, 2018 12:15
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.

3 participants