diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 15:07:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-22 15:07:28 +0300 |
commit | 4220cf46a314ac1c4d88be13608752bc07bb28fb (patch) | |
tree | 169db13fd06c7622bbcf59b707d57d516f44e299 /app/services/issuable_links | |
parent | 4c7e34071eceb05a9ce271354c21de7487e4ff84 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/issuable_links')
-rw-r--r-- | app/services/issuable_links/create_service.rb | 14 | ||||
-rw-r--r-- | app/services/issuable_links/destroy_service.rb | 6 |
2 files changed, 13 insertions, 7 deletions
diff --git a/app/services/issuable_links/create_service.rb b/app/services/issuable_links/create_service.rb index 802260c8fae..44f26ba52dc 100644 --- a/app/services/issuable_links/create_service.rb +++ b/app/services/issuable_links/create_service.rb @@ -2,8 +2,6 @@ module IssuableLinks class CreateService < BaseService - include IncidentManagement::UsageData - attr_reader :issuable, :current_user, :params def initialize(issuable, user, params) @@ -25,7 +23,7 @@ module IssuableLinks end @errors = [] - create_links + references = create_links if @errors.present? return error(@errors.join('. '), 422) @@ -33,7 +31,7 @@ module IssuableLinks track_event - success + success(created_references: references) end # rubocop: disable CodeReuse/ActiveRecord @@ -66,7 +64,7 @@ module IssuableLinks end def link_issuables(target_issuables) - target_issuables.each do |referenced_object| + target_issuables.map do |referenced_object| link = relate_issuables(referenced_object) unless link.valid? @@ -75,6 +73,8 @@ module IssuableLinks error: link.errors.messages.values.flatten.to_sentence } end + + link end end @@ -142,6 +142,10 @@ module IssuableLinks def set_link_type(_link) # no-op end + + def track_event + # no-op + end end end diff --git a/app/services/issuable_links/destroy_service.rb b/app/services/issuable_links/destroy_service.rb index 19edd008b0a..204cf7ce966 100644 --- a/app/services/issuable_links/destroy_service.rb +++ b/app/services/issuable_links/destroy_service.rb @@ -2,8 +2,6 @@ module IssuableLinks class DestroyService < BaseService - include IncidentManagement::UsageData - attr_reader :link, :current_user, :source, :target def initialize(link, user) @@ -41,5 +39,9 @@ module IssuableLinks def not_found_message 'No Issue Link found' end + + def track_event + # no op + end end end |