Skip to content

Commit

Permalink
Display pficon-asleep icon in bottom-right quad for disabled providers
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jun 1, 2018
1 parent ec8a786 commit 5730840
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/decorators/ext_management_system_decorator.rb
Expand Up @@ -21,7 +21,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status))
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?))
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
2 changes: 1 addition & 1 deletion app/decorators/host_decorator.rb
Expand Up @@ -17,7 +17,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status))
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?))
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -21,7 +21,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status)),
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?)),
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -21,7 +21,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status)),
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?)),
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -21,7 +21,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status))
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?))
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -27,7 +27,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status))
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?))
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -21,7 +21,7 @@ def quadicon
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.status_icon(authentication_status))
}.merge(QuadiconHelper.status_icon(authentication_status, enabled?))
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
5 changes: 4 additions & 1 deletion app/helpers/quadicon_helper.rb
Expand Up @@ -29,7 +29,10 @@ module QuadiconHelper
'template' => {:fonticon => 'pficon pficon-template', :background => '#336699'},
}.freeze

def self.status_icon(status)
def self.status_icon(status, enabled = true)
# If the provider is suspended, we don't care about the status itself
return { :fonticon => 'pficon pficon-asleep' } unless enabled

case status
when "Invalid"
{:fileicon => '100/x.png'}
Expand Down

0 comments on commit 5730840

Please sign in to comment.