Skip to content

Commit

Permalink
Set the catalog and item/bundle icons correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Apr 18, 2017
1 parent 1895ce6 commit d5e51a9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
6 changes: 5 additions & 1 deletion app/decorators/service_template_ansible_tower_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
class ServiceTemplateAnsibleTowerDecorator < MiqDecorator
def self.fonticon
'product product-template'
'fa fa-cube'
end

def fonticon
atomic? ? super : 'fa fa-cubes'
end

def fileicon
Expand Down
2 changes: 1 addition & 1 deletion app/decorators/service_template_catalog_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class ServiceTemplateCatalogDecorator < MiqDecorator
def self.fonticon
'product product-template'
'pficon pficon-folder-close'
end
end
6 changes: 5 additions & 1 deletion app/decorators/service_template_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
class ServiceTemplateDecorator < MiqDecorator
def self.fonticon
'product product-template'
'fa fa-cube'
end

def fonticon
atomic? ? super : 'fa fa-cubes'
end

def fileicon
Expand Down
2 changes: 1 addition & 1 deletion spec/presenters/tree_node/service_template_catalog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

include_examples 'TreeNode::Node#key prefix', 'stc-'
include_examples 'TreeNode::Node#icon', 'product product-template'
include_examples 'TreeNode::Node#icon', 'pficon pficon-folder-close'

describe '#title' do
it 'returns with the catalog name and tenant name as a suffix' do
Expand Down
16 changes: 12 additions & 4 deletions spec/presenters/tree_node/service_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
service_template_ansible_tower
service_template_orchestration
).each do |factory|
klass = FactoryGirl.factory_by_name(factory).instance_variable_get(:@class_name)
context(klass) do
let(:object) { FactoryGirl.create(factory, :name => 'foo', :tenant => tenant) }
context(factory.to_s.camelize) do
let(:object) { FactoryGirl.create(factory, :name => 'foo', :tenant => tenant, :service_type => stype) }
let(:stype) { 'atomic' }

include_examples 'TreeNode::Node#key prefix', 'st-'
include_examples 'TreeNode::Node#icon', 'product product-template'
include_examples 'TreeNode::Node#icon', 'fa fa-cube'

unless factory == :service_template_ansible_tower
context 'catalog bundle' do
let(:stype) { 'composite' }

include_examples 'TreeNode::Node#icon', 'fa fa-cubes'
end
end

describe '#title' do
it 'returns with the catalog name and tenant name as a suffix' do
Expand Down

0 comments on commit d5e51a9

Please sign in to comment.