summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-05-12 17:26:20 +0000
committerClement Ho <ClemMakesApps@gmail.com>2017-05-19 13:53:06 -0500
commit125e1151f85fb1d5ace3213e86a85c3afe99808b (patch)
treef94f71bc4c2e1c9e6f8fc83609f0d987beee9153
parentb9934e7081a28e8ad90e35c9fa380517560e21ce (diff)
downloadgitlab-ce-125e1151f85fb1d5ace3213e86a85c3afe99808b.tar.gz
Merge branch 'dm-copy-mr-source-branch-as-gfm' into 'master'
Paste a copied MR source branch name as code when pasted into a GFM form See merge request !11315
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js9
-rw-r--r--changelogs/unreleased/dm-copy-mr-source-branch-as-gfm.yml4
2 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
index 272dae25455..cfd34970f11 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
+++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.js
@@ -12,6 +12,15 @@ export default {
commitsText() {
return gl.text.pluralize('commit', this.mr.divergedCommitsCount);
},
+ branchNameClipboardData() {
+ // This supports code in app/assets/javascripts/copy_to_clipboard.js that
+ // works around ClipboardJS limitations to allow the context-specific
+ // copy/pasting of plain text or GFM.
+ return JSON.stringify({
+ text: this.mr.sourceBranch,
+ gfm: `\`${this.mr.sourceBranch}\``,
+ });
+ },
},
methods: {
isBranchTitleLong(branchTitle) {
diff --git a/changelogs/unreleased/dm-copy-mr-source-branch-as-gfm.yml b/changelogs/unreleased/dm-copy-mr-source-branch-as-gfm.yml
new file mode 100644
index 00000000000..708c82604ad
--- /dev/null
+++ b/changelogs/unreleased/dm-copy-mr-source-branch-as-gfm.yml
@@ -0,0 +1,4 @@
+---
+title: Paste a copied MR source branch name as code when pasted into a GFM form
+merge_request:
+author: