From 2ff74a90492e2b4035df5e49292450d8fcc85b94 Mon Sep 17 00:00:00 2001 From: Eric Winchell Date: Wed, 11 Jan 2017 09:09:01 -0500 Subject: [PATCH] replaced images with icons in root nodes https://www.pivotaltracker.com/story/show/129371557 --- app/presenters/tree_builder_belongs_to_vat.rb | 2 +- app/presenters/tree_builder_buttons.rb | 10 +++++----- .../tree_builder_compliance_history.rb | 2 +- app/presenters/tree_builder_datacenter.rb | 4 ++-- .../tree_builder_miq_action_category.rb | 5 ++--- app/presenters/tree_builder_network.rb | 2 +- app/presenters/tree_builder_ops_diagnostics.rb | 2 +- app/presenters/tree_builder_ops_rbac.rb | 2 +- app/presenters/tree_builder_ops_settings.rb | 2 +- app/presenters/tree_builder_ops_vmdb.rb | 2 +- .../tree_builder_policy_simulation.rb | 18 +++++++++--------- .../tree_builder_policy_simulation_results.rb | 4 ++-- app/presenters/tree_builder_report_export.rb | 2 +- app/presenters/tree_builder_report_roles.rb | 2 +- .../tree_builder_report_schedules.rb | 2 +- app/presenters/tree_builder_snapshots.rb | 2 +- .../tree_builder_storage_adapters.rb | 2 +- app/presenters/tree_builder_utilization.rb | 6 +++--- app/presenters/tree_builder_vat.rb | 2 +- app/presenters/tree_node/miq_action.rb | 9 ++++++--- app/presenters/tree_node/miq_ae_namespace.rb | 13 +++++++------ .../presenters/tree_builder_datacenter_spec.rb | 4 ++-- .../tree_builder_miq_action_category_spec.rb | 2 +- spec/presenters/tree_builder_network_spec.rb | 2 +- ...e_builder_policy_simulation_results_spec.rb | 4 ++-- .../tree_builder_policy_simulation_spec.rb | 16 ++++++++-------- spec/presenters/tree_builder_snapshots_spec.rb | 2 +- .../tree_builder_storage_adapters_spec.rb | 2 +- spec/presenters/tree_builder_vat_spec.rb | 2 +- .../tree_node/miq_ae_namespace_spec.rb | 2 +- 30 files changed, 67 insertions(+), 64 deletions(-) diff --git a/app/presenters/tree_builder_belongs_to_vat.rb b/app/presenters/tree_builder_belongs_to_vat.rb index 57e32a7e174..b730a6d6356 100644 --- a/app/presenters/tree_builder_belongs_to_vat.rb +++ b/app/presenters/tree_builder_belongs_to_vat.rb @@ -15,7 +15,7 @@ def override(node, object, _pid, options) end if object.kind_of?(EmsFolder) if blue?(object) - node[:icon] = ActionController::Base.helpers.image_path("100/blue_folder.png") + node[:icon] = "pficon pficon-folder-close-blue" else node[:hideCheckbox] = true end diff --git a/app/presenters/tree_builder_buttons.rb b/app/presenters/tree_builder_buttons.rb index a4cf472b401..de8fc205a4a 100644 --- a/app/presenters/tree_builder_buttons.rb +++ b/app/presenters/tree_builder_buttons.rb @@ -21,7 +21,7 @@ def x_get_tree_roots(_count_only, _options) @sb[:target_classes] = resolve.invert resolve = Array(resolve.invert).sort resolve.collect do |typ| - {:id => "ab_#{typ[1]}", :text => typ[0], :image => buttons_node_image(typ[1]), :tip => typ[0]} + {:id => "ab_#{typ[1]}", :text => typ[0], :tip => typ[0]}.merge(buttons_node_image(typ[1])) end end @@ -69,10 +69,10 @@ def x_get_tree_aset_kids(object, count_only) def buttons_node_image(node) case node - when "ExtManagementSystem" then '100/ext_management_system.png' - when "MiqTemplate" then '100/vm.png' - when 'CloudTenant' then '100/cloud_tenant.png' - else "100/#{node.downcase}.png" + when "ExtManagementSystem" then {:icon => 'pficon pficon-server'} + when "MiqTemplate" then {:icon => 'pficon-virtual-machine'} + when 'CloudTenant' then {:icon => 'pficon-cloud-tenant'} + else {:image => '100/#{node.downcase}.png'} end end end diff --git a/app/presenters/tree_builder_compliance_history.rb b/app/presenters/tree_builder_compliance_history.rb index e0f883eacbe..21c95e8524e 100644 --- a/app/presenters/tree_builder_compliance_history.rb +++ b/app/presenters/tree_builder_compliance_history.rb @@ -53,7 +53,7 @@ def x_get_compliance_kids(parent, count_only) def get_policy_elm(parent, node) {:id => "#{parent.id}-p_#{node.miq_policy_id}", :text => prefixed_title(_('Condition'), node.condition_desc), - :image => node.condition_result ? "100/check.png" : "100/x.png", + :icon => node.condition_result ? "pficon pficon-ok" : "pficon pficon-error-circle-o", :tip => nil, :cfmeNoClick => true} end diff --git a/app/presenters/tree_builder_datacenter.rb b/app/presenters/tree_builder_datacenter.rb index f6631a60246..80f704a9685 100644 --- a/app/presenters/tree_builder_datacenter.rb +++ b/app/presenters/tree_builder_datacenter.rb @@ -49,13 +49,13 @@ def root_options { :title => @root.name, :tooltip => _("Cluster: %{name}") % {:name => @root.name}, - :image => "100/cluster.png" + :icon => "pficon pficon-cluster" } elsif @root.kind_of?(ResourcePool) { :title => @root.name, :tooltip => _("Resource Pool: %{name}") % {:name => @root.name}, - :image => @root.vapp ? "100/vapp.png" : "100/resource_pool.png" + :icon => "pficon-resource-pool" } end end diff --git a/app/presenters/tree_builder_miq_action_category.rb b/app/presenters/tree_builder_miq_action_category.rb index 06943e92c1f..69619149afd 100644 --- a/app/presenters/tree_builder_miq_action_category.rb +++ b/app/presenters/tree_builder_miq_action_category.rb @@ -5,9 +5,8 @@ class TreeBuilderMiqActionCategory < TreeBuilder def override(node, object, _pid, _options) leaf = !object.category? - image = leaf ? nil : "100/tag.png" node[:cfmeNoClick] = !leaf - node[:image] = image && ActionController::Base.helpers.image_path(image) + node[:icon] = leaf ? nil : "fa fa-tag" node end @@ -36,7 +35,7 @@ def root_options { :title => @tenant_name, :tooltip => @tenant_name, - :image => "100/tag.png" + :icon => "fa fa-tag" } end diff --git a/app/presenters/tree_builder_network.rb b/app/presenters/tree_builder_network.rb index b129303a551..c47a44f944d 100644 --- a/app/presenters/tree_builder_network.rb +++ b/app/presenters/tree_builder_network.rb @@ -32,7 +32,7 @@ def root_options { :title => @root.name, :tooltip => _("Host: %{name}") % {:name => @root.name}, - :image => '100/host.png', + :icon => 'pficon pficon-screen', :cfmeNoClick => true } end diff --git a/app/presenters/tree_builder_ops_diagnostics.rb b/app/presenters/tree_builder_ops_diagnostics.rb index 364dc98f2bd..85f8c76479d 100644 --- a/app/presenters/tree_builder_ops_diagnostics.rb +++ b/app/presenters/tree_builder_ops_diagnostics.rb @@ -21,7 +21,7 @@ def root_options { :title => title, :tooltip => title, - :image => '100/miq_region.png' + :icon => 'pficon pficon-regions' } end end diff --git a/app/presenters/tree_builder_ops_rbac.rb b/app/presenters/tree_builder_ops_rbac.rb index 5cf4edd9537..1a37b899ef1 100644 --- a/app/presenters/tree_builder_ops_rbac.rb +++ b/app/presenters/tree_builder_ops_rbac.rb @@ -24,7 +24,7 @@ def root_options { :title => title, :tooltip => title, - :image => '100/miq_region.png' + :icon => 'pficon pficon-regions' } end diff --git a/app/presenters/tree_builder_ops_settings.rb b/app/presenters/tree_builder_ops_settings.rb index d8f00844dab..58b7ad7ea94 100644 --- a/app/presenters/tree_builder_ops_settings.rb +++ b/app/presenters/tree_builder_ops_settings.rb @@ -21,7 +21,7 @@ def root_options { :title => title, :tooltip => title, - :image => '100/miq_region.png' + :icon => 'pficon pficon-regions' } end diff --git a/app/presenters/tree_builder_ops_vmdb.rb b/app/presenters/tree_builder_ops_vmdb.rb index ab8f2a6f67b..f17199f1748 100644 --- a/app/presenters/tree_builder_ops_vmdb.rb +++ b/app/presenters/tree_builder_ops_vmdb.rb @@ -19,7 +19,7 @@ def root_options { :title => t = _("VMDB"), :tooltip => t, - :image => '100/miq_database.png' + :icon => 'fa fa-database' } end diff --git a/app/presenters/tree_builder_policy_simulation.rb b/app/presenters/tree_builder_policy_simulation.rb index f2d47de9821..1752ee4703e 100644 --- a/app/presenters/tree_builder_policy_simulation.rb +++ b/app/presenters/tree_builder_policy_simulation.rb @@ -27,7 +27,7 @@ def root_options { :title => ViewHelper.content_tag(:strong, @root_name), :tooltip => @root_name, - :image => '100/vm.png', + :icon => 'pficon pficon-virtual-machine', :cfmeNoClick => true } end @@ -51,7 +51,7 @@ def x_get_tree_roots(count_only = false, _options = {}) nodes = reject_na_nodes(@data).map do |node| {:id => node['id'], :text => prefixed_title(_('Policy Profile'), node['description']), - :image => node_icon(node["result"]), + :icon => node_icon(node["result"]), :tip => node['description'], :cfmeNoClick => true, :policies => node['policies']} @@ -85,9 +85,9 @@ def get_active_caption(node) def policy_nodes(parent) parent[:policies].reject { |node| skip_node?(node) }.sort_by { |a| a["description"] }.map do |node| active_caption = get_active_caption(node) - {:id => node['id'], + {:id => node['id'], :text => prefixed_title(_('Policy%{caption}') % {:caption => active_caption}, node['description']), - :image => node_icon(node["result"]), + :icon => node_icon(node["result"]), :tip => node['description'], :scope => node['scope'], :conditions => node['conditions'], @@ -100,7 +100,7 @@ def condition_node(parent) nodes = nodes.sort_by { |a| a["description"] }.map do |node| {:id => node['id'], :text => prefixed_title(_('Condition'), node['description']), - :image => node_icon(node["result"]), + :icon => node_icon(node["result"]), :tip => node['description'], :scope => node['scope'], :expression => node["expression"], @@ -110,15 +110,15 @@ def condition_node(parent) end def scope_node(parent) - icon = parent[:scope]["result"] ? "100/checkmark.png" : "100/na.png" + icon = parent[:scope]["result"] ? "pficon pficon-ok" : "fa fa-ban" text, tip = exp_build_string(parent[:scope]) - {:id => nil, :text => prefixed_title(_('Scope'), text), :image => icon, :tip => tip, :cfmeNoClick => true} + {:id => nil, :text => prefixed_title(_('Scope'), text), :icon => icon, :tip => tip, :cfmeNoClick => true} end def expression_node(parent) - icon = parent[:expression]["result"] ? "100/checkmark.png" : "100/na.png" + icon = parent[:expression]["result"] ? "pficon pficon-ok" : "fa fa-ban" text, tip = exp_build_string(parent[:expression]) - {:id => nil, :text => prefixed_title(_('Expression'), text), :image => icon, :tip => tip, :cfmeNoClick => true} + {:id => nil, :text => prefixed_title(_('Expression'), text), :icon => icon, :tip => tip, :cfmeNoClick => true} end def get_correct_node(parent, node_name) diff --git a/app/presenters/tree_builder_policy_simulation_results.rb b/app/presenters/tree_builder_policy_simulation_results.rb index 1d45c830fad..f9a21b6ad0d 100644 --- a/app/presenters/tree_builder_policy_simulation_results.rb +++ b/app/presenters/tree_builder_policy_simulation_results.rb @@ -24,7 +24,7 @@ def root_options event = MiqEventDefinition.find(@root[:event_value]) { :title => _("Policy Simulation Results for Event [%{description}]") % {:description => event.description}, - :image => "100/event-#{event.name}.png", + :icon => event.decorate.fonticon, :cfmeNoClick => true } end @@ -41,7 +41,7 @@ def vm_nodes(data) data.sort_by! { |a| a[:name].downcase }.map do |node| {:id => node[:id], :text => prefixed_title(_('VM'), node[:name]), - :image => '100/vm.png', + :icon => 'pficon pficon-virtual-machine', :profiles => node[:profiles], :cfmeNoClick => true} end diff --git a/app/presenters/tree_builder_report_export.rb b/app/presenters/tree_builder_report_export.rb index 5df6827edd0..c4707ba7e3c 100644 --- a/app/presenters/tree_builder_report_export.rb +++ b/app/presenters/tree_builder_report_export.rb @@ -18,7 +18,7 @@ def root_options { :title => t = _("Import / Export"), :tooltip => t, - :image => '100/report.png' + :icon => 'product product-report' } end diff --git a/app/presenters/tree_builder_report_roles.rb b/app/presenters/tree_builder_report_roles.rb index ae2c243e8fb..82416b026d2 100644 --- a/app/presenters/tree_builder_report_roles.rb +++ b/app/presenters/tree_builder_report_roles.rb @@ -23,7 +23,7 @@ def root_options { :title => title, :tooltip => title, - :image => '100/miq_group.png' + :icon => 'product product-group' } end diff --git a/app/presenters/tree_builder_report_schedules.rb b/app/presenters/tree_builder_report_schedules.rb index 786ac0cf59f..74c83486099 100644 --- a/app/presenters/tree_builder_report_schedules.rb +++ b/app/presenters/tree_builder_report_schedules.rb @@ -17,7 +17,7 @@ def root_options { :title => t = _("All Schedules"), :tooltip => t, - :image => '100/miq_schedule.png' + :icon => 'fa fa-clock-o' } end diff --git a/app/presenters/tree_builder_snapshots.rb b/app/presenters/tree_builder_snapshots.rb index 2e00a11ecf6..d038d6c899b 100644 --- a/app/presenters/tree_builder_snapshots.rb +++ b/app/presenters/tree_builder_snapshots.rb @@ -30,7 +30,7 @@ def root_options { :title => @record.name, :tooltip => @record.name, - :image => '100/vm.png', + :icon => 'pficon pficon-virtual-machine', :cfmeNoClick => true } end diff --git a/app/presenters/tree_builder_storage_adapters.rb b/app/presenters/tree_builder_storage_adapters.rb index ac2df7c2253..fc8f13d5528 100644 --- a/app/presenters/tree_builder_storage_adapters.rb +++ b/app/presenters/tree_builder_storage_adapters.rb @@ -23,7 +23,7 @@ def root_options { :title => @root.name, :tooltip => _("Host: %{name}") % {:name => @root.name}, - :image => "100/host.png" + :icon => "pficon pficon-screen" } end diff --git a/app/presenters/tree_builder_utilization.rb b/app/presenters/tree_builder_utilization.rb index 9a0df351769..0b076938432 100644 --- a/app/presenters/tree_builder_utilization.rb +++ b/app/presenters/tree_builder_utilization.rb @@ -21,17 +21,17 @@ def set_locals_for_render def root_options if MiqEnterprise.my_enterprise.is_enterprise? title = _("Enterprise") - icon = '100/enterprise.png' + icon = 'pficon pficon-enterprise' else title = _("%{product} Region: %{region_description} [%{region}]") % {:region_description => MiqRegion.my_region.description, :region => MiqRegion.my_region.region, :product => I18n.t('product.name')} - icon = '100/miq_region.png' + icon = 'pficon pficon-regions' end { :title => title, :tooltip => title, - :image => icon + :icon => icon } end diff --git a/app/presenters/tree_builder_vat.rb b/app/presenters/tree_builder_vat.rb index bd83d0ee2f8..ef8b050b08f 100644 --- a/app/presenters/tree_builder_vat.rb +++ b/app/presenters/tree_builder_vat.rb @@ -15,7 +15,7 @@ def root_options { :title => @root.name, :tooltip => @root.name, - :image => "100/vendor-#{@root.image_name}.png" + :image => "svg/vendor-#{@root.image_name}.svg" } end diff --git a/app/presenters/tree_node/miq_action.rb b/app/presenters/tree_node/miq_action.rb index 5ac913cf2ce..e3dcd1437cd 100644 --- a/app/presenters/tree_node/miq_action.rb +++ b/app/presenters/tree_node/miq_action.rb @@ -1,7 +1,7 @@ module TreeNode class MiqAction < Node set_attribute(:title, &:description) - set_attribute(:image) do + set_attributes(:icon, :image) do if @options[:tree] != :action_tree if @options[:tree] == :policy_profile_tree policy_id = @parent_id.split('-')[2].split('_').first @@ -13,10 +13,13 @@ class MiqAction < Node p = ::MiqPolicy.find_by_id(ApplicationRecord.uncompress_id(policy_id)) ev = ::MiqEventDefinition.find_by_id(ApplicationRecord.uncompress_id(event_id)) - p.action_result_for_event(@object, ev) ? "100/check.png" : "100/x.png" + icon = p.action_result_for_event(@object, ev) ? "pficon pficon-ok" : "pficon pficon-error-circle-o" + elsif @object.action_type == "default" + icon = "product product-action" else - @object.action_type == "default" ? "100/miq_action.png" : "100/miq_action_#{@object.action_type}.png" + image = "100/miq_action_#{@object.action_type}.png" end + [icon, image] end end end diff --git a/app/presenters/tree_node/miq_ae_namespace.rb b/app/presenters/tree_node/miq_ae_namespace.rb index 8c30c94a78d..f708891c765 100644 --- a/app/presenters/tree_node/miq_ae_namespace.rb +++ b/app/presenters/tree_node/miq_ae_namespace.rb @@ -2,22 +2,23 @@ module TreeNode class MiqAeNamespace < MiqAeNode include MiqAeClassHelper - set_attribute(:image) do + set_attributes(:icon, :image) do # Having a "flat" case here makes the code more readable # rubocop:disable LiteralInCondition case true when !@object.domain? - 'svg/ae_namespace.svg' + icon = 'pficon pficon-folder-close' when @object.git_enabled? - 'svg/ae_git_domain.svg' + image = 'svg/ae_git_domain.svg' when @object.name == MiqAeDatastore::MANAGEIQ_DOMAIN - '100/miq.png' + icon = 'product product-product' when !@object.top_level_namespace - '100/ae_domain.png' + icon = 'fa fa-globe' else - "svg/vendor-#{@object.top_level_namespace.downcase}.svg" + image = "svg/vendor-#{@object.top_level_namespace.downcase}.svg" end # rubocop:enable LiteralInCondition + [icon, image] end set_attribute(:klass) { @object.domain? && @object.enabled? ? nil : 'striketrough' } diff --git a/spec/presenters/tree_builder_datacenter_spec.rb b/spec/presenters/tree_builder_datacenter_spec.rb index 41e5d2cde39..6ba379b1097 100644 --- a/spec/presenters/tree_builder_datacenter_spec.rb +++ b/spec/presenters/tree_builder_datacenter_spec.rb @@ -21,7 +21,7 @@ def resource_pools expect(root).to eq( :title => @datacenter_tree.instance_variable_get(:@root).name, :tooltip => "Cluster: #{@datacenter_tree.instance_variable_get(:@root).name}", - :image => "100/cluster.png" + :icon => "pficon pficon-cluster" ) end @@ -58,7 +58,7 @@ def vms expect(root).to eq( :title => @datacenter_tree.instance_variable_get(:@root).name, :tooltip => "Resource Pool: #{@datacenter_tree.instance_variable_get(:@root).name}", - :image => @datacenter_tree.instance_variable_get(:@root).vapp ? '100/vapp.png' : '100/resource_pool.png' + :icon => "pficon-resource-pool" ) end diff --git a/spec/presenters/tree_builder_miq_action_category_spec.rb b/spec/presenters/tree_builder_miq_action_category_spec.rb index 05f21ecf812..9bc40c739e3 100644 --- a/spec/presenters/tree_builder_miq_action_category_spec.rb +++ b/spec/presenters/tree_builder_miq_action_category_spec.rb @@ -54,7 +54,7 @@ expect(subject.send(:root_options)).to eq( :title => tenant, :tooltip => tenant, - :image => "100/tag.png" + :icon => "fa fa-tag" ) end end diff --git a/spec/presenters/tree_builder_network_spec.rb b/spec/presenters/tree_builder_network_spec.rb index 942d53ec430..788cbfe168d 100644 --- a/spec/presenters/tree_builder_network_spec.rb +++ b/spec/presenters/tree_builder_network_spec.rb @@ -18,7 +18,7 @@ expect(root).to eq( :title => @network_tree.instance_variable_get(:@root).name, :tooltip => _("Host: %{name}") % {:name => @network_tree.instance_variable_get(:@root).name}, - :image => '100/host.png', + :icon => 'pficon pficon-screen', :cfmeNoClick => true ) end diff --git a/spec/presenters/tree_builder_policy_simulation_results_spec.rb b/spec/presenters/tree_builder_policy_simulation_results_spec.rb index 2a6eb90ce6e..1a4dbe3b6a6 100644 --- a/spec/presenters/tree_builder_policy_simulation_results_spec.rb +++ b/spec/presenters/tree_builder_policy_simulation_results_spec.rb @@ -34,7 +34,7 @@ root_options = @rsop_tree.send(:root_options) expect(root_options).to eq( :title => _("Policy Simulation Results for Event [%{description}]") % {:description => @event.description}, - :image => "100/event-#{@event.name}.png", + :icon => @event.decorate.fonticon, :cfmeNoClick => true ) end @@ -44,7 +44,7 @@ original_vms = @data[:results].sort_by { |a| a[:name].downcase } vms.each_with_index do |vm, i| expect(vm[:text]).to eq("VM: #{original_vms[i][:name]}") - expect(vm[:image]).to eq('100/vm.png') + expect(vm[:icon]).to eq('pficon pficon-virtual-machine') expect(vm[:profiles]).to eq(original_vms[i][:profiles]) end end diff --git a/spec/presenters/tree_builder_policy_simulation_spec.rb b/spec/presenters/tree_builder_policy_simulation_spec.rb index 87cf5a46671..cb65d3a46b7 100644 --- a/spec/presenters/tree_builder_policy_simulation_spec.rb +++ b/spec/presenters/tree_builder_policy_simulation_spec.rb @@ -49,7 +49,7 @@ expect(root).to eq( :title => "Policy Simulation", :tooltip => 'Policy Simulation', - :image => '100/vm.png', + :icon => 'pficon pficon-virtual-machine', :cfmeNoClick => true ) end @@ -66,7 +66,7 @@ it 'sets Policy Profile node correctly' do node = @policy_simulation_tree.send(:x_get_tree_roots, false).first expect(node[:text]).to eq("Policy Profile: #{@data.first['description']}") - expect(node[:image]).to eq("pficon pficon-ok") + expect(node[:icon]).to eq("pficon pficon-ok") expect(node[:tip]).to eq(@data.first['description']) expect(node[:policies].count).to eq(2) end @@ -75,11 +75,11 @@ node = @policy_simulation_tree.send(:x_get_tree_roots, false).first kids = @policy_simulation_tree.send(:x_get_tree_hash_kids, node, false) expect(kids.first[:text]).to eq("Policy: #{@data.first['policies'].first['description']}") - expect(kids.first[:image]).to eq('fa fa-ban') + expect(kids.first[:icon]).to eq('fa fa-ban') expect(kids.first[:tip]).to eq(@data.first['policies'].first['description']) expect(kids.first[:conditions].count).to eq(1) expect(kids.last[:text]).to eq("Policy: #{@data.first['policies'].last['description']}") - expect(kids.last[:image]).to eq('pficon-error-circle-o') + expect(kids.last[:icon]).to eq('pficon-error-circle-o') expect(kids.last[:tip]).to eq(@data.first['policies'].last['description']) expect(kids.last[:conditions].count).to eq(1) end @@ -91,10 +91,10 @@ parent_two = @policy_simulation_tree.send(:x_get_tree_hash_kids, root, false).last kid_two = @policy_simulation_tree.send(:x_get_tree_hash_kids, parent_two, false).first expect(kid_one[:text]).to eq("Condition: #{@data.first['policies'].first['conditions'].first['description']}") - expect(kid_one[:image]).to eq('pficon-error-circle-o') + expect(kid_one[:icon]).to eq('pficon-error-circle-o') expect(kid_one[:tip]).to eq(@data.first['policies'].first['conditions'].first['description']) expect(kid_two[:text]).to eq("Condition: #{@data.first['policies'].last['conditions'].first['description']}") - expect(kid_two[:image]).to eq('fa fa-ban') + expect(kid_two[:icon]).to eq('fa fa-ban') expect(kid_two[:tip]).to eq(@data.first['policies'].last['conditions'].first['description']) end @@ -107,10 +107,10 @@ kid_one = @policy_simulation_tree.send(:x_get_tree_hash_kids, parent_one, false).first kid_two = @policy_simulation_tree.send(:x_get_tree_hash_kids, parent_two, false).first expect(kid_one[:text]).to eq("Scope: FIND VM and Instance.Files : Name INCLUDES "nb" CHECK COUNT >= 1") - expect(kid_one[:image]).to eq('100/na.png') + expect(kid_one[:icon]).to eq('fa fa-ban') expect(kid_one[:tip]).to eq("FIND VM and Instance.Files : Name INCLUDES \"nb\" CHECK COUNT >= 1") expect(kid_two[:text]).to eq("Expression: FIND VM and Instance.Files : Name INCLUDES "nb" CHECK COUNT >= 1") - expect(kid_two[:image]).to eq('100/na.png') + expect(kid_two[:icon]).to eq('fa fa-ban') expect(kid_two[:tip]).to eq("FIND VM and Instance.Files : Name INCLUDES \"nb\" CHECK COUNT >= 1") end end diff --git a/spec/presenters/tree_builder_snapshots_spec.rb b/spec/presenters/tree_builder_snapshots_spec.rb index 8ca9d14c194..feae715f64c 100644 --- a/spec/presenters/tree_builder_snapshots_spec.rb +++ b/spec/presenters/tree_builder_snapshots_spec.rb @@ -20,7 +20,7 @@ expect(root).to eq( :title => @record.name, :tooltip => @record.name, - :image => '100/vm.png', + :icon => 'pficon pficon-virtual-machine', :cfmeNoClick => true ) end diff --git a/spec/presenters/tree_builder_storage_adapters_spec.rb b/spec/presenters/tree_builder_storage_adapters_spec.rb index 60ad8068427..55cec79fa18 100644 --- a/spec/presenters/tree_builder_storage_adapters_spec.rb +++ b/spec/presenters/tree_builder_storage_adapters_spec.rb @@ -22,7 +22,7 @@ def hardware expect(root).to eq( :title => @sa_tree.instance_variable_get(:@root).name, :tooltip => "Host: #{@sa_tree.instance_variable_get(:@root).name}", - :image => '100/host.png' + :icon => 'pficon pficon-screen' ) end diff --git a/spec/presenters/tree_builder_vat_spec.rb b/spec/presenters/tree_builder_vat_spec.rb index f7f45f8112f..fcbf661aaa5 100644 --- a/spec/presenters/tree_builder_vat_spec.rb +++ b/spec/presenters/tree_builder_vat_spec.rb @@ -21,7 +21,7 @@ def image_name it 'returns EmsCluster as root' do root = @vat_tree.send(:root_options) - image = "100/vendor-#{@vat_tree.instance_variable_get(:@root).image_name}.png" + image = "svg/vendor-#{@vat_tree.instance_variable_get(:@root).image_name}.svg" expect(root).to eq( :title => @vat_tree.instance_variable_get(:@root).name, :tooltip => @vat_tree.instance_variable_get(:@root).name, diff --git a/spec/presenters/tree_node/miq_ae_namespace_spec.rb b/spec/presenters/tree_node/miq_ae_namespace_spec.rb index 890d71a17d5..75abd51c695 100644 --- a/spec/presenters/tree_node/miq_ae_namespace_spec.rb +++ b/spec/presenters/tree_node/miq_ae_namespace_spec.rb @@ -10,7 +10,7 @@ end include_examples 'TreeNode::Node#key prefix', 'aen-' - include_examples 'TreeNode::Node#image', 'svg/ae_namespace.svg' + include_examples 'TreeNode::Node#icon', 'pficon pficon-folder-close' include_examples 'TreeNode::Node#tooltip prefix', 'Automate Namespace' context 'MiqAeDomain' do