Commit 2c3c3a7a authored by Justin Boyson's avatar Justin Boyson Committed by Phil Hughes

Don't show MLC form on thread replies

parent 40caa9d0
......@@ -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