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

Fix broken Automate icons #351

Merged
merged 5 commits into from
Feb 14, 2017
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
3 changes: 0 additions & 3 deletions app/assets/stylesheets/icon_customizations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ span[class^="product-"], span[class*=" product-"], // i & span tags prevent conf
.product-group:before {
content: "\e602";
}
.product-ae_instance:before {
content: "\e603";
}
.product-custom-1:before {
content: "\e606";
}
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/miq_ae_class_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,13 @@ def set_cls(cls)
glyphicon = "pficon pficon-folder-open"
when "MiqAeInstance"
cls = "aei"
glyphicon = "product product-ae_instance"
glyphicon = "fa fa-file-text-o"
when "MiqAeField"
cls = "Field"
glyphicon = "product product-ae_field"
when "MiqAeMethod"
cls = "aem"
glyphicon = "product product-ae_method"
glyphicon = "product product-method"
end
return cls, glyphicon
end
Expand Down
7 changes: 7 additions & 0 deletions app/decorators/miq_ae_class_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class MiqAeClassDecorator < Draper::Decorator
delegate_all

def fonticon
'product product-ae_class'
end
end
7 changes: 7 additions & 0 deletions app/decorators/miq_ae_instance_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class MiqAeInstanceDecorator < Draper::Decorator
delegate_all

def fonticon
'fa fa-file-text-o'
end
end
7 changes: 7 additions & 0 deletions app/decorators/miq_ae_method_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class MiqAeMethodDecorator < Draper::Decorator
delegate_all

def fonticon
'product product-method'
end
end
7 changes: 7 additions & 0 deletions app/decorators/miq_ae_namespace_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class MiqAeNamespaceDecorator < Draper::Decorator
delegate_all

def fonticon
'pficon pficon-folder-close'
end
end
4 changes: 0 additions & 4 deletions app/helpers/miq_ae_class_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ def class_prefix(cls)
end
end

def icon_class(cls)
cls.to_s.split("::").last.underscore.sub('miq_', 'product product-')
end

def nonblank(*items)
items.detect { |item| !item.blank? }
end
Expand Down
1 change: 0 additions & 1 deletion app/presenters/tree_node/miq_ae_class.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module TreeNode
class MiqAeClass < MiqAeNode
set_attribute(:icon, 'product product-ae_class')
end
end
1 change: 0 additions & 1 deletion app/presenters/tree_node/miq_ae_instance.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module TreeNode
class MiqAeInstance < MiqAeNode
set_attribute(:icon, 'product product-ae_instance')
end
end
1 change: 0 additions & 1 deletion app/presenters/tree_node/miq_ae_method.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module TreeNode
class MiqAeMethod < MiqAeNode
set_attribute(:icon, 'product product-method')
end
end
2 changes: 1 addition & 1 deletion app/presenters/tree_node/miq_ae_namespace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MiqAeNamespace < MiqAeNode
# rubocop:disable LiteralInCondition
case true
when [email protected]?
icon = 'pficon pficon-folder-close'
icon = @object.decorate.fonticon
when @object.git_enabled?
image = 'svg/ae_git_domain.svg'
when @object.name == MiqAeDatastore::MANAGEIQ_DOMAIN
Expand Down
1 change: 1 addition & 0 deletions app/presenters/tree_node/miq_ae_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module TreeNode
class MiqAeNode < Node
set_attribute(:title) { text }
set_attribute(:tooltip) { "#{ui_lookup(:model => model)}: #{text}" }
set_attribute(:icon) { @object.decorate.fonticon }

private

Expand Down
2 changes: 1 addition & 1 deletion app/views/miq_ae_class/_class_instances.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%td.narrow.noclick
%input{:type => 'checkbox', :value => cls_cid}
%td.narrow
%i{:class => icon_class(record.class)}
%i{:class => record.decorate.fonticon}
%td
= record_name(record)
:javascript
Expand Down
2 changes: 1 addition & 1 deletion app/views/miq_ae_class/_class_methods.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%td.narrow.noclick
%input{:type => 'checkbox', :value => cls_cid}
%td.narrow
%i{:class => icon_class(record.class)}
%i{:class => record.decorate.fonticon}
%td
= record_name(record)
:javascript
Expand Down
2 changes: 1 addition & 1 deletion app/views/miq_ae_class/_ns_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
%td.narrow.noclick
%input{:type => 'checkbox', :value => cls_cid}
%td.narrow
%i{:class => icon_class(record.class)}
%i{:class => record.decorate.fonticon}
%td
= record_name(record)
:javascript
Expand Down
2 changes: 1 addition & 1 deletion spec/presenters/tree_node/miq_ae_instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
let(:object) { FactoryGirl.create(:miq_ae_instance) }

include_examples 'TreeNode::Node#key prefix', 'aei-'
include_examples 'TreeNode::Node#icon', 'product product-ae_instance'
include_examples 'TreeNode::Node#icon', 'fa fa-file-text-o'
include_examples 'TreeNode::Node#tooltip prefix', 'Automate Instance'
end