diff options
-rw-r--r-- | app/controllers/projects/services_controller.rb | 4 | ||||
-rw-r--r-- | app/views/projects/services/_form.html.haml | 4 | ||||
-rw-r--r-- | changelogs/unreleased/31511-jira-settings.yml | 2 | ||||
-rw-r--r-- | spec/features/projects/services/jira_service_spec.rb | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index 264665942f8..704f8cc8a79 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -4,7 +4,7 @@ class Projects::ServicesController < Projects::ApplicationController # Authorize before_action :authorize_admin_project! before_action :service, only: [:edit, :update, :test] - before_action :build_service, only: [:update, :test] + before_action :update_service, only: [:update, :test] respond_to :html @@ -50,7 +50,7 @@ class Projects::ServicesController < Projects::ApplicationController end end - def build_service + def update_service @service.assign_attributes(service_params[:service]) end diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index a51eb4c587e..9167789a69d 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -9,7 +9,7 @@ %p= @service.description .col-lg-9 - = form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'gl-show-field-errors form-horizontal js-integration-settings-form', data: { "can-test" => "#{@service.can_test?}", "test-url" => "#{test_namespace_project_service_path(@project.namespace, @project, @service)}" } }) do |form| + = form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'gl-show-field-errors form-horizontal js-integration-settings-form', data: { 'can-test' => @service.can_test?, 'test-url' => test_namespace_project_service_path } }) do |form| = render 'shared/service_settings', form: form, subject: @service .footer-block.row-content-block %button.btn.btn-save{ type: 'submit' } @@ -22,4 +22,4 @@ - disabled_class = 'disabled' - disabled_title = @service.disabled_title - = link_to "Cancel", namespace_project_settings_integrations_path(@project.namespace, @project), class: "btn btn-cancel" + = link_to 'Cancel', namespace_project_settings_integrations_path(@project.namespace, @project), class: 'btn btn-cancel' diff --git a/changelogs/unreleased/31511-jira-settings.yml b/changelogs/unreleased/31511-jira-settings.yml index 3592e92b49e..4f9ddb13ef6 100644 --- a/changelogs/unreleased/31511-jira-settings.yml +++ b/changelogs/unreleased/31511-jira-settings.yml @@ -1,4 +1,4 @@ --- -title: Simplify test&save actions when setting a service integration +title: Simplify testing and saving service integrations merge_request: 11599 author: diff --git a/spec/features/projects/services/jira_service_spec.rb b/spec/features/projects/services/jira_service_spec.rb index 9a092f4ed93..191a7103871 100644 --- a/spec/features/projects/services/jira_service_spec.rb +++ b/spec/features/projects/services/jira_service_spec.rb @@ -76,7 +76,7 @@ feature 'Setup Jira service', :feature, :js do end end - describe 'user sets Jira Service but keeps it non active' do + describe 'user sets Jira Service but keeps it disabled' do context 'when Jira connection test succeeds' do it 'activates the JIRA service' do click_link('JIRA') |