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

Memoize image_path helper in build_tags_tree #10181

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,8 @@ def build_tags_tree(wf, vm_tags, edit_mode)
# Build the default filters tree for the search views
all_tags = [] # Array to hold all CIs
kids_checked = false
parent_icon = ActionController::Base.helpers.image_path("100/folder.png")
child_icon = ActionController::Base.helpers.image_path("100/tag.png")
tags.each_with_index do |t, i| # Go thru all of the Searches
if @curr_tag.blank? || @curr_tag != t[:name]
if @curr_tag != t[:name] && @ci_node
Expand All @@ -1049,7 +1051,7 @@ def build_tags_tree(wf, vm_tags, edit_mode)
@ci_node[:title] += " *" if t[:single_value]
@ci_node[:tooltip] = t[:description]
@ci_node[:addClass] = "cfme-no-cursor-node" # No cursor pointer
@ci_node[:icon] = ActionController::Base.helpers.image_path("100/folder.png")
@ci_node[:icon] = parent_icon
@ci_node[:hideCheckbox] = @ci_node[:cfmeNoClick] = true
@ci_node[:addClass] = "cfme-bold-node" # Show node as different
@ci_kids = []
Expand All @@ -1062,7 +1064,7 @@ def build_tags_tree(wf, vm_tags, edit_mode)
temp[:cfme_parent_key] = t[:id].to_s if t[:single_value]
temp[:title] = temp[:tooltip] = c[1][:description]
temp[:addClass] = "cfme-no-cursor-node"
temp[:icon] = ActionController::Base.helpers.image_path("100/tag.png")
temp[:icon] = child_icon
if edit_mode # Don't show checkboxes/radio buttons in non-edit mode
if vm_tags && vm_tags.include?(c[0].to_i)
temp[:select] = true
Expand Down