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

Use fonticons for orphaned/retired machine state instead of text #4701

Merged
merged 1 commit into from Sep 26, 2018
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions app/helpers/quadicon_helper.rb
Expand Up @@ -8,8 +8,8 @@ module QuadiconHelper

MACHINE_STATE_QUADRANT = {
'archived' => {:fonticon => 'fa fa-archive', :background => '#336699'},
'orphaned' => {:text => 'O', :background => '#336699'},
'retired' => {:text => 'R', :background => '#336699'},
'orphaned' => {:fonticon => 'ff ff-orphaned', :background => '#336699'},
'retired' => {:fonticon => 'fa fa-clock-o', :background => '#336699'},
'unknown' => {:fonticon => 'pficon pficon-unknown', :background => '#336699'},
'preparing_for_maintenance' => {:fonticon => 'pficon pficon-maintenance', :background => '#336699'},
'maintenance' => {:fonticon => 'pficon pficon-maintenance', :background => '#336699'},
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/tree_builder_archived.rb
Expand Up @@ -15,7 +15,7 @@ def x_get_tree_custom_kids(object, count_only, options)
def x_get_tree_arch_orph_nodes(model_name)
[
{:id => "arch", :text => _("<Archived>"), :icon => "fa fa-archive", :tip => _("Archived %{model}") % {:model => model_name}},
{:id => "orph", :text => _("<Orphaned>"), :image => "svg/currentstate-orphaned.svg", :tip => _("Orphaned %{model}") % {:model => model_name}}
{:id => "orph", :text => _("<Orphaned>"), :icon => "ff ff-orphaned", :tip => _("Orphaned %{model}") % {:model => model_name}}
]
end
end
9 changes: 1 addition & 8 deletions app/presenters/tree_node/vm_or_template.rb
@@ -1,13 +1,6 @@
module TreeNode
class VmOrTemplate < Node
set_attributes(:image, :icon) do
if @object.normalized_state.downcase == 'archived'
icon = "fa fa-archive"
else
image = "svg/currentstate-#{@object.normalized_state.downcase}.svg"
end
[image, icon]
end
set_attribute(:icon) { QuadiconHelper.machine_state(@object.normalized_state)[:fonticon] }

set_attribute(:tooltip) do
unless @object.template?
Expand Down
2 changes: 1 addition & 1 deletion manageiq-ui-classic.gemspec
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency "rails", ">= 5.0.0.1", "< 5.2"

s.add_dependency "coffee-rails"
s.add_dependency "font-fabulous", "~> 1.0.2"
s.add_dependency "font-fabulous", "~> 1.0.3"
s.add_dependency "high_voltage", "~> 3.0.0"
s.add_dependency "jquery-hotkeys-rails"
s.add_dependency "more_core_extensions", "~>3.2"
Expand Down
8 changes: 4 additions & 4 deletions spec/presenters/tree_builder_archived_spec.rb
Expand Up @@ -13,10 +13,10 @@
:text => "<Archived>",
:icon => "fa fa-archive",
:tip => "Archived VMs/Templates"},
{:id => "orph",
:text => "<Orphaned>",
:image => "svg/currentstate-orphaned.svg",
:tip => "Orphaned VMs/Templates"}])
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:tip => "Orphaned VMs/Templates"}])
end

it '#x_get_tree_custom_kids with hidden Infra VMs returns empty Array' do
Expand Down
8 changes: 4 additions & 4 deletions spec/presenters/tree_builder_images_spec.rb
Expand Up @@ -38,10 +38,10 @@
:text => "<Archived>",
:icon => "fa fa-archive",
:tip => "Archived Images"},
{:id => "orph",
:text => "<Orphaned>",
:image => "svg/currentstate-orphaned.svg",
:tip => "Orphaned Images"}])
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:tip => "Orphaned Images"}])
end

it 'sets Templates nodes to empty Array if VMs/Templates are hidden' do
Expand Down
8 changes: 4 additions & 4 deletions spec/presenters/tree_builder_instances_spec.rb
Expand Up @@ -44,10 +44,10 @@
:text => "<Archived>",
:icon => "fa fa-archive",
:tip => "Archived Instances"},
{:id => "orph",
:text => "<Orphaned>",
:image => "svg/currentstate-orphaned.svg",
:tip => "Orphaned Instances"}])
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:tip => "Orphaned Instances"}])
end

it 'sets availability zones correctly if vms are hidden' do
Expand Down