Commit b5c12f74 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge remote-tracking branch 'public/hide_services_password'

parents 0e7b96bf 731b8609
......@@ -27,6 +27,7 @@ v 8.1.0 (unreleased)
- Remove footer text in emails (Zeger-Jan van de Weg)
- Ensure code blocks are properly highlighted after a note is updated
- Fix wrong access level badge on MR comments
- Hide password in the service settings form
v 8.0.3
- Fix URL shown in Slack notifications
......
......@@ -58,6 +58,8 @@ class Projects::ServicesController < Projects::ApplicationController
end
def service_params
params.require(:service).permit(ALLOWED_PARAMS)
service_params = params.require(:service).permit(ALLOWED_PARAMS)
service_params.delete("password") if service_params["password"].blank?
service_params
end
end
......@@ -8,7 +8,10 @@
- help = field[:help]
.form-group
= form.label name, title, class: "control-label"
- if type == "password" && value.present?
= form.label name, "Change #{title}", class: "control-label"
- else
= form.label name, title, class: "control-label"
.col-sm-10
- if type == 'text'
= form.text_field name, class: "form-control", placeholder: placeholder
......@@ -19,6 +22,6 @@
- elsif type == 'select'
= form.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
- elsif type == 'password'
= form.password_field name, value: value, class: 'form-control'
= form.password_field name, autocomplete: "new-password", class: 'form-control'
- if help
%span.help-block= help
......@@ -72,6 +72,7 @@ Feature: Project Services
And I click Atlassian Bamboo CI service link
And I fill Atlassian Bamboo CI settings
Then I should see Atlassian Bamboo CI service settings saved
And I should see empty field Change Password
Scenario: Activate jetBrains TeamCity CI service
When I visit project "Shop" services page
......
......@@ -202,6 +202,10 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
expect(find_field('Username').value).to eq 'user'
end
step 'I should see empty field Change Password' do
expect(find_field('Change Password').value).to be_nil
end
step 'I click JetBrains TeamCity CI service link' do
click_link 'JetBrains TeamCity CI'
end
......
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