-
Notifications
You must be signed in to change notification settings - Fork 897
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
[EUWE] Don't lookup category names if tag tree view all #13308
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,14 @@ def tree_init_options(_tree_name) | |
end | ||
|
||
def contain_selected_kid(category) | ||
category.entries.any? do |entry| | ||
path = "#{category.name}-#{entry.name}" | ||
(@edit && @edit[:new][:filters].key?(path)) || (@filters && @filters.key?(path)) | ||
end | ||
return false unless @edit || @filters | ||
category.entries.any? { |entry| selected_entry_value(category, entry) } | ||
end | ||
|
||
def selected_entry_value(category, entry) | ||
return false unless @edit || @filters | ||
path = "#{category.name}-#{entry.name}" | ||
(@edit && @edit.fetch_path(:new, :filters, path)) || (@filters && @filters.key?(path)) | ||
end | ||
|
||
def set_locals_for_render | ||
|
@@ -44,17 +48,20 @@ def root_options | |
end | ||
|
||
def x_get_tree_roots(count_only, _options) | ||
return @categories.size if count_only | ||
# open node if at least one of his kids is selected | ||
@categories.each do |c| | ||
open_node("cl-#{to_cid(c.id)}") if contain_selected_kid(c) | ||
if @edit.present? || @filters.present? | ||
@categories.each do |c| | ||
open_node("cl-#{to_cid(c.id)}") if contain_selected_kid(c) | ||
end | ||
end | ||
count_only_or_objects(count_only, @categories) | ||
end | ||
|
||
def x_get_classification_kids(parent, count_only) | ||
return parent.entries.size if count_only | ||
kids = parent.entries.map do |kid| | ||
kid_id = "#{parent.name}-#{kid.name}" | ||
select = (@edit && @edit.fetch_path(:new, :filters, kid_id)) || (@filters && @filters.key?(kid_id)) | ||
select = selected_entry_value(parent, kid) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should have asked this before... was this supposed to be a boolean or the value for that key? Seems like it should have been the value, but not sure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks - fixed |
||
{:id => kid.id, | ||
:image => 'tag', | ||
:text => kid.description, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There a reason the
return
was removed from the "master" version of this PR: https://github.com/ManageIQ/manageiq-ui-classic/pull/57/filesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was probably an oversight. May have to put in a PR to get this line into master