diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/services/issuable/clone/base_service.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/services/issuable/clone/base_service.rb')
-rw-r--r-- | app/services/issuable/clone/base_service.rb | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/app/services/issuable/clone/base_service.rb b/app/services/issuable/clone/base_service.rb index 0d1640924e5..b2f9c083b5b 100644 --- a/app/services/issuable/clone/base_service.rb +++ b/app/services/issuable/clone/base_service.rb @@ -24,12 +24,34 @@ module Issuable private + def copy_award_emoji + AwardEmojis::CopyService.new(original_entity, new_entity).execute + end + + def copy_notes + Notes::CopyService.new(current_user, original_entity, new_entity).execute + end + def update_new_entity - rewriters = [ContentRewriter, AttributesRewriter] + update_new_entity_description + update_new_entity_attributes + copy_award_emoji + copy_notes + end - rewriters.each do |rewriter| - rewriter.new(current_user, original_entity, new_entity).execute - end + def update_new_entity_description + rewritten_description = MarkdownContentRewriterService.new( + current_user, + original_entity.description, + original_entity.project, + new_parent + ).execute + + new_entity.update!(description: rewritten_description) + end + + def update_new_entity_attributes + AttributesRewriter.new(current_user, original_entity, new_entity).execute end def update_old_entity @@ -47,7 +69,7 @@ module Issuable end def new_parent - new_entity.project || new_entity.group + new_entity.resource_parent end def group |