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

Policy shield should not be visible for items which have no policies #3488

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

karelhala
Copy link
Contributor

Fixes visible shield for all items

When item hasn't enabled policies, and displays single quad policy shield is visible. That is incorrect, this PR addresses such issue by checking if item can use function get_policies

UI changes

Before

screenshot from 2018-02-27 17-58-59

After

screenshot from 2018-02-27 17-57-50

@karelhala
Copy link
Contributor Author

@miq-bot add_label bug,gaprindashvili/no
@miq-bot assign @martinpovolny
@skateman @epwinchell you were talking about this issue

@@ -199,7 +199,9 @@ def single_quad(item)
if item.kind_of?(VmOrTemplate) && quadicon_policy_sim? && !session[:policies].empty?
output << flobj_img_small(img_for_compliance(item), "e72")
end
output << flobj_img_simple('100/shield.png', "g72") unless item.try(:get_policies).try(:empty?)
if !item.try(:get_policies).nil? && !item.try(:get_policies).try(:empty?)
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't

if item.try(:get_policies).present?

do the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, good catch.

@miq-bot
Copy link
Member

miq-bot commented Feb 28, 2018

Checked commit karelhala@f0977b2 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 gtls label Feb 28, 2018
@martinpovolny martinpovolny added this to the Sprint 81 Ending Mar 12, 2018 milestone Feb 28, 2018
@martinpovolny martinpovolny merged commit bde47ef into ManageIQ:master Feb 28, 2018
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.

4 participants