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

Fix error on Cloud Provider Dashboard #6198

Merged
merged 2 commits into from
Oct 3, 2019

Conversation

bmclaughlin
Copy link
Contributor

@bmclaughlin
Copy link
Contributor Author

@miq-bot add_label bug, compute/cloud

@martinpovolny
Copy link
Member

Maybe a bit of refactoring to show the intent. Something like:

  def format_data(resource, attributes, attr_icon, attr_url, attr_hsh)
    attributes.reject { |a| @ems.send(a).nil? }.map do |attr|
      {
        :id        => "#{attr_hsh[attr]}_#{@ems_id}",
        :iconClass => attr_icon[attr],
        :title     => attr_hsh[attr],
        :count     => @ems.send(attr).count,
        :href      => get_url(resource, @ems_id, attr_url[attr]),
      }
    end
  end

May be better?

Plus there surely should be a test for this.

Thx!

@martinpovolny martinpovolny self-assigned this Sep 18, 2019
@bmclaughlin
Copy link
Contributor Author

@martinpovolny, Good idea with the refactoring, definitely more understandable. That update and a test will be coming soon. Thanks!

@miq-bot
Copy link
Member

miq-bot commented Sep 20, 2019

Checked commits bmclaughlin/manageiq-ui-classic@aaf3b54~...ae8da7f with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍰

@bmclaughlin
Copy link
Contributor Author

@martinpovolny, refactored and tested.

@h-kataria h-kataria added this to the Sprint 122 Ending Oct 14, 2019 milestone Oct 3, 2019
@h-kataria h-kataria merged commit 715a1e7 into ManageIQ:master Oct 3, 2019
@bmclaughlin bmclaughlin deleted the bz1632750 branch October 3, 2019 19:26
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