Commit 91836272 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'mr-widget-text' into 'master'

Improve text of MR merge widget and manual merge modal

Modal with manual merge instructions:

![Screen_Shot_2015-08-08_at_21.30.23](https://gitlab.com/gitlab-org/gitlab-ce/uploads/2bffe42e9ad76afd02efbe5816027767/Screen_Shot_2015-08-08_at_21.30.23.png)

Archived:

![archived](https://gitlab.com/gitlab-org/gitlab-ce/uploads/e1efa1d54ce7ead8de6e88ca34095c09/archived.png)

WIP:

![wip](https://gitlab.com/gitlab-org/gitlab-ce/uploads/14a831458d0946722559ec643f91678c/wip.png)

Missing target branch:

![missing_branch](https://gitlab.com/gitlab-org/gitlab-ce/uploads/340083bbacbc234906e58cf76c586a9e/missing_branch.png)

Missing source branch:

![missing_branch_source](https://gitlab.com/gitlab-org/gitlab-ce/uploads/72f80ed58efed88b2bbcf403b55b1a01/missing_branch_source.png)

Nothing to merge:

![nothing](https://gitlab.com/gitlab-org/gitlab-ce/uploads/85b0d9da87acacd53cffd0df58d8eed4/nothing.png)

Checking ability to merge:

![check](https://gitlab.com/gitlab-org/gitlab-ce/uploads/32d75322e622025610c446e8ca7d892d/check.png)

Conflicts when allowed to merge:

![conflicts](https://gitlab.com/gitlab-org/gitlab-ce/uploads/23fdb2c60a27d873b3cc8a008203eb59/conflicts.png)

Conflicts when not allowed to merge:

![conflicts_not_allowed](https://gitlab.com/gitlab-org/gitlab-ce/uploads/113462a80fc65bf48b20dc0efd808363/conflicts_not_allowed.png)

Mergeable when allowed to merge:

![accept](https://gitlab.com/gitlab-org/gitlab-ce/uploads/1b3bb1a71df21728fe9318e7a083bfba/accept.png)

Mergeable when not allowed to merge:

![not_allowed](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d38fa5c96f8f9d7223bb6bc7ad36f29d/not_allowed.png)

Merge in progress:

![locked](https://gitlab.com/gitlab-org/gitlab-ce/uploads/b60dcf5eb70e6032b0e8aac766018df3/locked.png)

Merge failed:

![failed_2](https://gitlab.com/gitlab-org/gitlab-ce/uploads/3713b9a10298183935b028b658271ac9/failed_2.png)

Merged:

![merged](https://gitlab.com/gitlab-org/gitlab-ce/uploads/7f68a48dd197a71351c9a80c59c8ecbe/merged.png)

Closed:

![closed](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d5ce040449b7db943bd2fbfffb607a10/closed.png)

cc @dzaporozhets @rspeicher

See merge request !1120
parent eaba65fe
......@@ -47,6 +47,8 @@ v 7.14.0 (unreleased)
- Add support for CI skipped status
- Fetch code from forks to refs/merge-requests/:id/head when merge request created
- 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.
- Cache all events
- Order commits by date when comparing branches
- Fix bug causing error when the target branch of a symbolic ref was deleted
......
......@@ -182,3 +182,7 @@
.merge-request-form .select2-container {
width: 250px !important;
}
#modal_merge_info .modal-dialog {
width: 600px;
}
......@@ -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
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
- 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
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}
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
:preserve
git fetch origin
git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch}
git checkout #{@merge_request.target_branch}
git merge --no-ff #{@merge_request.source_branch}
%p
%strong Step 2.
Merge the branch and push the changes to GitLab
%strong Step 4.
Push the result of the merge to GitLab
%pre.dark
:preserve
git checkout #{@merge_request.target_branch}
git merge --no-ff #{@merge_request.source_branch}
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(){
......
......@@ -6,4 +6,7 @@
- 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
= succeed '.' do
The changes were not merged into
%span.label-branch= @merge_request.target_branch
......@@ -3,26 +3,26 @@
- [: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")
%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}.
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
$ ->
......
......@@ -2,7 +2,8 @@
= render 'projects/merge_requests/widget/heading'
.mr-widget-body
%h4
Merge in progress...
= 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.
......@@ -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', ->
......
......@@ -24,6 +24,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))
......@@ -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,
......
%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.
%strong
%i.fa.fa-spinner.fa-spin
Checking automatic merge…
= icon("spinner spin")
Checking ability to merge automatically…
:coffeescript
$ ->
......
%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.
%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.
%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.
%h4 Nothing to merge
%p
%h4
= icon("exclamation-triangle")
Nothing to merge from
%span.label-branch #{@merge_request.source_branch}
to
%span.label-branch #{@merge_request.target_branch}
%br
Try to use different branches or push new code.
%span.label-branch= source_branch_with_namespace(@merge_request)
into
%span.label-branch= @merge_request.target_branch
%p
Please push new commits to the source branch or use a different target branch.
This merge request cannot be merged. Try to reload the page.
%h4
= icon("exclamation-triangle")
This merge request failed to be merged automatically
%p
Please reload the page to find out the reason.
- 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.
......@@ -16,10 +16,10 @@
%p.help-block
- if issuable.work_in_progress?
Remove the <code>WIP</code> prefix from the title to allow this
<strong>Work In Progress</strong> merge request to be accepted when it's ready.
<strong>Work In Progress</strong> merge request to be merged when it's ready.
- else
Start the title with <code>[WIP]</code> or <code>WIP:</code> to prevent a
<strong>Work In Progress</strong> merge request from being accepted before it's ready.
<strong>Work In Progress</strong> merge request from being merged before it's ready.
.form-group.issuable-description
= f.label :description, 'Description', class: 'control-label'
.col-sm-10
......
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