BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f3fd6547
Commit
f3fd6547
authored
Mar 09, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'diff-avatar-improvements' into 'master'
Diff avatar improvements Closes #29237, #29238, and #29243 See merge request !9829
parents
d163ac26
aa9aa11d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
4 deletions
+54
-4
_line.html.haml
app/views/projects/diffs/_line.html.haml
+2
-2
_parallel_view.html.haml
app/views/projects/diffs/_parallel_view.html.haml
+2
-2
diff_notes_avatars_spec.rb
spec/features/merge_requests/diff_notes_avatars_spec.rb
+50
-0
No files found.
app/views/projects/diffs/_line.html.haml
View file @
f3fd6547
...
...
@@ -14,13 +14,13 @@
%td
.new_line.diff-line-num
%td
.line_content.match
=
line
.
text
-
else
%td
.old_line.diff-line-num
.js-avatar-container
{
class:
type
,
data:
{
linenumber:
line
.
old_pos
}
}
%td
.old_line.diff-line-num
{
class:
[
type
,
(
"js-avatar-container"
if
!
plain
)]
,
data:
{
linenumber:
line
.
old_pos
}
}
-
link_text
=
type
==
"new"
?
" "
:
line
.
old_pos
-
if
plain
=
link_text
-
else
%a
{
href:
"##{line_code}"
,
data:
{
linenumber:
link_text
}
}
-
if
discussion
&&
!
plain
-
if
discussion
&&
discussion
.
resolvable?
&&
!
plain
%diff-note-avatars
{
"discussion-id"
=>
discussion
.
id
}
%td
.new_line.diff-line-num
{
class:
type
,
data:
{
linenumber:
line
.
new_pos
}
}
-
link_text
=
type
==
"old"
?
" "
:
line
.
new_pos
...
...
app/views/projects/diffs/_parallel_view.html.haml
View file @
f3fd6547
...
...
@@ -20,7 +20,7 @@
-
left_position
=
diff_file
.
position
(
left
)
%td
.old_line.diff-line-num.js-avatar-container
{
id:
left_line_code
,
class:
left
.
type
,
data:
{
linenumber:
left
.
old_pos
}
}
%a
{
href:
"##{left_line_code}"
,
data:
{
linenumber:
left
.
old_pos
}
}
-
if
discussion_left
-
if
discussion_left
&&
discussion_left
.
resolvable?
%diff-note-avatars
{
"discussion-id"
=>
discussion_left
.
id
}
%td
.line_content.parallel.noteable_line
{
class:
left
.
type
,
data:
diff_view_line_data
(
left_line_code
,
left_position
,
'old'
)
}=
diff_line_content
(
left
.
text
)
-
else
...
...
@@ -39,7 +39,7 @@
-
right_position
=
diff_file
.
position
(
right
)
%td
.new_line.diff-line-num.js-avatar-container
{
id:
right_line_code
,
class:
right
.
type
,
data:
{
linenumber:
right
.
new_pos
}
}
%a
{
href:
"##{right_line_code}"
,
data:
{
linenumber:
right
.
new_pos
}
}
-
if
discussion_right
-
if
discussion_right
&&
discussion_right
.
resolvable?
%diff-note-avatars
{
"discussion-id"
=>
discussion_right
.
id
}
%td
.line_content.parallel.noteable_line
{
class:
right
.
type
,
data:
diff_view_line_data
(
right_line_code
,
right_position
,
'new'
)
}=
diff_line_content
(
right
.
text
)
-
else
...
...
spec/features/merge_requests/diff_notes_avatars_spec.rb
View file @
f3fd6547
...
...
@@ -23,6 +23,56 @@ feature 'Diff note avatars', feature: true, js: true do
login_as
user
end
context
'discussion tab'
do
before
do
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
end
it
'does not show avatars on discussion tab'
do
expect
(
page
).
not_to
have_selector
(
'.js-avatar-container'
)
expect
(
page
).
not_to
have_selector
(
'.diff-comment-avatar-holders'
)
end
it
'does not render avatars after commening on discussion tab'
do
click_button
'Reply...'
page
.
within
(
'.js-discussion-note-form'
)
do
find
(
'.note-textarea'
).
native
.
send_keys
(
'Test comment'
)
click_button
'Comment'
end
expect
(
page
).
to
have_content
(
'Test comment'
)
expect
(
page
).
not_to
have_selector
(
'.js-avatar-container'
)
expect
(
page
).
not_to
have_selector
(
'.diff-comment-avatar-holders'
)
end
end
context
'commit view'
do
before
do
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
merge_request
.
commits
.
first
.
id
)
end
it
'does not render avatar after commenting'
do
first
(
'.diff-line-num'
).
trigger
(
'mouseover'
)
find
(
'.js-add-diff-note-button'
).
click
page
.
within
(
'.js-discussion-note-form'
)
do
find
(
'.note-textarea'
).
native
.
send_keys
(
'test comment'
)
click_button
'Comment'
wait_for_ajax
end
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
expect
(
page
).
to
have_content
(
'test comment'
)
expect
(
page
).
not_to
have_selector
(
'.js-avatar-container'
)
expect
(
page
).
not_to
have_selector
(
'.diff-comment-avatar-holders'
)
end
end
%w(inline parallel)
.
each
do
|
view
|
context
"
#{
view
}
view"
do
before
do
...
...
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