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