summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/notes
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-09-10 19:41:57 +0100
committerPhil Hughes <me@iamphill.com>2018-09-17 09:50:36 +0100
commit8064ab84a68d439ae5a33f02fd42690f23d1b536 (patch)
tree63335a6099c99bf9b8dfd90b87c496a7a6617cec /app/assets/javascripts/notes
parent5a8908bf587a0723b07e510dd6118a686d49af98 (diff)
downloadgitlab-ce-8064ab84a68d439ae5a33f02fd42690f23d1b536.tar.gz
Re-enable legacy diff notes on merge request diffs
This re-enables legacy diff notes on the merge request diffs This feature was not workig correctly after the Vue refactor LegacyDiffNotes have no `position`, instead they only have a `line_code` As an extra, this also re-enables commenting on legacy diffs. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48873
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r--app/assets/javascripts/notes/stores/utils.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes/stores/utils.js b/app/assets/javascripts/notes/stores/utils.js
index 8ccbdb4c130..e2dd81273f5 100644
--- a/app/assets/javascripts/notes/stores/utils.js
+++ b/app/assets/javascripts/notes/stores/utils.js
@@ -27,7 +27,11 @@ export const getQuickActionText = note => {
export const reduceDiscussionsToLineCodes = selectedDiscussions =>
selectedDiscussions.reduce((acc, note) => {
- if (note.diff_discussion && note.line_code && note.resolvable) {
+ if (
+ note.diff_discussion &&
+ note.line_code &&
+ (note.resolvable || (!note.resolvable && !note.position))
+ ) {
// For context about line notes: there might be multiple notes with the same line code
const items = acc[note.line_code] || [];
items.push(note);