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
d72a61b4
Commit
d72a61b4
authored
Mar 06, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle transformed notes from polling response
Transforms notes when the note was transformed in some other tab
parent
ab391b77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+4
-0
spec/javascripts/notes/stores/mutation_spec.js
spec/javascripts/notes/stores/mutation_spec.js
+13
-0
No files found.
app/assets/javascripts/notes/stores/mutations.js
View file @
d72a61b4
...
@@ -193,6 +193,10 @@ export default {
...
@@ -193,6 +193,10 @@ export default {
const
noteObj
=
utils
.
findNoteObjectById
(
state
.
discussions
,
note
.
discussion_id
);
const
noteObj
=
utils
.
findNoteObjectById
(
state
.
discussions
,
note
.
discussion_id
);
if
(
noteObj
.
individual_note
)
{
if
(
noteObj
.
individual_note
)
{
if
(
note
.
type
===
constants
.
DISCUSSION_NOTE
)
{
noteObj
.
individual_note
=
false
;
}
noteObj
.
notes
.
splice
(
0
,
1
,
note
);
noteObj
.
notes
.
splice
(
0
,
1
,
note
);
}
else
{
}
else
{
const
comment
=
utils
.
findNoteObjectById
(
noteObj
.
notes
,
note
.
id
);
const
comment
=
utils
.
findNoteObjectById
(
noteObj
.
notes
,
note
.
id
);
...
...
spec/javascripts/notes/stores/mutation_spec.js
View file @
d72a61b4
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
mutations
from
'
~/notes/stores/mutations
'
;
import
mutations
from
'
~/notes/stores/mutations
'
;
import
{
DISCUSSION_NOTE
}
from
'
~/notes/constants
'
;
import
{
import
{
note
,
note
,
discussionMock
,
discussionMock
,
...
@@ -326,6 +327,18 @@ describe('Notes Store mutations', () => {
...
@@ -326,6 +327,18 @@ describe('Notes Store mutations', () => {
expect
(
state
.
discussions
[
0
].
notes
[
0
].
note
).
toEqual
(
'
Foo
'
);
expect
(
state
.
discussions
[
0
].
notes
[
0
].
note
).
toEqual
(
'
Foo
'
);
});
});
it
(
'
transforms an individual note to discussion
'
,
()
=>
{
const
state
=
{
discussions
:
[
individualNote
],
};
const
transformedNote
=
{
...
individualNote
.
notes
[
0
],
type
:
DISCUSSION_NOTE
};
mutations
.
UPDATE_NOTE
(
state
,
transformedNote
);
expect
(
state
.
discussions
[
0
].
individual_note
).
toEqual
(
false
);
});
});
});
describe
(
'
CLOSE_ISSUE
'
,
()
=>
{
describe
(
'
CLOSE_ISSUE
'
,
()
=>
{
...
...
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