Skip to content

Commit

Permalink
Merge pull request #5858 from skateman/features-tree-select
Browse files Browse the repository at this point in the history
Select the features tree items when 'everything' is allowed
  • Loading branch information
h-kataria committed Jul 24, 2019
2 parents cc18b02 + f9d562a commit d5f9004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/presenters/tree_node/menu/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Item < TreeNode::Menu::Node
parent_feature = ::MiqProductFeature.obj_features[::MiqProductFeature.feature_parent(@object.feature)][:feature]

[parent_feature.identifier, @object.feature].any? do |item|
@tree.features.include?(item)
@tree.features.include?('everything') || @tree.features.include?(item)
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion app/presenters/tree_node/miq_product_feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ class MiqProductFeature < TreeNode::Menu::Node
set_attribute(:key) { "#{@tree.node_id_prefix}__#{@object.identifier}" }
set_attribute(:text) { _(@object.name) }
set_attribute(:tooltip) { _(@object.description) || _(@object.name) }
set_attribute(:selected) { @tree.features.include?(@object.identifier.sub(/_accords$/, '')) }
set_attribute(:selected) do
@tree.features.include?('everything') || @tree.features.include?(@object.identifier.sub(/_accords$/, ''))
end

set_attribute(:icon) do
case @object.feature_type
Expand Down

0 comments on commit d5f9004

Please sign in to comment.