From 269e39e807e999e50b75769476cf765d8fd3cee5 Mon Sep 17 00:00:00 2001 From: Lukas Eipert Date: Fri, 21 Sep 2018 09:33:35 +0200 Subject: Fix merge request header margins --- .../components/mr_widget_header.vue | 60 +++++++++++++--------- .../leipert-fix-mr-widget-header-margins.yml | 5 ++ 2 files changed, 40 insertions(+), 25 deletions(-) create mode 100644 changelogs/unreleased/leipert-fix-mr-widget-header-margins.yml diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue index 4c3f8dff3c4..acfdab3a015 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue @@ -28,11 +28,17 @@ export default { return this.mr.divergedCommitsCount > 0; }, commitsBehindText() { - return sprintf(s__('mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch'), { - commitsBehindLinkStart: ``, - commitsBehind: n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount), - commitsBehindLinkEnd: '', - }, false); + return sprintf( + s__( + 'mrWidget|The source branch is %{commitsBehindLinkStart}%{commitsBehind}%{commitsBehindLinkEnd} the target branch', + ), + { + commitsBehindLinkStart: ``, + commitsBehind: n__('%d commit behind', '%d commits behind', this.mr.divergedCommitsCount), + commitsBehindLinkEnd: '', + }, + false, + ); }, branchNameClipboardData() { // This supports code in app/assets/javascripts/copy_to_clipboard.js that @@ -45,17 +51,24 @@ export default { }, webIdePath() { if (this.mr.canPushToSourceBranch) { - return mergeUrlParams({ - target_project: this.mr.sourceProjectFullPath !== this.mr.targetProjectFullPath ? - this.mr.targetProjectFullPath : '', - }, webIDEUrl(`/${this.mr.sourceProjectFullPath}/merge_requests/${this.mr.iid}`)); + return mergeUrlParams( + { + target_project: + this.mr.sourceProjectFullPath !== this.mr.targetProjectFullPath + ? this.mr.targetProjectFullPath + : '', + }, + webIDEUrl(`/${this.mr.sourceProjectFullPath}/merge_requests/${this.mr.iid}`), + ); } return null; }, ideButtonTitle() { 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 {
- - - {{ s__("mrWidget|Open in Web IDE") }} - - + {{ s__("mrWidget|Open in Web IDE") }} + - +