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
b5fffb14
Commit
b5fffb14
authored
Nov 18, 2020
by
Justin Boyson
Committed by
Miguel Rincon
Nov 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix incorrect hiding of inline comment cells
Add tests for parallel and inline comment cell rendering
parent
3f739faf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
14 deletions
+38
-14
app/assets/javascripts/diffs/components/diff_view.vue
app/assets/javascripts/diffs/components/diff_view.vue
+10
-8
changelogs/unreleased/jdb-fix-comment-cell-inline.yml
changelogs/unreleased/jdb-fix-comment-cell-inline.yml
+5
-0
spec/frontend/diffs/components/diff_view_spec.js
spec/frontend/diffs/components/diff_view_spec.js
+23
-6
No files found.
app/assets/javascripts/diffs/components/diff_view.vue
View file @
b5fffb14
...
@@ -51,6 +51,14 @@ export default {
...
@@ -51,6 +51,14 @@ export default {
);
);
},
},
},
},
methods
:
{
showCommentLeft
(
line
)
{
return
!
this
.
inline
||
line
.
left
;
},
showCommentRight
(
line
)
{
return
!
this
.
inline
||
(
line
.
right
&&
!
line
.
left
);
},
},
userColorScheme
:
window
.
gon
.
user_color_scheme
,
userColorScheme
:
window
.
gon
.
user_color_scheme
,
};
};
</
script
>
</
script
>
...
@@ -93,10 +101,7 @@ export default {
...
@@ -93,10 +101,7 @@ export default {
:class="line.commentRowClasses"
:class="line.commentRowClasses"
class="diff-grid-comments diff-tr notes_holder"
class="diff-grid-comments diff-tr notes_holder"
>
>
<div
<div
v-if=
"showCommentLeft(line)"
class=
"diff-td notes-content parallel old"
>
v-if=
"!inline || (line.left && line.left.discussions.length)"
class=
"diff-td notes-content parallel old"
>
<diff-comment-cell
<diff-comment-cell
v-if=
"line.left"
v-if=
"line.left"
:line=
"line.left"
:line=
"line.left"
...
@@ -106,10 +111,7 @@ export default {
...
@@ -106,10 +111,7 @@ export default {
line-position=
"left"
line-position=
"left"
/>
/>
</div>
</div>
<div
<div
v-if=
"showCommentRight(line)"
class=
"diff-td notes-content parallel new"
>
v-if=
"!inline || (line.right && line.right.discussions.length)"
class=
"diff-td notes-content parallel new"
>
<diff-comment-cell
<diff-comment-cell
v-if=
"line.right"
v-if=
"line.right"
:line=
"line.right"
:line=
"line.right"
...
...
changelogs/unreleased/jdb-fix-comment-cell-inline.yml
0 → 100644
View file @
b5fffb14
---
title
:
Fix comment cells not rendering in unified component inline view
merge_request
:
47693
author
:
type
:
fixed
spec/frontend/diffs/components/diff_view_spec.js
View file @
b5fffb14
...
@@ -49,12 +49,29 @@ describe('DiffView', () => {
...
@@ -49,12 +49,29 @@ describe('DiffView', () => {
expect
(
wrapper
.
find
(
DiffExpansionCell
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
DiffExpansionCell
).
exists
()).
toBe
(
true
);
});
});
it
(
'
renders a comment row
'
,
()
=>
{
it
.
each
`
type | side | container | sides | total
${
'
parallel
'
}
|
${
'
left
'
}
|
${
'
.old
'
}
|
${{
left
:
{
lineDraft
:
{}
},
right
:
{
lineDraft
:
{}
}
}}
|
$
{
2
}
${
'
parallel
'
}
|
${
'
right
'
}
|
${
'
.new
'
}
|
${{
left
:
{
lineDraft
:
{}
},
right
:
{
lineDraft
:
{}
}
}}
|
$
{
2
}
${
'
inline
'
}
|
${
'
left
'
}
|
${
'
.old
'
}
|
${{
left
:
{
lineDraft
:
{}
}
}}
|
$
{
1
}
${
'
inline
'
}
|
${
'
right
'
}
|
${
'
.new
'
}
|
${{
right
:
{
lineDraft
:
{}
}
}}
|
$
{
1
}
${
'
inline
'
}
|
${
'
left
'
}
|
${
'
.old
'
}
|
${{
left
:
{
lineDraft
:
{}
},
right
:
{
lineDraft
:
{}
}
}}
|
$
{
1
}
`
(
'
renders a $type comment row with comment cell on $side
'
,
({
type
,
container
,
sides
,
total
})
=>
{
const
wrapper
=
createWrapper
({
const
wrapper
=
createWrapper
({
diffLines
:
[{
renderCommentRow
:
true
,
left
:
{
lineDraft
:
{}
}
}],
diffLines
:
[{
renderCommentRow
:
true
,
...
sides
}],
});
inline
:
type
===
'
inline
'
,
expect
(
wrapper
.
find
(
DiffCommentCell
).
exists
()).
toBe
(
true
);
});
});
expect
(
wrapper
.
findAll
(
DiffCommentCell
).
length
).
toBe
(
total
);
expect
(
wrapper
.
find
(
container
)
.
find
(
DiffCommentCell
)
.
exists
(),
).
toBe
(
true
);
},
);
it
(
'
renders a draft row
'
,
()
=>
{
it
(
'
renders a draft row
'
,
()
=>
{
const
wrapper
=
createWrapper
({
const
wrapper
=
createWrapper
({
...
...
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