Commit 544337f7 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'batch-comments-commit-comment' into 'master'

Stop batch comment actions showing on commit discussions

Closes #8052

See merge request gitlab-org/gitlab-ee!8007
parents d6e09f05 c495fd97
......@@ -204,7 +204,7 @@ js-autosize markdown-area js-vue-issue-note-form js-vue-textarea"
class="note-form-actions clearfix"
>
<template
v-if="withBatchComments && noteId === ''"
v-if="showBatchCommentsActions"
>
<p
v-if="discussion && discussion.id"
......
......@@ -6,6 +6,9 @@ export default {
withBatchComments: state => state.batchComments && state.batchComments.withBatchComments,
}),
...mapGetters('batchComments', ['hasDrafts']),
showBatchCommentsActions() {
return this.withBatchComments && this.noteId === '' && !this.discussion.for_commit;
},
},
methods: {
shouldBeResolved(resolveStatus) {
......
---
title: Stops showing review actions on commit discussions in merge requests
merge_request: 8007
author:
type: fixed
import Vue from 'vue';
import { createStore } from '~/mr_notes/stores';
import issueNoteForm from '~/notes/components/note_form.vue';
import { noteableDataMock, discussionMock, notesDataMock } from 'spec/notes/mock_data';
describe('issue_note_form component', () => {
let store;
let vm;
let props;
beforeEach(() => {
const Component = Vue.extend(issueNoteForm);
store = createStore();
store.dispatch('setNoteableData', noteableDataMock);
store.dispatch('setNotesData', notesDataMock);
props = {
isEditing: false,
noteBody: 'Magni suscipit eius consectetur enim et ex et commodi.',
discussion: { ...discussionMock, for_commit: false },
};
vm = new Component({
store,
propsData: props,
}).$mount();
});
afterEach(() => {
vm.$destroy();
});
describe('with batch comments', () => {
beforeEach(done => {
store
.dispatch('batchComments/enableBatchComments')
.then(vm.$nextTick)
.then(done)
.catch(done.fail);
});
it('hides actions for commits', done => {
vm.discussion.for_commit = true;
vm.$nextTick(() => {
expect(vm.$el.querySelector('.note-form-actions').textContent).not.toContain(
'Start a review',
);
done();
});
});
});
});
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