Commit 593e3ffc authored by Mateusz Bajorski's avatar Mateusz Bajorski

Fixed inconsistent descriptions and refactored reference checking

parent 26087ae9
...@@ -270,7 +270,7 @@ module QuickActions ...@@ -270,7 +270,7 @@ module QuickActions
desc 'Copy labels and milestone from other issue or merge request' desc 'Copy labels and milestone from other issue or merge request'
explanation do |issuable_id| explanation do |issuable_id|
"Copy labels and milestone from issue or merge_request \"#{issuable_id}\"." "Copy labels and milestone from issue or merge_request #{issuable_id}."
end end
params '#issue | !merge_request' params '#issue | !merge_request'
condition do condition do
...@@ -279,7 +279,7 @@ module QuickActions ...@@ -279,7 +279,7 @@ module QuickActions
end end
command :copy_metadata do |issuable_id| command :copy_metadata do |issuable_id|
source_issuable = extract_references(issuable_id, :issue).first source_issuable = extract_references(issuable_id, :issue).first
source_issuable = extract_references(issuable_id, :merge_request).first if !source_issuable.present? source_issuable ||= extract_references(issuable_id, :merge_request).first
if source_issuable.present? && source_issuable.project.id == issuable.project.id if source_issuable.present? && source_issuable.project.id == issuable.project.id
@updates[:add_label_ids] = source_issuable.labels.map(&:id) @updates[:add_label_ids] = source_issuable.labels.map(&:id)
......
...@@ -41,4 +41,4 @@ do. ...@@ -41,4 +41,4 @@ do.
| `/move path/to/project` | Moves issue to another project | | `/move path/to/project` | Moves issue to another project |
| `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` | | `/tableflip` | Append the comment with `(╯°□°)╯︵ ┻━┻` |
| `/shrug` | Append the comment with `¯\_(ツ)_/¯` | | `/shrug` | Append the comment with `¯\_(ツ)_/¯` |
| <code>/copy_metadata &lt; #issue &#124; !merge_request &gt;</code> | Copy labels and milestone from other issue or merge request | | <code>/copy_metadata #issue &#124; !merge_request </code> | Copy labels and milestone from other issue or merge request |
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment