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

Icons to discern automate method types #2700

Merged
merged 1 commit into from
Nov 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
4 changes: 4 additions & 0 deletions app/assets/stylesheets/icon_customizations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,8 @@ opacity:0.6;
color: #ec7a08; //pf-orange-400
}

.fa-ruby {
@extend .fa, .fa-lg, .fa-diamond;
color: red;
}
/*end icon class customizations*/
17 changes: 15 additions & 2 deletions app/decorators/miq_ae_method_decorator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
class MiqAeMethodDecorator < MiqDecorator
def self.fonticon
'ff ff-method'
def fileicon
"svg/vendor-ansible.svg" if location == 'playbook'
end

def fonticon
case location
when "inline"
'fa-ruby'
when "expression"
'fa fa-search'
when "playbook"
nil
else
'ff ff-method'
end
end
end
1 change: 1 addition & 0 deletions app/presenters/tree_node/miq_ae_method.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module TreeNode
class MiqAeMethod < MiqAeNode
set_attribute(:image) { @object.try(:decorate).try(:fileicon) }
end
end
5 changes: 4 additions & 1 deletion app/views/miq_ae_class/_class_methods.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
%td.table-view-pf-select.noclick
%input{:type => 'checkbox', :value => cls_cid}
%td.table-view-pf-select
%i{:class => record.decorate.fonticon}
- if record.decorate.try(:fileicon)
%img{:src => ActionController::Base.helpers.image_path(record.decorate.fileicon)}
- else
%i{:class => record.decorate.fonticon}
%td
= record_name(record)
:javascript
Expand Down
2 changes: 1 addition & 1 deletion spec/presenters/tree_node/miq_ae_method_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
let(:object) { FactoryGirl.create(:miq_ae_method, :scope => :class, :language => :ruby, :location => :inline) }

include_examples 'TreeNode::Node#key prefix', 'aem-'
include_examples 'TreeNode::Node#icon', 'ff ff-method'
include_examples 'TreeNode::Node#icon', 'fa-ruby'
include_examples 'TreeNode::Node#tooltip prefix', 'Automate Method'
end