From b8590da02401d8c3666c49277fbd8ae3d71d6dd0 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 8 Aug 2015 21:16:16 +0200 Subject: Improve MR merge widget text and UI consistency. --- CHANGELOG | 1 + .../merge_requests/widget/_closed.html.haml | 3 +- .../merge_requests/widget/_heading.html.haml | 7 ++--- .../merge_requests/widget/_locked.html.haml | 3 +- .../merge_requests/widget/_merged.html.haml | 24 ++++++++++------ .../projects/merge_requests/widget/_open.html.haml | 2 +- .../merge_requests/widget/open/_accept.html.haml | 6 ++-- .../merge_requests/widget/open/_archived.html.haml | 4 ++- .../merge_requests/widget/open/_check.html.haml | 4 +-- .../widget/open/_conflicts.html.haml | 17 ++++++------ .../widget/open/_missing_branch.html.haml | 32 +++++++++++----------- .../widget/open/_not_allowed.html.haml | 6 ++-- .../merge_requests/widget/open/_nothing.html.haml | 12 ++++---- .../merge_requests/widget/open/_reload.html.haml | 7 ++++- .../merge_requests/widget/open/_wip.html.haml | 16 +++-------- app/views/shared/issuable/_form.html.haml | 4 +-- 16 files changed, 79 insertions(+), 69 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4cb80322846..fe08c8e2bc0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -43,6 +43,7 @@ v 7.14.0 (unreleased) - Fetch code from forks to refs/merge-requests/:id/head when merge request created - Remove satellites - Remove comments and email addresses when publicly exposing ssh keys (Zeger-Jan van de Weg) + - Improve MR merge widget text and UI consistency. v 7.13.3 - Fix bug causing Bitbucket importer to crash when OAuth application had been removed. diff --git a/app/views/projects/merge_requests/widget/_closed.html.haml b/app/views/projects/merge_requests/widget/_closed.html.haml index b5704c502c8..6f85b89e2c4 100644 --- a/app/views/projects/merge_requests/widget/_closed.html.haml +++ b/app/views/projects/merge_requests/widget/_closed.html.haml @@ -6,4 +6,5 @@ - if @merge_request.closed_event by #{link_to_member(@project, @merge_request.closed_event.author, avatar: true)} #{time_ago_with_tooltip(@merge_request.closed_event.created_at)} - %p Changes were not merged into target branch + %p + The changes were not merged into the target branch. diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml index 17d529766e6..5c6827b54c4 100644 --- a/app/views/projects/merge_requests/widget/_heading.html.haml +++ b/app/views/projects/merge_requests/widget/_heading.html.haml @@ -9,16 +9,15 @@ %span CI build #{status} for #{@merge_request.last_commit_short_sha}. %span.ci-coverage - = link_to "View build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink" + = link_to "View build details", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink" .ci_widget = icon("spinner spin") - Checking for CI status for #{@merge_request.last_commit_short_sha} + Checking CI status for #{@merge_request.last_commit_short_sha} .ci_widget.ci-not_found{style: "display:none"} = icon("times-circle") - %span Can not find commit in the CI server - for #{@merge_request.last_commit_short_sha}. + %span Cannot find status on the CI server for #{@merge_request.last_commit_short_sha}. .ci_widget.ci-error{style: "display:none"} = icon("times-circle") diff --git a/app/views/projects/merge_requests/widget/_locked.html.haml b/app/views/projects/merge_requests/widget/_locked.html.haml index 13ec278847b..300a70d733a 100644 --- a/app/views/projects/merge_requests/widget/_locked.html.haml +++ b/app/views/projects/merge_requests/widget/_locked.html.haml @@ -2,7 +2,8 @@ = render 'projects/merge_requests/widget/heading' .mr-widget-body %h4 + = icon("spinner spin") Merge in progress... %p - Merging is in progress. While merging this request is locked and cannot be closed. + This merge request is in the process of being merged, during which time it is locked and cannot be closed. diff --git a/app/views/projects/merge_requests/widget/_merged.html.haml b/app/views/projects/merge_requests/widget/_merged.html.haml index a3b13140810..d22dfa085b8 100644 --- a/app/views/projects/merge_requests/widget/_merged.html.haml +++ b/app/views/projects/merge_requests/widget/_merged.html.haml @@ -7,23 +7,31 @@ by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)} #{time_ago_with_tooltip(@merge_request.merge_event.created_at)} %div - - if @source_branch.blank? - Source branch has been removed + - if !@merge_request.source_branch_exists? + = succeed '.' do + The changes were merged into + %span.label-branch= @merge_request.target_branch + The source branch has been removed. - - elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) && @merge_request.merged? + - elsif can_remove_branch?(@merge_request.source_project, @merge_request.source_branch) .remove_source_branch_widget - %p Changes merged into #{@merge_request.target_branch}. You can remove source branch now + %p + = succeed '.' do + The changes were merged into + %span.label-branch= @merge_request.target_branch + You can remove the source branch now. = link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do %i.fa.fa-times Remove Source Branch .remove_source_branch_widget.failed.hide - Failed to remove source branch '#{@merge_request.source_branch}' + %p + Failed to remove source branch '#{@merge_request.source_branch}'. .remove_source_branch_in_progress.hide - %i.fa.fa-spinner.fa-spin -   - Removing source branch '#{@merge_request.source_branch}'. Please wait. Page will be automatically reloaded.   + %p + = icon('spinner spin') + Removing source branch '#{@merge_request.source_branch}'. Please wait. This page will be automatically reload. :coffeescript $('.remove_source_branch').on 'click', -> diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml index f420cdcab49..0aad9bb3e88 100644 --- a/app/views/projects/merge_requests/widget/_open.html.haml +++ b/app/views/projects/merge_requests/widget/_open.html.haml @@ -22,6 +22,6 @@ .mr-widget-footer %span %i.fa.fa-check - Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'} + Accepting this merge request will close #{"issue".pluralize(@closes_issues.size)} = succeed '.' do != gfm(issues_sentence(@closes_issues)) diff --git a/app/views/projects/merge_requests/widget/open/_accept.html.haml b/app/views/projects/merge_requests/widget/open/_accept.html.haml index 1be98cbe8de..e1525f6aeb7 100644 --- a/app/views/projects/merge_requests/widget/open/_accept.html.haml +++ b/app/views/projects/merge_requests/widget/open/_accept.html.haml @@ -8,10 +8,10 @@ .accept-control.checkbox = label_tag :should_remove_source_branch, class: "remove_source_checkbox" do = check_box_tag :should_remove_source_branch - Remove source-branch + Remove source branch .accept-control - = link_to "#", class: "modify-merge-commit-link js-toggle-button", title: "Modify merge commit message" do - %i.fa.fa-edit + = link_to "#", class: "modify-merge-commit-link js-toggle-button" do + = icon('edit') Modify commit message .js-toggle-content.hide.prepend-top-20 = render 'shared/commit_message_container', params: params, diff --git a/app/views/projects/merge_requests/widget/open/_archived.html.haml b/app/views/projects/merge_requests/widget/open/_archived.html.haml index eaf113ee568..ab30fa6b243 100644 --- a/app/views/projects/merge_requests/widget/open/_archived.html.haml +++ b/app/views/projects/merge_requests/widget/open/_archived.html.haml @@ -1,2 +1,4 @@ +%h4 + Project is archived %p - %strong Archived projects do not provide commit access. + This merge request cannot be merged because archived projects cannot be written to. diff --git a/app/views/projects/merge_requests/widget/open/_check.html.haml b/app/views/projects/merge_requests/widget/open/_check.html.haml index e775447cb75..1fb0023ad1c 100644 --- a/app/views/projects/merge_requests/widget/open/_check.html.haml +++ b/app/views/projects/merge_requests/widget/open/_check.html.haml @@ -1,6 +1,6 @@ %strong - %i.fa.fa-spinner.fa-spin - Checking automatic merge… + = icon("spinner spin") + Checking ability to merge automatically... :coffeescript $ -> diff --git a/app/views/projects/merge_requests/widget/open/_conflicts.html.haml b/app/views/projects/merge_requests/widget/open/_conflicts.html.haml index 440a7aa1c61..e6c089fefb2 100644 --- a/app/views/projects/merge_requests/widget/open/_conflicts.html.haml +++ b/app/views/projects/merge_requests/widget/open/_conflicts.html.haml @@ -1,11 +1,10 @@ %h4 - This merge request contains merge conflicts that must be resolved. + = icon("exclamation-triangle") + This merge request contains merge conflicts -- if @merge_request.can_be_merged_by?(current_user) - %p - You can merge it manually using the - %strong - = link_to "command line", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" -- else - %p - Only those with write access to this repository can merge merge requests. +%p + Please resolve these conflicts or + - if @merge_request.can_be_merged_by?(current_user) + #{link_to "merge this request manually", "#modal_merge_info", class: "how_to_merge_link vlink", "data-toggle" => "modal"}. + - else + ask someone with write access to this repository to merge this request manually. diff --git a/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml b/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml index 1c565bae80a..c9f07629493 100644 --- a/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml +++ b/app/views/projects/merge_requests/widget/open/_missing_branch.html.haml @@ -1,16 +1,16 @@ -%h4 - Can't be merged -%p - This merge request can not be accepted because branch - - unless @merge_request.source_branch_exists? - %span.label.label-inverse= @merge_request.source_branch - does not exist in - %span.label.label-info= @merge_request.source_project_path - %br - %strong Please close this merge request and open a new merge request to change source branches. - - else - %span.label.label-inverse= @merge_request.target_branch - does not exist in - %span.label.label-info= @merge_request.target_project_path - %br - %strong Please close this merge request or change to another target branch. +- unless @merge_request.source_branch_exists? + %h4 + = icon("exclamation-triangle") + Source branch + %span.label-branch= source_branch_with_namespace(@merge_request) + does not exist + %p + Please restore the source branch or close this merge request and open a new merge request with a different source branch. +- else + %h4 + = icon("exclamation-triangle") + Target branch + %span.label-branch= @merge_request.target_branch + does not exist + %p + Please restore the target branch or use a different target branch. diff --git a/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml b/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml index 82f6ffd8fcb..a8145558ca8 100644 --- a/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml +++ b/app/views/projects/merge_requests/widget/open/_not_allowed.html.haml @@ -1,2 +1,4 @@ -%strong This request can be merged automatically. -Only those with write access to this repository can merge merge requests. +%h4 + Ready to be merged automatically +%p + Ask someone with write access to this repository to merge this request. diff --git a/app/views/projects/merge_requests/widget/open/_nothing.html.haml b/app/views/projects/merge_requests/widget/open/_nothing.html.haml index 4d526576bc2..705bd55a940 100644 --- a/app/views/projects/merge_requests/widget/open/_nothing.html.haml +++ b/app/views/projects/merge_requests/widget/open/_nothing.html.haml @@ -1,8 +1,8 @@ -%h4 Nothing to merge -%p +%h4 + = icon("exclamation-triangle") Nothing to merge from - %span.label-branch #{@merge_request.source_branch} + %span.label-branch= source_branch_with_namespace(@merge_request) to - %span.label-branch #{@merge_request.target_branch} - %br - Try to use different branches or push new code. + %span.label-branch= @merge_request.target_branch +%p + Please push new commits to the source branch or use a different target branch. diff --git a/app/views/projects/merge_requests/widget/open/_reload.html.haml b/app/views/projects/merge_requests/widget/open/_reload.html.haml index 5787f6efea4..0195cea0803 100644 --- a/app/views/projects/merge_requests/widget/open/_reload.html.haml +++ b/app/views/projects/merge_requests/widget/open/_reload.html.haml @@ -1 +1,6 @@ -This merge request cannot be merged. Try to reload the page. +%h4 + = icon("exclamation-triangle") + This merge request could not be merged automatically + +%p + Please reload the page to find out the reason. diff --git a/app/views/projects/merge_requests/widget/open/_wip.html.haml b/app/views/projects/merge_requests/widget/open/_wip.html.haml index 4ce3ab31278..0cf16542cc1 100644 --- a/app/views/projects/merge_requests/widget/open/_wip.html.haml +++ b/app/views/projects/merge_requests/widget/open/_wip.html.haml @@ -1,13 +1,5 @@ -- if @merge_request.can_be_merged_by?(current_user) - %h4 - This merge request cannot be accepted because it is marked as Work In Progress. +%h4 + This merge request is currently a Work In Progress - %p - %button.btn.disabled{:type => 'button'} - %i.fa.fa-warning - Accept Merge Request -   - When the merge request is ready, remove the "WIP" prefix from the title to allow it to be accepted. -- else - %strong This merge request is marked as Work In Progress. - Only those with write access to this repository can merge merge requests. +%p + When this merge request is ready, remove the "WIP" prefix from the title to allow it to be merged. diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index ac8c1936c9e..3489bf3f191 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -16,10 +16,10 @@ %p.help-block - if issuable.work_in_progress? Remove the WIP prefix from the title to allow this - Work In Progress merge request to be accepted when it's ready. + Work In Progress merge request to be merged when it's ready. - else Start the title with [WIP] or WIP: to prevent a - Work In Progress merge request from being accepted before it's ready. + Work In Progress merge request from being merged before it's ready. .form-group.issuable-description = f.label :description, 'Description', class: 'control-label' .col-sm-10 -- cgit v1.2.1 From b2334da40e897369521ae863b927d8127921cce6 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 8 Aug 2015 21:51:42 +0200 Subject: Improve text in MR "How To Merge" modal. --- CHANGELOG | 1 + .../merge_requests/show/_how_to_merge.html.haml | 55 ++++++++++++---------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index fe08c8e2bc0..2f552a441cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -44,6 +44,7 @@ v 7.14.0 (unreleased) - Remove satellites - Remove comments and email addresses when publicly exposing ssh keys (Zeger-Jan van de Weg) - Improve MR merge widget text and UI consistency. + - Improve text in MR "How To Merge" modal. v 7.13.3 - Fix bug causing Bitbucket importer to crash when OAuth application had been removed. diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 22f601ac99e..db1575f899a 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -3,42 +3,45 @@ .modal-content .modal-header %a.close{href: "#", "data-dismiss" => "modal"} × - %h3 How to merge + %h3 Check out, review and merge locally .modal-body - - if @merge_request.for_fork? - - source_remote = @merge_request.source_project.namespace.nil? ? "source" :@merge_request.source_project.namespace.path - - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path - %p - %strong Step 1. - Fetch the code and create a new branch pointing to it - %pre.dark + %p + %strong Step 1. + Fetch and check out the branch for this merge request + %pre.dark + - if @merge_request.for_fork? :preserve git fetch #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch} git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} FETCH_HEAD - %p - %strong Step 2. - Merge the branch and push the changes to GitLab - %pre.dark - :preserve - git checkout #{@merge_request.target_branch} - git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch} - git push origin #{@merge_request.target_branch} - - else - %p - %strong Step 1. - Update the repo and checkout the branch we are going to merge - %pre.dark + - else :preserve git fetch origin git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch} - %p - %strong Step 2. - Merge the branch and push the changes to GitLab - %pre.dark + %p + %strong Step 2. + Review the changes locally + + %p + %strong Step 3. + Merge the branch and fix any conflicts that come up + %pre.dark + - if @merge_request.for_fork? + :preserve + git checkout #{@merge_request.target_branch} + git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch} + - else :preserve git checkout #{@merge_request.target_branch} git merge --no-ff #{@merge_request.source_branch} - git push origin #{@merge_request.target_branch} + %p + %strong Step 4. + Push the result of the merge to GitLab + %pre.dark + :preserve + git push origin #{@merge_request.target_branch} + - unless @merge_request.can_be_merged_by?(current_user) + %p + Note that pushing to GitLab requires write access to this repository. :javascript $(function(){ -- cgit v1.2.1 From 211fe02848b33e911490366f441f1d7fa9d291f7 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sat, 8 Aug 2015 21:51:50 +0200 Subject: Tweak MR widget text some more. --- app/views/projects/merge_requests/widget/_closed.html.haml | 4 +++- app/views/projects/merge_requests/widget/open/_nothing.html.haml | 2 +- app/views/projects/merge_requests/widget/open/_reload.html.haml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/projects/merge_requests/widget/_closed.html.haml b/app/views/projects/merge_requests/widget/_closed.html.haml index 6f85b89e2c4..f3cc0e7e8a1 100644 --- a/app/views/projects/merge_requests/widget/_closed.html.haml +++ b/app/views/projects/merge_requests/widget/_closed.html.haml @@ -7,4 +7,6 @@ by #{link_to_member(@project, @merge_request.closed_event.author, avatar: true)} #{time_ago_with_tooltip(@merge_request.closed_event.created_at)} %p - The changes were not merged into the target branch. + = succeed '.' do + The changes were not merged into + %span.label-branch= @merge_request.target_branch diff --git a/app/views/projects/merge_requests/widget/open/_nothing.html.haml b/app/views/projects/merge_requests/widget/open/_nothing.html.haml index 705bd55a940..35626b624b7 100644 --- a/app/views/projects/merge_requests/widget/open/_nothing.html.haml +++ b/app/views/projects/merge_requests/widget/open/_nothing.html.haml @@ -2,7 +2,7 @@ = icon("exclamation-triangle") Nothing to merge from %span.label-branch= source_branch_with_namespace(@merge_request) - to + into %span.label-branch= @merge_request.target_branch %p Please push new commits to the source branch or use a different target branch. diff --git a/app/views/projects/merge_requests/widget/open/_reload.html.haml b/app/views/projects/merge_requests/widget/open/_reload.html.haml index 0195cea0803..acfc31725eb 100644 --- a/app/views/projects/merge_requests/widget/open/_reload.html.haml +++ b/app/views/projects/merge_requests/widget/open/_reload.html.haml @@ -1,6 +1,6 @@ %h4 = icon("exclamation-triangle") - This merge request could not be merged automatically + This merge request failed to be merged automatically %p Please reload the page to find out the reason. -- cgit v1.2.1 From e6bf9aa7194c5a2d1b5abb0b810a604fb604174a Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sun, 9 Aug 2015 17:34:28 +0200 Subject: Make modal narrower --- app/assets/stylesheets/pages/merge_requests.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss index 9af8227a52f..5922ac95a48 100644 --- a/app/assets/stylesheets/pages/merge_requests.scss +++ b/app/assets/stylesheets/pages/merge_requests.scss @@ -179,3 +179,7 @@ .merge-request-form .select2-container { width: 250px !important; } + +#modal_merge_info .modal-dialog { + width: 600px; +} -- cgit v1.2.1 From 78fba275c9bb052f666ea453068d7557200a634c Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Sun, 9 Aug 2015 17:44:34 +0200 Subject: More textual tweaks --- app/views/projects/merge_requests/widget/_heading.html.haml | 7 ++++--- app/views/projects/merge_requests/widget/_locked.html.haml | 2 +- app/views/projects/merge_requests/widget/open/_check.html.haml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/projects/merge_requests/widget/_heading.html.haml b/app/views/projects/merge_requests/widget/_heading.html.haml index 5c6827b54c4..4d4e2f68f61 100644 --- a/app/views/projects/merge_requests/widget/_heading.html.haml +++ b/app/views/projects/merge_requests/widget/_heading.html.haml @@ -3,6 +3,7 @@ - [:success, :skipped, :canceled, :failed, :running, :pending].each do |status| .ci_widget{class: "ci-#{status}", style: "display:none"} - if status == :success + - status = "passed" = icon("check-circle") - else = icon("circle") @@ -13,15 +14,15 @@ .ci_widget = icon("spinner spin") - Checking CI status for #{@merge_request.last_commit_short_sha} + Checking CI status for #{@merge_request.last_commit_short_sha}… .ci_widget.ci-not_found{style: "display:none"} = icon("times-circle") - %span Cannot find status on the CI server for #{@merge_request.last_commit_short_sha}. + Could not find CI status for #{@merge_request.last_commit_short_sha}. .ci_widget.ci-error{style: "display:none"} = icon("times-circle") - %span Cannot connect to the CI server. Please check your settings and try again. + Could not connect to the CI server. Please check your settings and try again. :coffeescript $ -> diff --git a/app/views/projects/merge_requests/widget/_locked.html.haml b/app/views/projects/merge_requests/widget/_locked.html.haml index 300a70d733a..78d0783cba0 100644 --- a/app/views/projects/merge_requests/widget/_locked.html.haml +++ b/app/views/projects/merge_requests/widget/_locked.html.haml @@ -3,7 +3,7 @@ .mr-widget-body %h4 = icon("spinner spin") - Merge in progress... + Merge in progress… %p This merge request is in the process of being merged, during which time it is locked and cannot be closed. diff --git a/app/views/projects/merge_requests/widget/open/_check.html.haml b/app/views/projects/merge_requests/widget/open/_check.html.haml index 1fb0023ad1c..b6b8974297e 100644 --- a/app/views/projects/merge_requests/widget/open/_check.html.haml +++ b/app/views/projects/merge_requests/widget/open/_check.html.haml @@ -1,6 +1,6 @@ %strong = icon("spinner spin") - Checking ability to merge automatically... + Checking ability to merge automatically… :coffeescript $ -> -- cgit v1.2.1