Commit 41af7f71 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'batch-comments-ee-store-module' into 'master'

Move batchComments module out of CE store creation

Closes #10002 and #10008

See merge request gitlab-org/gitlab-ee!9788
parents 8cf0e08f 3f6ae273
......@@ -4,14 +4,12 @@ import draftCommentsMixin from 'ee_else_ce/diffs/mixins/draft_comments';
import inlineDiffTableRow from './inline_diff_table_row.vue';
import inlineDiffCommentRow from './inline_diff_comment_row.vue';
// eslint-disable-next-line import/order
import InlineDraftCommentRow from 'ee/batch_comments/components/inline_draft_comment_row.vue';
export default {
components: {
inlineDiffCommentRow,
inlineDiffTableRow,
InlineDraftCommentRow,
InlineDraftCommentRow: () =>
import('ee_component/batch_comments/components/inline_draft_comment_row.vue'),
},
mixins: [draftCommentsMixin],
props: {
......@@ -31,7 +29,6 @@ export default {
},
computed: {
...mapGetters('diffs', ['commitId']),
...mapGetters('batchComments', ['shouldRenderDraftRow', 'draftForLine']),
diffLinesLength() {
return this.diffLines.length;
},
......
......@@ -2,7 +2,6 @@ import Vue from 'vue';
import Vuex from 'vuex';
import notesModule from '~/notes/stores/modules';
import diffsModule from '~/diffs/store/modules';
import batchCommentsModule from 'ee/batch_comments/stores/modules/batch_comments';
import mrPageModule from './modules';
Vue.use(Vuex);
......@@ -13,7 +12,6 @@ export const createStore = () =>
page: mrPageModule,
notes: notesModule(),
diffs: diffsModule(),
batchComments: batchCommentsModule(),
},
});
......
import { mapGetters } from 'vuex';
export default {
computed: {
...mapGetters('batchComments', ['shouldRenderDraftRow', 'draftForLine']),
},
};
import Vue from 'vue';
import Vuex from 'vuex';
import notesModule from '~/notes/stores/modules';
import diffsModule from '~/diffs/store/modules';
import mrPageModule from '~/mr_notes/stores/modules';
import batchCommentsModule from 'ee/batch_comments/stores/modules/batch_comments';
Vue.use(Vuex);
export const createStore = () =>
new Vuex.Store({
modules: {
page: mrPageModule,
notes: notesModule(),
diffs: diffsModule(),
batchComments: batchCommentsModule(),
},
});
export default createStore();
import { shallowMount, createLocalVue } from '@vue/test-utils';
import DraftNote from 'ee/batch_comments/components/draft_note.vue';
import NoteableNote from '~/notes/components/noteable_note.vue';
import { createStore } from '~/mr_notes/stores';
import { createStore } from 'ee/batch_comments/stores';
import '~/behaviors/markdown/render_gfm';
import { createDraft } from '../mock_data';
......
import Vue from 'vue';
import DraftsCount from 'ee/batch_comments/components/drafts_count.vue';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { createStore } from '~/mr_notes/stores';
import { createStore } from 'ee/batch_comments/stores';
describe('Batch comments drafts count component', () => {
let vm;
......
import Vue from 'vue';
import ParallelDraftCommentRow from 'ee/batch_comments/components/parallel_draft_comment_row.vue';
import { createComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { createStore } from '~/mr_notes/stores';
import { createStore } from 'ee/batch_comments/stores';
import '~/behaviors/markdown/render_gfm';
import { createDraft } from '../mock_data';
......
import Vue from 'vue';
import PreviewItem from 'ee/batch_comments/components/preview_item.vue';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { createStore } from '~/mr_notes/stores';
import { createStore } from 'ee/batch_comments/stores';
import diffsModule from '~/diffs/store/modules';
import notesModule from '~/notes/stores/modules';
import '~/behaviors/markdown/render_gfm';
import { createDraft } from '../mock_data';
......@@ -12,6 +14,8 @@ describe('Batch comments draft preview item component', () => {
function createComponent(isLast = false, extra = {}, extendStore = () => {}) {
const store = createStore();
store.registerModule('diffs', diffsModule());
store.registerModule('notes', notesModule());
extendStore(store);
......
import Vue from 'vue';
import PreviewDropdown from 'ee/batch_comments/components/preview_dropdown.vue';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { createStore } from '~/mr_notes/stores';
import { createStore } from 'ee/mr_notes/stores';
import '~/behaviors/markdown/render_gfm';
import { createDraft } from '../mock_data';
describe('Batch comments draft preview item component', () => {
describe('Batch comments publish dropdown component', () => {
let vm;
let Component;
......
import Vue from 'vue';
import { createStore } from '~/mr_notes/stores';
import { createStore } from 'ee/batch_comments/stores';
import diffsModule from '~/diffs/store/modules';
import notesModule from '~/notes/stores/modules';
import issueNoteForm from '~/notes/components/note_form.vue';
import { keyboardDownEvent } from 'spec/issue_show/helpers';
import { noteableDataMock, discussionMock, notesDataMock } from 'spec/notes/mock_data';
......@@ -13,6 +15,8 @@ describe('issue_note_form component', () => {
const Component = Vue.extend(issueNoteForm);
store = createStore();
store.registerModule('diffs', diffsModule());
store.registerModule('notes', notesModule());
store.dispatch('setNoteableData', noteableDataMock);
store.dispatch('setNotesData', notesDataMock);
......
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