Commit 1533dbf9 authored by Filipa Lacerda's avatar Filipa Lacerda

Uses long sha version of the merged commit in MR widget copy to clipboard button

parent 2a82179e
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
</a> </a>
<clipboard-button <clipboard-button
:title="__('Copy commit SHA to clipboard')" :title="__('Copy commit SHA to clipboard')"
:text="mr.shortMergeCommitSha" :text="mr.mergeCommitSha"
css-class="btn-default btn-transparent btn-clipboard js-mr-merged-copy-sha" css-class="btn-default btn-transparent btn-clipboard js-mr-merged-copy-sha"
/> />
</p> </p>
......
...@@ -26,6 +26,7 @@ export default class MergeRequestStore { ...@@ -26,6 +26,7 @@ export default class MergeRequestStore {
this.mergeStatus = data.merge_status; this.mergeStatus = data.merge_status;
this.commitMessage = data.merge_commit_message; this.commitMessage = data.merge_commit_message;
this.shortMergeCommitSha = data.short_merge_commit_sha; this.shortMergeCommitSha = data.short_merge_commit_sha;
this.mergeCommitSha = data.merge_commit_sha;
this.commitMessageWithDescription = data.merge_commit_message_with_description; this.commitMessageWithDescription = data.merge_commit_message_with_description;
this.commitsCount = data.commits_count; this.commitsCount = data.commits_count;
this.divergedCommitsCount = data.diverged_commits_count; this.divergedCommitsCount = data.diverged_commits_count;
......
---
title: Uses long sha version of the merged commit in MR widget copy to clipboard button
merge_request: 19955
author:
type: other
...@@ -39,7 +39,8 @@ describe('MRWidgetMerged', () => { ...@@ -39,7 +39,8 @@ describe('MRWidgetMerged', () => {
readableClosedAt: '', readableClosedAt: '',
}, },
updatedAt: 'mergedUpdatedAt', updatedAt: 'mergedUpdatedAt',
shortMergeCommitSha: 'asdf1234', shortMergeCommitSha: '958c0475',
mergeCommitSha: '958c047516e182dfc52317f721f696e8a1ee85ed',
mergeCommitPath: 'http://localhost:3000/root/nautilus/commit/f7ce827c314c9340b075657fd61c789fb01cf74d', mergeCommitPath: 'http://localhost:3000/root/nautilus/commit/f7ce827c314c9340b075657fd61c789fb01cf74d',
sourceBranch: 'bar', sourceBranch: 'bar',
targetBranch, targetBranch,
...@@ -153,7 +154,7 @@ describe('MRWidgetMerged', () => { ...@@ -153,7 +154,7 @@ describe('MRWidgetMerged', () => {
it('shows button to copy commit SHA to clipboard', () => { it('shows button to copy commit SHA to clipboard', () => {
expect(selectors.copyMergeShaButton).toExist(); expect(selectors.copyMergeShaButton).toExist();
expect(selectors.copyMergeShaButton.getAttribute('data-clipboard-text')).toBe(vm.mr.shortMergeCommitSha); expect(selectors.copyMergeShaButton.getAttribute('data-clipboard-text')).toBe(vm.mr.mergeCommitSha);
}); });
it('shows merge commit SHA link', () => { it('shows merge commit SHA link', () => {
......
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