Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
921162f5f4d8
Commit
921162f5
authored
Mar 25, 2015
by
Stan Hu
Browse files
Fix broken side-by-side diff view on merge request page
Closes #1294
parent
53388b72097d
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
921162f5
Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased)
- Fix broken side-by-side diff view on merge request page (Stan Hu)
- Allow HTML tags in Markdown input
- Fix code unfold not working on Compare commits page (Stan Hu)
- Include missing events and fix save functionality in admin service template settings form (Stan Hu)
...
...
app/helpers/diff_helper.rb
View file @
921162f5
...
...
@@ -121,6 +121,8 @@
def
inline_diff_btn
params_copy
=
params
.
dup
params_copy
[
:view
]
=
'inline'
# Always use HTML to handle case where JSON diff rendered this button
params_copy
.
delete
(
:format
)
link_to
url_for
(
params_copy
),
id:
"commit-diff-viewtype"
,
class:
(
params
[
:view
]
!=
'parallel'
?
'btn btn-sm active'
:
'btn btn-sm'
)
do
'Inline'
...
...
@@ -130,6 +132,8 @@
def
parallel_diff_btn
params_copy
=
params
.
dup
params_copy
[
:view
]
=
'parallel'
# Always use HTML to handle case where JSON diff rendered this button
params_copy
.
delete
(
:format
)
link_to
url_for
(
params_copy
),
id:
"commit-diff-viewtype"
,
class:
(
params
[
:view
]
==
'parallel'
?
'btn active btn-sm'
:
'btn btn-sm'
)
do
'Side-by-side'
...
...
features/project/merge_requests.feature
View file @
921162f5
...
...
@@ -166,6 +166,13 @@
And
I click Side-by-side Diff tab
Then
I should see comments on the side-by-side diff page
@javascript
Scenario
:
I
view diffs on a merge request
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I click on the Changes tab via Javascript
Then
I should see the proper Inline and Side-by-side links
# Task status in issues list
Scenario
:
Merge requests list should display task status
...
...
features/steps/project/merge_requests.rb
View file @
921162f5
...
...
@@ -117,6 +117,20 @@
visit
diffs_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
step
'I click on the Changes tab via Javascript'
do
find
(
'.diffs-tab'
).
click
sleep
2
end
step
'I should see the proper Inline and Side-by-side links'
do
buttons
=
all
(
'#commit-diff-viewtype'
)
expect
(
buttons
.
count
).
to
eq
(
2
)
buttons
.
each
do
|
b
|
expect
(
b
[
'href'
]).
should_not
have_content
(
'json'
)
end
end
step
'I switch to the merge request\'s comments tab'
do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment