Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d7a383ff
Commit
d7a383ff
authored
Mar 09, 2021
by
Yogi
Committed by
Jose Ivan Vargas
Mar 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add selected state for diff view in commit page
parent
b6486b27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+1
-1
changelogs/unreleased/selected-state-commit-view.yml
changelogs/unreleased/selected-state-commit-view.yml
+5
-0
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
...es/merge_request/user_selects_branches_for_new_mr_spec.rb
+4
-4
No files found.
app/helpers/diff_helper.rb
View file @
d7a383ff
...
@@ -232,7 +232,7 @@ module DiffHelper
...
@@ -232,7 +232,7 @@ module DiffHelper
# Always use HTML to handle case where JSON diff rendered this button
# Always use HTML to handle case where JSON diff rendered this button
params_copy
.
delete
(
:format
)
params_copy
.
delete
(
:format
)
link_to
url_for
(
params_copy
),
id:
"
#{
name
}
-diff-btn"
,
class:
(
selected
?
'btn gl-button
active'
:
'btn gl-button
'
),
data:
{
view_type:
name
}
do
link_to
url_for
(
params_copy
),
id:
"
#{
name
}
-diff-btn"
,
class:
(
selected
?
'btn gl-button
btn-default selected'
:
'btn gl-button btn-default
'
),
data:
{
view_type:
name
}
do
title
title
end
end
end
end
...
...
changelogs/unreleased/selected-state-commit-view.yml
0 → 100644
View file @
d7a383ff
---
title
:
Add selected state for diff view in commit page
merge_request
:
54762
author
:
Yogi (@yo)
type
:
changed
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
View file @
d7a383ff
...
@@ -121,14 +121,14 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do
...
@@ -121,14 +121,14 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do
click_link
'Changes'
click_link
'Changes'
expect
(
page
).
to
have_css
(
'a.btn.
active
'
,
text:
'Inline'
)
expect
(
page
).
to
have_css
(
'a.btn.
selected
'
,
text:
'Inline'
)
expect
(
page
).
not_to
have_css
(
'a.btn.
active
'
,
text:
'Side-by-side'
)
expect
(
page
).
not_to
have_css
(
'a.btn.
selected
'
,
text:
'Side-by-side'
)
click_link
'Side-by-side'
click_link
'Side-by-side'
within
'.merge-request'
do
within
'.merge-request'
do
expect
(
page
).
not_to
have_css
(
'a.btn.
active
'
,
text:
'Inline'
)
expect
(
page
).
not_to
have_css
(
'a.btn.
selected
'
,
text:
'Inline'
)
expect
(
page
).
to
have_css
(
'a.btn.
active
'
,
text:
'Side-by-side'
)
expect
(
page
).
to
have_css
(
'a.btn.
selected
'
,
text:
'Side-by-side'
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
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