Skip to content

Commit

Permalink
Merge pull request #1068 from mzazrivec/dont_display_username_and_pas…
Browse files Browse the repository at this point in the history
…swords_twice

Credentials summary: don't display username & password twice
(cherry picked from commit 3577152)

https://bugzilla.redhat.com/show_bug.cgi?id=1458928
  • Loading branch information
martinpovolny authored and simaishi committed Jun 5, 2017
1 parent 8a7c48b commit 4addda7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions app/helpers/ansible_credential_helper/textual_summary.rb
Expand Up @@ -2,7 +2,7 @@ module AnsibleCredentialHelper::TextualSummary
include TextualMixins::TextualName

def textual_group_properties
TextualGroup.new(_("Properties"), %i(name type user created updated))
TextualGroup.new(_("Properties"), %i(name type created updated))
end

def textual_group_relationships
Expand All @@ -17,10 +17,10 @@ def textual_group_options

define_singleton_method "textual_#{key}" do
h = {:label => _(value[:label]), :title => _(value[:help_text])}
h[:value] = if value[:type] == :password && @record.options[key].present?
h[:value] = if value[:type] == :password && (@record.try(key).present? || @record.options[key].present?)
'●●●●●●●●'
else
@record.options[key]
@record.try(key) || @record.options[key]
end
h
end
Expand All @@ -33,10 +33,6 @@ def textual_type
{:label => _("Authentication Type"), :value => ui_lookup(:model => @record.type)}
end

def textual_user
{:label => _("User"), :value => @record.userid}
end

def textual_created
{:label => _("Created On"), :value => format_timezone(@record.created_on)}
end
Expand Down

0 comments on commit 4addda7

Please sign in to comment.