Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-20 00:08:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-20 00:08:32 +0300
commit60082b335c09b27ebee3452a36cc62eb76df3480 (patch)
tree8a34e789590856679bca7955cda7fda06e257590 /app/helpers/services_helper.rb
parentce493944f48fb2ad08a5381a7ed1f37ced637bd1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/services_helper.rb')
-rw-r--r--app/helpers/services_helper.rb37
1 files changed, 22 insertions, 15 deletions
diff --git a/app/helpers/services_helper.rb b/app/helpers/services_helper.rb
index fe839b92ba6..a9d70522d9b 100644
--- a/app/helpers/services_helper.rb
+++ b/app/helpers/services_helper.rb
@@ -44,13 +44,6 @@ module ServicesHelper
end
end
- def event_action_description(action)
- case action
- when "comment"
- s_("ProjectService|Comment will be posted on each event")
- end
- end
-
def service_save_button
button_tag(class: 'btn btn-success', type: 'submit', data: { qa_selector: 'save_changes_button' }) do
icon('spinner spin', class: 'hidden js-btn-spinner') +
@@ -90,7 +83,7 @@ module ServicesHelper
def scoped_test_integration_path(integration)
if @project.present?
- test_project_settings_integration_path(@project, integration)
+ test_project_service_path(@project, integration)
elsif @group.present?
test_group_settings_integration_path(@group, integration)
else
@@ -102,22 +95,36 @@ module ServicesHelper
Feature.enabled?(:integration_form_refactor, @project)
end
- def trigger_events_for_service
+ def integration_form_data(integration)
+ {
+ show_active: integration.show_active_box?.to_s,
+ activated: (integration.active || integration.new_record?).to_s,
+ type: integration.to_param,
+ merge_request_events: integration.merge_requests_events.to_s,
+ commit_events: integration.commit_events.to_s,
+ enable_comments: integration.comment_on_event_enabled.to_s,
+ comment_detail: integration.comment_detail,
+ trigger_events: trigger_events_for_service(integration),
+ fields: fields_for_service(integration)
+ }
+ end
+
+ def trigger_events_for_service(integration)
return [] unless integration_form_refactor?
- ServiceEventSerializer.new(service: @service).represent(@service.configurable_events).to_json
+ ServiceEventSerializer.new(service: integration).represent(integration.configurable_events).to_json
end
- def fields_for_service
+ def fields_for_service(integration)
return [] unless integration_form_refactor?
- ServiceFieldSerializer.new(service: @service).represent(@service.global_fields).to_json
+ ServiceFieldSerializer.new(service: integration).represent(integration.global_fields).to_json
end
- def show_service_trigger_events?
- return false if @service.is_a?(JiraService) || integration_form_refactor?
+ def show_service_trigger_events?(integration)
+ return false if integration.is_a?(JiraService) || integration_form_refactor?
- @service.configurable_events.present?
+ integration.configurable_events.present?
end
extend self