Commit 0d57e944 authored by Jacob Schatz's avatar Jacob Schatz Committed by Robert Speicher

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
parent 13fa884e
......@@ -71,6 +71,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
- Allow authentication using personal access tokens
- Use downcased path to container repository as this is expected path by Docker
......
......@@ -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?
......
......@@ -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
......
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