Skip to content
Snippets Groups Projects
Commit 571048da authored by Kushal Pandya's avatar Kushal Pandya :speech_balloon:
Browse files

Merge branch 'ph/diffFileDiscussionsRepeated' into 'master'

Fixes a bug where drafts on files would get rendered in the wrong place

See merge request !123360



Merged-by: Kushal Pandya's avatarKushal Pandya <kushal@gitlab.com>
Approved-by: Kushal Pandya's avatarKushal Pandya <kushal@gitlab.com>
Co-authored-by: default avatarPhil Hughes <me@iamphill.com>
parents 42b9f5d9 6a0a767a
No related branches found
No related tags found
2 merge requests!123360Fixes a bug where drafts on files would get rendered in the wrong place,!119439Draft: Prevent file variable content expansion in downstream pipeline
Pipeline #896998898 passed
......@@ -71,7 +71,7 @@ export const draftsForLine = (state, getters) => (diffFileSha, line, side = null
const showDraftsForThisSide = showDraftOnSide(line, side);
if (showDraftsForThisSide && draftsForFile?.[key]) {
return draftsForFile[key];
return draftsForFile[key].filter((d) => d.position.position_type === 'text');
}
return [];
};
......
......@@ -465,18 +465,18 @@ export default {
</gl-alert>
<div v-if="showFileDiscussions" class="gl-border-b" data-testid="file-discussions">
<div class="diff-file-discussions-wrapper">
<diff-file-drafts
:file-hash="file.file_hash"
:show-pin="false"
:position-type="$options.FILE_DIFF_POSITION_TYPE"
class="diff-file-discussions"
/>
<diff-discussions
v-if="fileDiscussions.length"
class="diff-file-discussions"
data-testid="diff-file-discussions"
:discussions="fileDiscussions"
/>
<diff-file-drafts
:file-hash="file.file_hash"
:show-pin="false"
:position-type="$options.FILE_DIFF_POSITION_TYPE"
class="diff-file-discussions"
/>
<note-form
v-if="file.hasCommentForm"
:save-button-title="__('Comment')"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment