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
Boxiang Sun
gitlab-ce
Commits
52b70f04
Commit
52b70f04
authored
Mar 09, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue notes being duplicated
Closes #44099
parent
f2723fc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/assets/javascripts/notes/stores/actions.js
app/assets/javascripts/notes/stores/actions.js
+1
-1
app/assets/javascripts/notes/stores/mutations.js
app/assets/javascripts/notes/stores/mutations.js
+2
-2
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+1
-1
No files found.
app/assets/javascripts/notes/stores/actions.js
View file @
52b70f04
...
@@ -197,7 +197,7 @@ const pollSuccessCallBack = (resp, commit, state, getters) => {
...
@@ -197,7 +197,7 @@ const pollSuccessCallBack = (resp, commit, state, getters) => {
});
});
}
}
commit
(
types
.
SET_LAST_FETCHED_AT
,
resp
.
last
FetchedA
t
);
commit
(
types
.
SET_LAST_FETCHED_AT
,
resp
.
last
_fetched_a
t
);
return
resp
;
return
resp
;
};
};
...
...
app/assets/javascripts/notes/stores/mutations.js
View file @
52b70f04
...
@@ -90,15 +90,15 @@ export default {
...
@@ -90,15 +90,15 @@ export default {
const
notes
=
[];
const
notes
=
[];
notesData
.
forEach
((
note
)
=>
{
notesData
.
forEach
((
note
)
=>
{
const
nn
=
Object
.
assign
({},
note
);
// To support legacy notes, should be very rare case.
// To support legacy notes, should be very rare case.
if
(
note
.
individual_note
&&
note
.
notes
.
length
>
1
)
{
if
(
note
.
individual_note
&&
note
.
notes
.
length
>
1
)
{
note
.
notes
.
forEach
((
n
)
=>
{
note
.
notes
.
forEach
((
n
)
=>
{
const
nn
=
Object
.
assign
({},
note
);
nn
.
notes
=
[
n
];
// override notes array to only have one item to mimick individual_note
nn
.
notes
=
[
n
];
// override notes array to only have one item to mimick individual_note
notes
.
push
(
nn
);
notes
.
push
(
nn
);
});
});
}
else
{
}
else
{
const
nn
=
Object
.
assign
({},
note
);
const
oldNote
=
utils
.
findNoteObjectById
(
state
.
notes
,
note
.
id
);
const
oldNote
=
utils
.
findNoteObjectById
(
state
.
notes
,
note
.
id
);
nn
.
expanded
=
oldNote
?
oldNote
.
expanded
:
note
.
expanded
;
nn
.
expanded
=
oldNote
?
oldNote
.
expanded
:
note
.
expanded
;
...
...
app/helpers/notes_helper.rb
View file @
52b70f04
...
@@ -169,7 +169,7 @@ module NotesHelper
...
@@ -169,7 +169,7 @@ module NotesHelper
reopenPath:
reopen_issuable_path
(
issuable
),
reopenPath:
reopen_issuable_path
(
issuable
),
notesPath:
notes_url
,
notesPath:
notes_url
,
totalNotes:
issuable
.
discussions
.
length
,
totalNotes:
issuable
.
discussions
.
length
,
lastFetchedAt:
Time
.
now
lastFetchedAt:
Time
.
now
.
to_i
}.
to_json
}.
to_json
end
end
...
...
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