Hide password in the service settings form
This commit is contained in:
parent
2fa89a3dc6
commit
731b860976
5 changed files with 14 additions and 3 deletions
|
@ -26,6 +26,7 @@ v 8.1.0 (unreleased)
|
|||
- Show additions/deletions stats on merge request diff
|
||||
- Remove footer text in emails (Zeger-Jan van de Weg)
|
||||
- Ensure code blocks are properly highlighted after a note is updated
|
||||
- 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,6 +8,9 @@
|
|||
- help = field[:help]
|
||||
|
||||
.form-group
|
||||
- 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'
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue