Commit 18bcb34c authored by Phil Hughes's avatar Phil Hughes

Merge branch 'jdb/fix-multiline-comment-form-reply' into 'master'

Don't show MLC form on thread replies

Closes #229596

See merge request gitlab-org/gitlab!37139
parents 4556e138 2c3c3a7a
......@@ -147,10 +147,10 @@ export default {
return getEndLineNumber(this.lineRange);
},
showMultiLineComment() {
if (!this.glFeatures.multilineComments) return false;
if (!this.glFeatures.multilineComments || !this.discussionRoot) return false;
if (this.isEditing) return true;
return this.line && this.discussionRoot && this.startLineNumber !== this.endLineNumber;
return this.line && this.startLineNumber !== this.endLineNumber;
},
commentLineOptions() {
if (!this.diffFile || !this.line) return [];
......
---
title: Fix showing MLC form on replies
merge_request: 37139
author:
type: fixed
......@@ -34,7 +34,13 @@ describe('issue_note', () => {
note,
},
localVue,
stubs: ['note-header', 'user-avatar-link', 'note-actions', 'note-body'],
stubs: [
'note-header',
'user-avatar-link',
'note-actions',
'note-body',
'multiline-comment-form',
],
});
});
......@@ -77,6 +83,24 @@ describe('issue_note', () => {
});
});
it('should render multiline comment if editing discussion root', () => {
wrapper.setProps({ discussionRoot: true });
wrapper.vm.isEditing = true;
return wrapper.vm.$nextTick().then(() => {
expect(findMultilineComment().exists()).toBe(true);
});
});
it('should not render multiline comment form unless it is the discussion root', () => {
wrapper.setProps({ discussionRoot: false });
wrapper.vm.isEditing = true;
return wrapper.vm.$nextTick().then(() => {
expect(findMultilineComment().exists()).toBe(false);
});
});
it('should not render if has single line comment', () => {
const position = {
line_range: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment