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
44ac8a50
Commit
44ac8a50
authored
Sep 16, 2020
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comment button not rendering
parent
2ca11a5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
.../javascripts/diffs/components/parallel_diff_table_row.vue
+4
-4
spec/frontend/diffs/components/parallel_diff_table_row_spec.js
...frontend/diffs/components/parallel_diff_table_row_spec.js
+9
-8
No files found.
app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
View file @
44ac8a50
...
...
@@ -199,10 +199,10 @@ export default {
);
},
hasDiscussionsLeft
()
{
return
this
.
line
.
left
.
discussions
&&
this
.
line
.
left
.
discussions
.
length
>
0
;
return
this
.
line
.
left
?.
discussions
?
.
length
>
0
;
},
hasDiscussionsRight
()
{
return
this
.
line
.
right
.
discussions
&&
this
.
line
.
right
.
discussions
.
length
>
0
;
return
this
.
line
.
right
?.
discussions
?
.
length
>
0
;
},
lineHrefOld
()
{
return
`#
${
this
.
line
.
left
.
line_code
||
''
}
`
;
...
...
@@ -217,14 +217,14 @@ export default {
);
},
isMetaLineLeft
()
{
const
{
type
}
=
this
.
line
.
left
;
const
type
=
this
.
line
.
left
?.
type
;
return
(
type
===
OLD_NO_NEW_LINE_TYPE
||
type
===
NEW_NO_NEW_LINE_TYPE
||
type
===
EMPTY_CELL_TYPE
);
},
isMetaLineRight
()
{
const
{
type
}
=
this
.
line
.
right
;
const
type
=
this
.
line
.
right
?.
type
;
return
(
type
===
OLD_NO_NEW_LINE_TYPE
||
type
===
NEW_NO_NEW_LINE_TYPE
||
type
===
EMPTY_CELL_TYPE
...
...
spec/frontend/diffs/components/parallel_diff_table_row_spec.js
View file @
44ac8a50
...
...
@@ -228,19 +228,20 @@ describe('ParallelDiffTableRow', () => {
const
findNoteButton
=
()
=>
wrapper
.
find
({
ref
:
'
addDiffNoteButtonLeft
'
});
it
.
each
`
hover | userData | query | mergeRefHeadComments | expectation
${
true
}
|
${
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
true
}
${
true
}
|
${
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
true
}
|
${
true
}
${
true
}
|
${
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
false
}
|
${
false
}
${
true
}
|
${
null
}
|
${
''
}
|
${
true
}
|
${
false
}
${
false
}
|
${
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
false
}
hover | line | userData | query | mergeRefHeadComments | expectation
${
true
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
true
}
${
true
}
|
${{
line
:
{
left
:
null
}
}} |
${
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
false
}
${
true
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
true
}
|
${
true
}
${
true
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
false
}
|
${
false
}
${
true
}
|
${{}}
|
$
{
null
}
|
${
''
}
|
${
true
}
|
${
false
}
${
false
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
false
}
`
(
'
exists is $expectation - with userData ($userData) query ($query)
'
,
async
({
hover
,
userData
,
query
,
mergeRefHeadComments
,
expectation
})
=>
{
async
({
hover
,
line
,
userData
,
query
,
mergeRefHeadComments
,
expectation
})
=>
{
store
.
state
.
notes
.
userData
=
userData
;
gon
.
features
=
{
mergeRefHeadComments
};
setWindowLocation
({
href
:
`
${
TEST_HOST
}
?
${
query
}
`
});
createComponent
(
{}
,
store
);
createComponent
(
line
,
store
);
if
(
hover
)
await
wrapper
.
find
(
'
.line_holder
'
).
trigger
(
'
mouseover
'
);
expect
(
findNoteButton
().
exists
()).
toBe
(
expectation
);
...
...
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