Commit 59d7f4c9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'use_password_field_defaults_for_services' into 'master'

Use password field defaults for services

Previously we masked the password field manually. After the refactor that services page received we can use `password_field` default masking.

Fixes internal https://dev.gitlab.org/gitlab/gitlab-ee/issues/314

See merge request !969
parents 13e987a6 057d45fb
...@@ -248,16 +248,6 @@ module ProjectsHelper ...@@ -248,16 +248,6 @@ module ProjectsHelper
end end
end end
def service_field_value(type, value)
return value unless type == 'password'
if value.present?
"***********"
else
nil
end
end
def user_max_access_in_project(user, project) def user_max_access_in_project(user, project)
level = project.team.max_member_access(user) level = project.team.max_member_access(user)
......
- name = field[:name] - name = field[:name]
- title = field[:title] || name.humanize - title = field[:title] || name.humanize
- value = service_field_value(field[:type], @service.send(name)) - value = @service.send(name)
- type = field[:type] - type = field[:type]
- placeholder = field[:placeholder] - placeholder = field[:placeholder]
- choices = field[:choices] - choices = field[:choices]
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
- elsif type == 'select' - elsif type == 'select'
= form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" } = form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
- elsif type == 'password' - elsif type == 'password'
= form.password_field name, placeholder: value, class: 'form-control' = form.password_field name, value: value, class: 'form-control'
- if help - if help
%span.help-block= help %span.help-block= help
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment