diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 01:45:44 +0000 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/controllers/projects/services_controller.rb | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) | |
download | gitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r-- | app/controllers/projects/services_controller.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index ca2a19e67b0..9a69ef991dd 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -20,7 +20,7 @@ class Projects::ServicesController < Projects::ApplicationController layout "project_settings" def edit - @admin_integration = Service.instance_for(service.type) + @default_integration = Service.default_integration(service.type, project) end def update @@ -65,18 +65,20 @@ class Projects::ServicesController < Projects::ApplicationController result = ::Integrations::Test::ProjectService.new(@service, current_user, params[:event]).execute unless result[:success] - return { error: true, message: _('Test failed.'), service_response: result[:message].to_s, test_failed: true } + return { error: true, message: s_('Integrations|Connection failed. Please check your settings.'), service_response: result[:message].to_s, test_failed: true } end {} rescue Gitlab::HTTP::BlockedUrlError => e - { error: true, message: _('Test failed.'), service_response: e.message, test_failed: true } + { error: true, message: s_('Integrations|Connection failed. Please check your settings.'), service_response: e.message, test_failed: true } end def success_message - message = @service.active? ? _('activated') : _('settings saved, but not activated') - - _('%{service_title} %{message}.') % { service_title: @service.title, message: message } + if @service.active? + s_('Integrations|%{integration} settings saved and active.') % { integration: @service.title } + else + s_('Integrations|%{integration} settings saved, but not active.') % { integration: @service.title } + end end def service |