Skip to content

Commit

Permalink
Set the bottom right quad tooltip for providers and hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Jun 1, 2018
1 parent 104f44e commit 7f16269
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 26 deletions.
4 changes: 1 addition & 3 deletions app/decorators/ext_management_system_decorator.rb
Expand Up @@ -19,9 +19,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status, enabled?))
:bottom_right => QuadiconHelper.provider_status(authentication_status, enabled?)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
4 changes: 1 addition & 3 deletions app/decorators/host_decorator.rb
Expand Up @@ -15,9 +15,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status))
:bottom_right => QuadiconHelper.provider_status(authentication_status)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
4 changes: 1 addition & 3 deletions app/decorators/manageiq/providers/cloud_manager_decorator.rb
Expand Up @@ -19,9 +19,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status, enabled?))
:bottom_right => QuadiconHelper.provider_status(authentication_status, enabled?)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -19,9 +19,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status, enabled?))
:bottom_right => QuadiconHelper.provider_status(authentication_status, enabled?)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
4 changes: 1 addition & 3 deletions app/decorators/manageiq/providers/infra_manager_decorator.rb
Expand Up @@ -19,9 +19,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status, enabled?))
:bottom_right => QuadiconHelper.provider_status(authentication_status, enabled?)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -25,9 +25,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status, enabled?))
:bottom_right => QuadiconHelper.provider_status(authentication_status, enabled?)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
Expand Up @@ -19,9 +19,7 @@ def quadicon
:fileicon => fileicon,
:tooltip => ui_lookup(:model => type)
},
:bottom_right => {
:tooltip => authentication_status
}.merge(QuadiconHelper.provider_status(authentication_status, enabled?))
:bottom_right => QuadiconHelper.provider_status(authentication_status, enabled?)
}
icon[:middle] = { :fileicon => '100/shield.png' } if get_policies.present?
icon
Expand Down
13 changes: 8 additions & 5 deletions app/helpers/quadicon_helper.rb
Expand Up @@ -31,17 +31,20 @@ module QuadiconHelper

def self.provider_status(status, enabled = true)
# If the provider is suspended, we don't care about the status itself
return { :fonticon => 'pficon pficon-asleep' } unless enabled
return {
:fonticon => 'pficon pficon-asleep',
:tooltip => _('This provider is paused, no data is currently collected from it')
} unless enabled

case status
when "Invalid"
{:fileicon => '100/x.png'}
{:fileicon => '100/x.png', :tooltip => _('Invalid authentication credentials')}
when "Valid"
{:fileicon => '100/checkmark.png'}
{:fileicon => '100/checkmark.png', :tooltip => _('Authentication credentials are valid')}
when "None"
{:fileicon => '100/unknown.png'}
{:fileicon => '100/unknown.png', :tooltip => _('Could not determine the authentication status')}
else
{:fileicon => '100/exclamationpoint.png'}
{:fileicon => '100/exclamationpoint.png', :tooltip => _('Authentication status is %{status}') % {:status => status} }
end
end

Expand Down

0 comments on commit 7f16269

Please sign in to comment.