summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-11 17:49:06 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-11 17:49:06 +0000
commitcb6ad67f52c9e849e0f8ca34b2fff47c585bd816 (patch)
treedb0a79d9c02b2e9cfc4516fa87edc8281dc7adb9
parenta0cd4f8fb4b67b080e30ac7975b7b840d9de286e (diff)
parent4a2b7cef5721a4524ae829e1227c7aa7e16a426a (diff)
downloadgitlab-ce-cb6ad67f52c9e849e0f8ca34b2fff47c585bd816.tar.gz
Merge branch 'check-out-branch-button' into 'master'
Add "Check out branch" button to the MR page. I appreciated the thought behind adding the "Fetch this branch using ..." line, but not so much the implementation. I think a "Check out branch" button alongside the existing "Download as" makes more sense to get instructions on how to get the changes on your local machine, since that's pretty much what "Download as" does as well. Like the "command line", the button opens the command line merge instructions modal. I've improved the text of that modal in !1120. ![Screen_Shot_2015-08-08_at_22.10.19](https://gitlab.com/gitlab-org/gitlab-ce/uploads/fd185df012e9759dfea198ed9fa3f80f/Screen_Shot_2015-08-08_at_22.10.19.png) It looks even better in combination with !1121, which gets rid of the "If you want to ..." line: ![Screen_Shot_2015-08-08_at_22.10.55](https://gitlab.com/gitlab-org/gitlab-ce/uploads/3fa469d0e2bd4e3ec4992ffa5864c718/Screen_Shot_2015-08-08_at_22.10.55.png) cc @dzaporozhets @rspeicher See merge request !1116
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/stylesheets/pages/merge_requests.scss4
-rw-r--r--app/views/projects/merge_requests/_show.html.haml26
-rw-r--r--features/steps/project/merge_requests.rb2
4 files changed, 22 insertions, 11 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a157a53d6e6..e14255ee9b2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -47,6 +47,7 @@ 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)
+ - Add "Check out branch" button to the MR page.
- Improve MR merge widget text and UI consistency.
- Improve text in MR "How To Merge" modal.
- Cache all events
diff --git a/app/assets/stylesheets/pages/merge_requests.scss b/app/assets/stylesheets/pages/merge_requests.scss
index 30bbec7b795..10fce5b3daa 100644
--- a/app/assets/stylesheets/pages/merge_requests.scss
+++ b/app/assets/stylesheets/pages/merge_requests.scss
@@ -186,3 +186,7 @@
#modal_merge_info .modal-dialog {
width: 600px;
}
+
+.mr-source-target {
+ line-height: 31px;
+}
diff --git a/app/views/projects/merge_requests/_show.html.haml b/app/views/projects/merge_requests/_show.html.haml
index 2662e3aff6b..cd53856c4a6 100644
--- a/app/views/projects/merge_requests/_show.html.haml
+++ b/app/views/projects/merge_requests/_show.html.haml
@@ -5,19 +5,25 @@
%hr
= render "projects/merge_requests/show/mr_box"
%hr
- .append-bottom-20
+ .append-bottom-20.mr-source-target
- if @merge_request.open?
- .btn-group.btn-group-sm.pull-right
- %a.btn.btn-sm.dropdown-toggle{ data: {toggle: :dropdown} }
- = icon('download')
- Download as
- %span.caret
- %ul.dropdown-menu
- %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch)
- %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff)
+ .pull-right
+ - if @merge_request.source_branch_exists?
+ = link_to "#modal_merge_info", class: "btn btn-sm", "data-toggle" => "modal" do
+ = icon('cloud-download fw')
+ Check out branch
+
+ %span.dropdown
+ %a.btn.btn-sm.dropdown-toggle{ data: {toggle: :dropdown} }
+ = icon('download')
+ Download as
+ %span.caret
+ %ul.dropdown-menu
+ %li= link_to "Email Patches", merge_request_path(@merge_request, format: :patch)
+ %li= link_to "Plain Diff", merge_request_path(@merge_request, format: :diff)
.light
%div
- %span From
+ %span Request to merge
%span.label-branch #{source_branch_with_namespace(@merge_request)}
%span into
%span.label-branch #{@merge_request.target_branch}
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index a1a26abd8ca..04784207a1a 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -326,7 +326,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I should see new target branch changes' do
- expect(page).to have_content 'From fix into feature'
+ expect(page).to have_content 'Request to merge fix into feature'
expect(page).to have_content 'Target branch changed from master to feature'
end