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
e12c2c77
Commit
e12c2c77
authored
Sep 13, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed resolved discussions not toggling expanded
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/51370
parent
44931bd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
7 deletions
+41
-7
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+1
-6
changelogs/unreleased/mr-fixed-expanded-state-not-working.yml
...gelogs/unreleased/mr-fixed-expanded-state-not-working.yml
+5
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+35
-1
No files found.
app/assets/javascripts/notes/stores/mutations.js
View file @
e12c2c77
...
...
@@ -214,12 +214,7 @@ export default {
[
types
.
SET_DISCUSSION_DIFF_LINES
](
state
,
{
discussionId
,
diffLines
})
{
const
discussion
=
utils
.
findNoteObjectById
(
state
.
discussions
,
discussionId
);
const
index
=
state
.
discussions
.
indexOf
(
discussion
);
const
discussionWithDiffLines
=
Object
.
assign
({},
discussion
,
{
truncated_diff_lines
:
diffLines
,
});
state
.
discussions
.
splice
(
index
,
1
,
discussionWithDiffLines
);
discussion
.
truncated_diff_lines
=
diffLines
;
},
};
changelogs/unreleased/mr-fixed-expanded-state-not-working.yml
0 → 100644
View file @
e12c2c77
---
title
:
Fixed resolved discussions not toggling expanded state on changes tab
merge_request
:
21676
author
:
type
:
fixed
spec/javascripts/notes/stores/mutation_spec.js
View file @
e12c2c77
import
Vue
from
'
vue
'
;
import
mutations
from
'
~/notes/stores/mutations
'
;
import
{
note
,
...
...
@@ -333,7 +334,7 @@ describe('Notes Store mutations', () => {
});
});
describe
(
'
SET_NOTES_FETCH
ING
_STATE
'
,
()
=>
{
describe
(
'
SET_NOTES_FETCH
ED
_STATE
'
,
()
=>
{
it
(
'
should set the given state
'
,
()
=>
{
const
state
=
{
isNotesFetched
:
false
,
...
...
@@ -343,4 +344,37 @@ describe('Notes Store mutations', () => {
expect
(
state
.
isNotesFetched
).
toEqual
(
true
);
});
});
describe
(
'
SET_DISCUSSION_DIFF_LINES
'
,
()
=>
{
it
(
'
sets truncated_diff_lines
'
,
()
=>
{
const
state
=
{
discussions
:
[
{
id
:
1
,
},
],
};
mutations
.
SET_DISCUSSION_DIFF_LINES
(
state
,
{
discussionId
:
1
,
diffLines
:
[
'
test
'
]
});
expect
(
state
.
discussions
[
0
].
truncated_diff_lines
).
toEqual
([
'
test
'
]);
});
it
(
'
keeps reactivity of discussion
'
,
()
=>
{
const
state
=
{};
Vue
.
set
(
state
,
'
discussions
'
,
[
{
id
:
1
,
expanded
:
false
,
},
]);
const
discussion
=
state
.
discussions
[
0
];
mutations
.
SET_DISCUSSION_DIFF_LINES
(
state
,
{
discussionId
:
1
,
diffLines
:
[
'
test
'
]
});
discussion
.
expanded
=
true
;
expect
(
state
.
discussions
[
0
].
expanded
).
toBe
(
true
);
});
});
});
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