Commit 50ed1875 authored by Phil Hughes's avatar Phil Hughes

Move EE differences out of CE diff files

Moved batch comments code out of CE files as much as possible
Made DraftNote component an async import
The async import will resolve to an empty component in CE

Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/10001 https://gitlab.com/gitlab-org/gitlab-ee/issues/9959
parent 489b3a2d
<script>
import { mapState, mapGetters, mapActions } from 'vuex';
import { s__ } from '~/locale';
import batchCommentsDiffLineNoteFormMixin from 'ee/batch_comments/mixins/diff_line_note_form';
import diffLineNoteFormMixin from 'ee_else_ce/notes/mixins/diff_line_note_form';
import noteForm from '../../notes/components/note_form.vue';
import autosave from '../../notes/mixins/autosave';
import { DIFF_NOTE_TYPE } from '../constants';
......@@ -10,7 +10,7 @@ export default {
components: {
noteForm,
},
mixins: [autosave, batchCommentsDiffLineNoteFormMixin],
mixins: [autosave, diffLineNoteFormMixin],
props: {
diffFileHash: {
type: String,
......
......@@ -6,8 +6,7 @@ import { truncateSha } from '~/lib/utils/text_utility';
import { s__, __, sprintf } from '~/locale';
import systemNote from '~/vue_shared/components/notes/system_note.vue';
import icon from '~/vue_shared/components/icon.vue';
import batchCommentsDiffLineNoteFormMixin from 'ee/batch_comments/mixins/diff_line_note_form';
import DraftNote from 'ee/batch_comments/components/draft_note.vue';
import diffLineNoteFormMixin from 'ee_else_ce/notes/mixins/diff_line_note_form';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import Flash from '../../flash';
import { SYSTEM_NOTE } from '../constants';
......@@ -49,19 +48,13 @@ export default {
placeholderSystemNote,
ResolveWithIssueButton,
systemNote,
DraftNote,
DraftNote: () => import('ee_component/batch_comments/components/draft_note.vue'),
TimelineEntryItem,
},
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [
autosave,
noteable,
resolvable,
discussionNavigation,
batchCommentsDiffLineNoteFormMixin,
],
mixins: [autosave, noteable, resolvable, discussionNavigation, diffLineNoteFormMixin],
props: {
discussion: {
type: Object,
......@@ -99,7 +92,6 @@ export default {
return {
isReplying: false,
isResolving: false,
isUnresolving: false,
resolveAsThread: true,
isRepliesCollapsed: Boolean(!isDiffDiscussion && resolved),
};
......
export default {
computed: {
draftForDiscussion: () => () => ({}),
},
methods: {
showDraft: () => false,
addReplyToReview: () => {},
addToReview: () => {},
},
};
......@@ -260,6 +260,17 @@ module.exports = {
jQuery: 'jquery',
}),
new webpack.NormalModuleReplacementPlugin(/^ee_component\/(.*)\.vue/, function(resource) {
if (Object.keys(module.exports.resolve.alias).indexOf('ee') >= 0) {
resource.request = resource.request.replace(/^ee_component/, 'ee');
} else {
resource.request = path.join(
ROOT_PATH,
'app/assets/javascripts/vue_shared/components/empty_component.js'
);
}
}),
// compression can require a lot of compute time and is disabled in CI
IS_PRODUCTION && !NO_COMPRESSION && new CompressionPlugin(),
......
import { mapActions, mapGetters, mapState } from 'vuex';
import { getDraftReplyFormData, getDraftFormData } from '../utils';
import { getDraftReplyFormData, getDraftFormData } from 'ee/batch_comments/utils';
import createFlash from '~/flash';
import { s__ } from '~/locale';
......
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