summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-06-15 22:48:39 +0000
committerJacob Schatz <jschatz@gitlab.com>2016-06-15 22:48:39 +0000
commit5d16d50cebb115773c1a16a141adab150eec8764 (patch)
tree792544b2191e9389125b67bb69e117ab375dc776
parent433e0a41cba9ad15269208b8bb92462180b17306 (diff)
parenta9d14ddcedb7c126b8ee4942b0ca6e794ff996f8 (diff)
downloadgitlab-ce-5d16d50cebb115773c1a16a141adab150eec8764.tar.gz
Merge branch 'toggle-whitespace-button-for-compare-page' into 'master'
Toggle whitespace button for compare page ## What does this MR do? Adds whitespace button to compare branches page. ## Are there points in the code the reviewer needs to double check? Ruby code. ## Why was this MR needed? Compare branches UX ## What are the relevant issue numbers? Closes #17881. ## Screenshots (if relevant) ![Screen_Shot_2016-06-09_at_18.39.48](/uploads/8995a7bc8bea7fa3ff19446ebe49fb88/Screen_Shot_2016-06-09_at_18.39.48.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - [ ] Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4569
-rw-r--r--CHANGELOG1
-rw-r--r--app/helpers/diff_helper.rb5
-rw-r--r--app/views/projects/diffs/_diffs.html.haml2
3 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 03b9178da3b..7cf9744f62a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -57,6 +57,7 @@ v 8.9.0 (unreleased)
- Add support for using Yubikeys (U2F) for two-factor authentication
- Link to blank group icon doesn't throw a 404 anymore
- Remove 'main language' feature
+ - Toggle whitespace button now available for compare branches diffs #17881
- Pipelines can be canceled only when there are running builds
- Use downcased path to container repository as this is expected path by Docker
- Projects pending deletion will render a 404 page
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index cbe47176831..e22dce59d0f 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -135,6 +135,11 @@ module DiffHelper
toggle_whitespace_link(url, options)
end
+ def diff_compare_whitespace_link(project, from, to, options)
+ url = namespace_project_compare_path(project.namespace, project, from, to, params_with_whitespace)
+ toggle_whitespace_link(url, options)
+ end
+
private
def hide_whitespace?
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 6c11afbe420..f18bc8c41b3 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -11,6 +11,8 @@
= commit_diff_whitespace_link(@project, @commit, class: 'hidden-xs')
- elsif current_controller?(:merge_requests)
= diff_merge_request_whitespace_link(@project, @merge_request, class: 'hidden-xs')
+ - elsif current_controller?(:compare)
+ = diff_compare_whitespace_link(@project, params[:from], params[:to], class: 'hidden-xs')
.btn-group
= inline_diff_btn
= parallel_diff_btn