Commit 269e39e8 authored by Lukas Eipert's avatar Lukas Eipert

Fix merge request header margins

parent 4ce9f2fd
...@@ -28,11 +28,17 @@ export default { ...@@ -28,11 +28,17 @@ export default {
return this.mr.divergedCommitsCount > 0; return this.mr.divergedCommitsCount > 0;
}, },
commitsBehindText() { commitsBehindText() {
return sprintf(s__('mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch'), { return sprintf(
commitsBehindLinkStart: `<a href="${_.escape(this.mr.targetBranchPath)}">`, s__(
commitsBehind: n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount), 'mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch',
commitsBehindLinkEnd: '</a>', ),
}, false); {
commitsBehindLinkStart: `<a href="${_.escape(this.mr.targetBranchPath)}">`,
commitsBehind: n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount),
commitsBehindLinkEnd: '</a>',
},
false,
);
}, },
branchNameClipboardData() { branchNameClipboardData() {
// This supports code in app/assets/javascripts/copy_to_clipboard.js that // This supports code in app/assets/javascripts/copy_to_clipboard.js that
...@@ -45,17 +51,24 @@ export default { ...@@ -45,17 +51,24 @@ export default {
}, },
webIdePath() { webIdePath() {
if (this.mr.canPushToSourceBranch) { if (this.mr.canPushToSourceBranch) {
return mergeUrlParams({ return mergeUrlParams(
target_project: this.mr.sourceProjectFullPath !== this.mr.targetProjectFullPath ? {
this.mr.targetProjectFullPath : '', target_project:
}, webIDEUrl(`/${this.mr.sourceProjectFullPath}/merge_requests/${this.mr.iid}`)); this.mr.sourceProjectFullPath !== this.mr.targetProjectFullPath
? this.mr.targetProjectFullPath
: '',
},
webIDEUrl(`/${this.mr.sourceProjectFullPath}/merge_requests/${this.mr.iid}`),
);
} }
return null; return null;
}, },
ideButtonTitle() { ideButtonTitle() {
return !this.mr.canPushToSourceBranch return !this.mr.canPushToSourceBranch
? s__('mrWidget|You are not allowed to edit this project directly. Please fork to make changes.') ? s__(
'mrWidget|You are not allowed to edit this project directly. Please fork to make changes.',
)
: ''; : '';
}, },
}, },
...@@ -104,37 +117,34 @@ export default { ...@@ -104,37 +117,34 @@ export default {
<div <div
v-if="mr.isOpen" v-if="mr.isOpen"
class="branch-actions" class="branch-actions d-flex"
> >
<span <a
v-if="!mr.sourceBranchRemoved"
v-tooltip v-tooltip
:href="webIdePath"
:title="ideButtonTitle" :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" data-placement="bottom"
tabindex="0" tabindex="0"
role="button"
> >
<a {{ s__("mrWidget|Open in Web IDE") }}
v-if="!mr.sourceBranchRemoved" </a>
:href="webIdePath"
:class="{ disabled: !mr.canPushToSourceBranch }"
class="btn btn-default inline js-web-ide d-none d-md-inline-block"
role="button"
>
{{ s__("mrWidget|Open in Web IDE") }}
</a>
</span>
<button <button
:disabled="mr.sourceBranchRemoved" :disabled="mr.sourceBranchRemoved"
data-target="#modal_merge_info" data-target="#modal_merge_info"
data-toggle="modal" data-toggle="modal"
class="btn btn-default inline js-check-out-branch" class="btn btn-default js-check-out-branch append-right-default"
type="button" type="button"
> >
{{ s__("mrWidget|Check out branch") }} {{ s__("mrWidget|Check out branch") }}
</button> </button>
<span class="dropdown prepend-left-10"> <span class="dropdown">
<button <button
type="button" type="button"
class="btn inline dropdown-toggle" class="btn dropdown-toggle"
data-toggle="dropdown" data-toggle="dropdown"
aria-label="Download as" aria-label="Download as"
aria-haspopup="true" aria-haspopup="true"
......
---
title: Fix merge request header margins
merge_request: 21878
author:
type: other
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