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

Put background under archived/orphaned tree node icons in VMs #4711

Merged
merged 1 commit into from
Oct 2, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/presenters/tree_builder_archived.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ def x_get_tree_custom_kids(object, count_only, options)
end

def x_get_tree_arch_orph_nodes(model_name)
archived = QuadiconHelper.machine_state('archived').values_at(:fonticon, :background)
orphaned = QuadiconHelper.machine_state('orphaned').values_at(:fonticon, :background)

[
{:id => "arch", :text => _("<Archived>"), :icon => "fa fa-archive", :tip => _("Archived %{model}") % {:model => model_name}},
{:id => "orph", :text => _("<Orphaned>"), :icon => "ff ff-orphaned", :tip => _("Orphaned %{model}") % {:model => model_name}}
{:id => "arch", :text => _("<Archived>"), :icon => archived[0], :icon_background => archived[1], :tip => _("Archived %{model}") % {:model => model_name}},
{:id => "orph", :text => _("<Orphaned>"), :icon => orphaned[0], :icon_background => orphaned[1], :tip => _("Orphaned %{model}") % {:model => model_name}}
]
end
end
18 changes: 10 additions & 8 deletions spec/presenters/tree_builder_archived_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@

it '#x_get_tree_arch_orph_nodes' do
nodes = archived.x_get_tree_arch_orph_nodes('VMs/Templates')
expect(nodes).to eq([{:id => "arch",
:text => "<Archived>",
:icon => "fa fa-archive",
:tip => "Archived VMs/Templates"},
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:tip => "Orphaned VMs/Templates"}])
expect(nodes).to eq([{:id => "arch",
:text => "<Archived>",
:icon => "fa fa-archive",
:icon_background => "#336699",
:tip => "Archived VMs/Templates"},
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:icon_background => "#336699",
:tip => "Orphaned VMs/Templates"}])
end

it '#x_get_tree_custom_kids with hidden Infra VMs returns empty Array' do
Expand Down
18 changes: 10 additions & 8 deletions spec/presenters/tree_builder_images_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@
it 'sets providers nodes correctly' do
providers = @images_tree.x_get_tree_roots(false, nil)
expect(providers).to eq([@template_cloud_with_az.ext_management_system,
{:id => "arch",
:text => "<Archived>",
:icon => "fa fa-archive",
:tip => "Archived Images"},
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:tip => "Orphaned Images"}])
{:id => "arch",
:text => "<Archived>",
:icon => "fa fa-archive",
:icon_background => "#336699",
:tip => "Archived Images"},
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:icon_background => "#336699",
:tip => "Orphaned Images"}])
end

it 'sets Templates nodes to empty Array if VMs/Templates are hidden' do
Expand Down
18 changes: 10 additions & 8 deletions spec/presenters/tree_builder_instances_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@

expect(providers).to eq([@vm_cloud_with_az.ext_management_system,
@vm_cloud_without_az.ext_management_system,
{:id => "arch",
:text => "<Archived>",
:icon => "fa fa-archive",
:tip => "Archived Instances"},
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:tip => "Orphaned Instances"}])
{:id => "arch",
:text => "<Archived>",
:icon => "fa fa-archive",
:icon_background => "#336699",
:tip => "Archived Instances"},
{:id => "orph",
:text => "<Orphaned>",
:icon => "ff ff-orphaned",
:icon_background => "#336699",
:tip => "Orphaned Instances"}])
end

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