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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
b8ee8c27
Commit
b8ee8c27
authored
Dec 04, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed multiple diff line discussions not expanding
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/53600
parent
40343096
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
2 deletions
+51
-2
app/assets/javascripts/diffs/components/diff_gutter_avatars.vue
...sets/javascripts/diffs/components/diff_gutter_avatars.vue
+3
-0
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+4
-2
changelogs/unreleased/diff-fix-expanding.yml
changelogs/unreleased/diff-fix-expanding.yml
+5
-0
spec/javascripts/diffs/components/diff_gutter_avatars_spec.js
.../javascripts/diffs/components/diff_gutter_avatars_spec.js
+29
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+10
-0
No files found.
app/assets/javascripts/diffs/components/diff_gutter_avatars.vue
View file @
b8ee8c27
...
@@ -56,9 +56,12 @@ export default {
...
@@ -56,9 +56,12 @@ export default {
return
`
${
noteData
.
author
.
name
}
:
${
note
}
`
;
return
`
${
noteData
.
author
.
name
}
:
${
note
}
`
;
},
},
toggleDiscussions
()
{
toggleDiscussions
()
{
const
shouldExpand
=
this
.
discussions
.
some
(
discussion
=>
!
discussion
.
expanded
);
this
.
discussions
.
forEach
(
discussion
=>
{
this
.
discussions
.
forEach
(
discussion
=>
{
this
.
toggleDiscussion
({
this
.
toggleDiscussion
({
discussionId
:
discussion
.
id
,
discussionId
:
discussion
.
id
,
shouldExpand
,
});
});
});
});
},
},
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
b8ee8c27
...
@@ -178,9 +178,11 @@ export default {
...
@@ -178,9 +178,11 @@ export default {
}
}
},
},
[
types
.
TOGGLE_DISCUSSION
](
state
,
{
discussionId
})
{
[
types
.
TOGGLE_DISCUSSION
](
state
,
{
discussionId
,
shouldExpand
=
null
})
{
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
Object
.
assign
(
discussion
,
{
expanded
:
!
discussion
.
expanded
});
Object
.
assign
(
discussion
,
{
expanded
:
shouldExpand
===
null
?
!
discussion
.
expanded
:
shouldExpand
,
});
},
},
[
types
.
UPDATE_NOTE
](
state
,
note
)
{
[
types
.
UPDATE_NOTE
](
state
,
note
)
{
...
...
changelogs/unreleased/diff-fix-expanding.yml
0 → 100644
View file @
b8ee8c27
---
title
:
Fixed multiple diff line discussions not expanding
merge_request
:
author
:
type
:
fixed
spec/javascripts/diffs/components/diff_gutter_avatars_spec.js
View file @
b8ee8c27
...
@@ -89,6 +89,35 @@ describe('DiffGutterAvatars', () => {
...
@@ -89,6 +89,35 @@ describe('DiffGutterAvatars', () => {
expect
(
component
.
discussions
[
0
].
expanded
).
toEqual
(
false
);
expect
(
component
.
discussions
[
0
].
expanded
).
toEqual
(
false
);
component
.
$store
.
dispatch
(
'
setInitialNotes
'
,
[]);
component
.
$store
.
dispatch
(
'
setInitialNotes
'
,
[]);
});
});
it
(
'
forces expansion of all discussions
'
,
()
=>
{
spyOn
(
component
.
$store
,
'
dispatch
'
);
component
.
discussions
[
0
].
expanded
=
true
;
component
.
discussions
.
push
({
...
component
.
discussions
[
0
],
id
:
'
123test
'
,
expanded
:
false
,
});
component
.
toggleDiscussions
();
expect
(
component
.
$store
.
dispatch
.
calls
.
argsFor
(
0
)).
toEqual
([
'
toggleDiscussion
'
,
{
discussionId
:
component
.
discussions
[
0
].
id
,
shouldExpand
:
true
,
},
]);
expect
(
component
.
$store
.
dispatch
.
calls
.
argsFor
(
1
)).
toEqual
([
'
toggleDiscussion
'
,
{
discussionId
:
component
.
discussions
[
1
].
id
,
shouldExpand
:
true
,
},
]);
});
});
});
});
});
...
...
spec/javascripts/notes/stores/mutation_spec.js
View file @
b8ee8c27
...
@@ -297,6 +297,16 @@ describe('Notes Store mutations', () => {
...
@@ -297,6 +297,16 @@ describe('Notes Store mutations', () => {
expect
(
state
.
discussions
[
0
].
expanded
).
toEqual
(
false
);
expect
(
state
.
discussions
[
0
].
expanded
).
toEqual
(
false
);
});
});
it
(
'
forces a discussions expanded state
'
,
()
=>
{
const
state
=
{
discussions
:
[{
...
discussionMock
,
expanded
:
false
}],
};
mutations
.
TOGGLE_DISCUSSION
(
state
,
{
discussionId
:
discussionMock
.
id
,
shouldExpand
:
true
});
expect
(
state
.
discussions
[
0
].
expanded
).
toEqual
(
true
);
});
});
});
describe
(
'
UPDATE_NOTE
'
,
()
=>
{
describe
(
'
UPDATE_NOTE
'
,
()
=>
{
...
...
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