Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
514c0050
Commit
514c0050
authored
Apr 03, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
2c432b45
6202820c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
42 deletions
+43
-42
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
.../vue_merge_request_widget/components/mr_widget_header.vue
+25
-23
changelogs/unreleased/29249-show-download-diff-even-when-merge-request-is-closed.yml
...-show-download-diff-even-when-merge-request-is-closed.yml
+5
-0
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
...scripts/vue_mr_widget/components/mr_widget_header_spec.js
+13
-19
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
View file @
514c0050
...
...
@@ -109,29 +109,31 @@ export default {
></div>
</div>
<div
v-if=
"mr.isOpen"
class=
"branch-actions d-flex"
>
<a
v-if=
"!mr.sourceBranchRemoved"
v-tooltip
:href=
"webIdePath"
:title=
"ideButtonTitle"
:class=
"
{ disabled: !mr.canPushToSourceBranch }"
class="btn btn-default js-web-ide d-none d-md-inline-block append-right-8"
data-placement="bottom"
tabindex="0"
role="button"
>
{{
s__
(
'
mrWidget|Open in Web IDE
'
)
}}
</a>
<button
:disabled=
"mr.sourceBranchRemoved"
data-target=
"#modal_merge_info"
data-toggle=
"modal"
class=
"btn btn-default js-check-out-branch append-right-default"
type=
"button"
>
{{
s__
(
'
mrWidget|Check out branch
'
)
}}
</button>
<div
class=
"branch-actions d-flex"
>
<template
v-if=
"mr.isOpen"
>
<a
v-if=
"!mr.sourceBranchRemoved"
v-tooltip
:href=
"webIdePath"
:title=
"ideButtonTitle"
:class=
"
{ disabled: !mr.canPushToSourceBranch }"
class="btn btn-default js-web-ide d-none d-md-inline-block append-right-8"
data-placement="bottom"
tabindex="0"
role="button"
>
{{
s__
(
'
mrWidget|Open in Web IDE
'
)
}}
</a>
<button
:disabled=
"mr.sourceBranchRemoved"
data-target=
"#modal_merge_info"
data-toggle=
"modal"
class=
"btn btn-default js-check-out-branch append-right-default"
type=
"button"
>
{{
s__
(
'
mrWidget|Check out branch
'
)
}}
</button>
</
template
>
<span
class=
"dropdown"
>
<button
type=
"button"
...
...
changelogs/unreleased/29249-show-download-diff-even-when-merge-request-is-closed.yml
0 → 100644
View file @
514c0050
---
title
:
Show download diff links for closed MRs
merge_request
:
26772
author
:
type
:
changed
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
View file @
514c0050
...
...
@@ -15,6 +15,16 @@ describe('MRWidgetHeader', () => {
gon
.
relative_url_root
=
''
;
});
const
expectDownloadDropdownItems
=
()
=>
{
const
downloadEmailPatchesEl
=
vm
.
$el
.
querySelector
(
'
.js-download-email-patches
'
);
const
downloadPlainDiffEl
=
vm
.
$el
.
querySelector
(
'
.js-download-plain-diff
'
);
expect
(
downloadEmailPatchesEl
.
textContent
.
trim
()).
toEqual
(
'
Email patches
'
);
expect
(
downloadEmailPatchesEl
.
getAttribute
(
'
href
'
)).
toEqual
(
'
/mr/email-patches
'
);
expect
(
downloadPlainDiffEl
.
textContent
.
trim
()).
toEqual
(
'
Plain diff
'
);
expect
(
downloadPlainDiffEl
.
getAttribute
(
'
href
'
)).
toEqual
(
'
/mr/plainDiffPath
'
);
};
describe
(
'
computed
'
,
()
=>
{
describe
(
'
shouldShowCommitsBehindText
'
,
()
=>
{
it
(
'
return true when there are divergedCommitsCount
'
,
()
=>
{
...
...
@@ -207,21 +217,7 @@ describe('MRWidgetHeader', () => {
});
it
(
'
renders download dropdown with links
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-download-email-patches
'
).
textContent
.
trim
()).
toEqual
(
'
Email patches
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-download-email-patches
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/mr/email-patches
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-download-plain-diff
'
).
textContent
.
trim
()).
toEqual
(
'
Plain diff
'
,
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-download-plain-diff
'
).
getAttribute
(
'
href
'
)).
toEqual
(
'
/mr/plainDiffPath
'
,
);
expectDownloadDropdownItems
();
});
});
...
...
@@ -250,10 +246,8 @@ describe('MRWidgetHeader', () => {
expect
(
button
).
toEqual
(
null
);
});
it
(
'
does not render download dropdown with links
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.js-download-email-patches
'
)).
toEqual
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.js-download-plain-diff
'
)).
toEqual
(
null
);
it
(
'
renders download dropdown with links
'
,
()
=>
{
expectDownloadDropdownItems
();
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment