Commit b4297573 authored by Mark Chao's avatar Mark Chao Committed by Phil Hughes

Only display merge commit SHA when it exists

parent 0a89c0b8
...@@ -162,18 +162,20 @@ ...@@ -162,18 +162,20 @@
<span class="label-branch"> <span class="label-branch">
<a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a> <a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a>
</span> </span>
with <template v-if="mr.mergeCommitSha">
<a with
:href="mr.mergeCommitPath" <a
class="commit-sha js-mr-merged-commit-sha" :href="mr.mergeCommitPath"
v-text="mr.shortMergeCommitSha" class="commit-sha js-mr-merged-commit-sha"
> v-text="mr.shortMergeCommitSha"
</a> >
<clipboard-button </a>
:title="__('Copy commit SHA to clipboard')" <clipboard-button
:text="mr.mergeCommitSha" :title="__('Copy commit SHA to clipboard')"
css-class="btn-default btn-transparent btn-clipboard js-mr-merged-copy-sha" :text="mr.mergeCommitSha"
/> css-class="btn-default btn-transparent btn-clipboard js-mr-merged-copy-sha"
/>
</template>
</p> </p>
<p v-if="mr.sourceBranchRemoved"> <p v-if="mr.sourceBranchRemoved">
{{ s__("mrWidget|The source branch has been removed") }} {{ s__("mrWidget|The source branch has been removed") }}
......
---
title: Fix 'merged with' UI being displayed when merge request has no merge commit
merge_request: 22022
author:
type: fixed
...@@ -157,6 +157,16 @@ describe('MRWidgetMerged', () => { ...@@ -157,6 +157,16 @@ describe('MRWidgetMerged', () => {
expect(selectors.copyMergeShaButton.getAttribute('data-clipboard-text')).toBe(vm.mr.mergeCommitSha); expect(selectors.copyMergeShaButton.getAttribute('data-clipboard-text')).toBe(vm.mr.mergeCommitSha);
}); });
it('hides button to copy commit SHA if SHA does not exist', (done) => {
vm.mr.mergeCommitSha = null;
Vue.nextTick(() => {
expect(selectors.copyMergeShaButton).not.toExist();
expect(vm.$el.querySelector('.mr-info-list').innerText).not.toContain('with');
done();
});
});
it('shows merge commit SHA link', () => { it('shows merge commit SHA link', () => {
expect(selectors.mergeCommitShaLink).toExist(); expect(selectors.mergeCommitShaLink).toExist();
expect(selectors.mergeCommitShaLink.text).toContain(vm.mr.shortMergeCommitSha); expect(selectors.mergeCommitShaLink.text).toContain(vm.mr.shortMergeCommitSha);
......
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