Commit 307ebe6d authored by Phil Hughes's avatar Phil Hughes

Merge branch 'design-management-ee-to-cc-fe-files' into 'master'

Design Management FE to FOSS Part 1/3: Move Design Management JS from EE to CE

See merge request gitlab-org/gitlab!31058
parents 6440be5d 0a6262bd
...@@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => {
initRelatedIssues(); initRelatedIssues();
if (document.getElementById('js-design-management')) { if (document.getElementById('js-design-management')) {
import(/* webpackChunkName: 'design_management' */ 'ee/design_management') import(/* webpackChunkName: 'design_management' */ '~/design_management')
.then(module => module.default()) .then(module => module.default())
.catch(() => {}); .catch(() => {});
} }
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlDeprecatedButton, GlModal, GlModalDirective } from '@gitlab/ui'; import { GlDeprecatedButton, GlModal, GlModalDirective } from '@gitlab/ui';
import BatchDeleteButton from 'ee/design_management/components/delete_button.vue'; import BatchDeleteButton from '~/design_management/components/delete_button.vue';
describe('Batch delete button component', () => { describe('Batch delete button component', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import DesignNotePin from 'ee/design_management/components/design_note_pin.vue'; import DesignNotePin from '~/design_management/components/design_note_pin.vue';
describe('Design discussions component', () => { describe('Design discussions component', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { ApolloMutation } from 'vue-apollo'; import { ApolloMutation } from 'vue-apollo';
import DesignDiscussion from 'ee/design_management/components/design_notes/design_discussion.vue'; import DesignDiscussion from '~/design_management/components/design_notes/design_discussion.vue';
import DesignNote from 'ee/design_management/components/design_notes/design_note.vue'; import DesignNote from '~/design_management/components/design_notes/design_note.vue';
import DesignReplyForm from 'ee/design_management/components/design_notes/design_reply_form.vue'; import DesignReplyForm from '~/design_management/components/design_notes/design_reply_form.vue';
import createNoteMutation from 'ee/design_management/graphql/mutations/createNote.mutation.graphql'; import createNoteMutation from '~/design_management/graphql/mutations/createNote.mutation.graphql';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue'; import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
describe('Design discussions component', () => { describe('Design discussions component', () => {
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import DesignNote from 'ee/design_management/components/design_notes/design_note.vue'; import DesignNote from '~/design_management/components/design_notes/design_note.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import DesignReplyForm from 'ee/design_management/components/design_notes/design_reply_form.vue'; import DesignReplyForm from '~/design_management/components/design_notes/design_reply_form.vue';
describe('Design reply form component', () => { describe('Design reply form component', () => {
let wrapper; let wrapper;
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import DesignOverlay from 'ee/design_management/components/design_overlay.vue'; import DesignOverlay from '~/design_management/components/design_overlay.vue';
import notes from '../mock_data/notes'; import notes from '../mock_data/notes';
describe('Design overlay component', () => { describe('Design overlay component', () => {
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import DesignPresentation from 'ee/design_management/components/design_presentation.vue'; import DesignPresentation from '~/design_management/components/design_presentation.vue';
import DesignOverlay from 'ee/design_management/components/design_overlay.vue'; import DesignOverlay from '~/design_management/components/design_overlay.vue';
const mockOverlayData = { const mockOverlayData = {
overlayDimensions: { overlayDimensions: {
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import DesignScaler from 'ee/design_management/components/design_scaler.vue'; import DesignScaler from '~/design_management/components/design_scaler.vue';
describe('Design management design scaler component', () => { describe('Design management design scaler component', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui'; import { GlIcon } from '@gitlab/ui';
import DesignImage from 'ee/design_management/components/image.vue'; import DesignImage from '~/design_management/components/image.vue';
describe('Design management large image component', () => { describe('Design management large image component', () => {
let wrapper; let wrapper;
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlIcon, GlLoadingIcon, GlIntersectionObserver } from '@gitlab/ui'; import { GlIcon, GlLoadingIcon, GlIntersectionObserver } from '@gitlab/ui';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import Item from 'ee/design_management/components/list/item.vue'; import Item from '~/design_management/components/list/item.vue';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(VueRouter); localVue.use(VueRouter);
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import Toolbar from 'ee/design_management/components/toolbar/index.vue'; import Toolbar from '~/design_management/components/toolbar/index.vue';
import DeleteButton from 'ee/design_management/components/delete_button.vue'; import DeleteButton from '~/design_management/components/delete_button.vue';
import { DESIGNS_ROUTE_NAME } from 'ee/design_management/router/constants'; import { DESIGNS_ROUTE_NAME } from '~/design_management/router/constants';
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlDeprecatedButton } from '@gitlab/ui';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import PaginationButton from 'ee/design_management/components/toolbar/pagination_button.vue'; import PaginationButton from '~/design_management/components/toolbar/pagination_button.vue';
import { DESIGN_ROUTE_NAME } from 'ee/design_management/router/constants'; import { DESIGN_ROUTE_NAME } from '~/design_management/router/constants';
const localVue = createLocalVue(); const localVue = createLocalVue();
localVue.use(VueRouter); localVue.use(VueRouter);
......
/* global Mousetrap */ /* global Mousetrap */
import 'mousetrap'; import 'mousetrap';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import Pagination from 'ee/design_management/components/toolbar/pagination.vue'; import Pagination from '~/design_management/components/toolbar/pagination.vue';
import { DESIGN_ROUTE_NAME } from 'ee/design_management/router/constants'; import { DESIGN_ROUTE_NAME } from '~/design_management/router/constants';
const push = jest.fn(); const push = jest.fn();
const $router = { const $router = {
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import UploadButton from 'ee/design_management/components/upload/button.vue'; import UploadButton from '~/design_management/components/upload/button.vue';
describe('Design management upload button component', () => { describe('Design management upload button component', () => {
let wrapper; let wrapper;
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import DesignDropzone from 'ee/design_management/components/upload/design_dropzone.vue'; import DesignDropzone from '~/design_management/components/upload/design_dropzone.vue';
import createFlash from '~/flash'; import createFlash from '~/flash';
jest.mock('~/flash'); jest.mock('~/flash');
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import DesignVersionDropdown from 'ee/design_management/components/upload/design_version_dropdown.vue'; import DesignVersionDropdown from '~/design_management/components/upload/design_version_dropdown.vue';
import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlDropdown, GlDropdownItem } from '@gitlab/ui';
import mockAllVersions from './mock_data/all_versions'; import mockAllVersions from './mock_data/all_versions';
......
...@@ -2,11 +2,11 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,11 +2,11 @@ import { shallowMount } from '@vue/test-utils';
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo'; import { ApolloMutation } from 'vue-apollo';
import createFlash from '~/flash'; import createFlash from '~/flash';
import DesignIndex from 'ee/design_management/pages/design/index.vue'; import DesignIndex from '~/design_management/pages/design/index.vue';
import DesignDiscussion from 'ee/design_management/components/design_notes/design_discussion.vue'; import DesignDiscussion from '~/design_management/components/design_notes/design_discussion.vue';
import DesignReplyForm from 'ee/design_management/components/design_notes/design_reply_form.vue'; import DesignReplyForm from '~/design_management/components/design_notes/design_reply_form.vue';
import Participants from '~/sidebar/components/participants/participants.vue'; import Participants from '~/sidebar/components/participants/participants.vue';
import createImageDiffNoteMutation from 'ee/design_management/graphql/mutations/createImageDiffNote.mutation.graphql'; import createImageDiffNoteMutation from '~/design_management/graphql/mutations/createImageDiffNote.mutation.graphql';
import design from '../../mock_data/design'; import design from '../../mock_data/design';
import mockResponseWithDesigns from '../../mock_data/designs'; import mockResponseWithDesigns from '../../mock_data/designs';
import mockResponseNoDesigns from '../../mock_data/no_designs'; import mockResponseNoDesigns from '../../mock_data/no_designs';
...@@ -14,8 +14,8 @@ import mockAllVersions from '../../mock_data/all_versions'; ...@@ -14,8 +14,8 @@ import mockAllVersions from '../../mock_data/all_versions';
import { import {
DESIGN_NOT_FOUND_ERROR, DESIGN_NOT_FOUND_ERROR,
DESIGN_VERSION_NOT_EXIST_ERROR, DESIGN_VERSION_NOT_EXIST_ERROR,
} from 'ee/design_management/utils/error_messages'; } from '~/design_management/utils/error_messages';
import { DESIGNS_ROUTE_NAME } from 'ee/design_management/router/constants'; import { DESIGNS_ROUTE_NAME } from '~/design_management/router/constants';
jest.mock('~/flash'); jest.mock('~/flash');
jest.mock('mousetrap', () => ({ jest.mock('mousetrap', () => ({
......
...@@ -3,16 +3,16 @@ import { ApolloMutation } from 'vue-apollo'; ...@@ -3,16 +3,16 @@ import { ApolloMutation } from 'vue-apollo';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import { GlEmptyState } from '@gitlab/ui'; import { GlEmptyState } from '@gitlab/ui';
import Index from 'ee/design_management/pages/index.vue'; import Index from '~/design_management/pages/index.vue';
import uploadDesignQuery from 'ee/design_management/graphql/mutations/uploadDesign.mutation.graphql'; import uploadDesignQuery from '~/design_management/graphql/mutations/uploadDesign.mutation.graphql';
import DesignDestroyer from 'ee/design_management/components/design_destroyer.vue'; import DesignDestroyer from '~/design_management/components/design_destroyer.vue';
import DesignDropzone from 'ee/design_management/components/upload/design_dropzone.vue'; import DesignDropzone from '~/design_management/components/upload/design_dropzone.vue';
import DeleteButton from 'ee/design_management/components/delete_button.vue'; import DeleteButton from '~/design_management/components/delete_button.vue';
import { DESIGNS_ROUTE_NAME } from 'ee/design_management/router/constants'; import { DESIGNS_ROUTE_NAME } from '~/design_management/router/constants';
import { import {
EXISTING_DESIGN_DROP_MANY_FILES_MESSAGE, EXISTING_DESIGN_DROP_MANY_FILES_MESSAGE,
EXISTING_DESIGN_DROP_INVALID_FILENAME_MESSAGE, EXISTING_DESIGN_DROP_INVALID_FILENAME_MESSAGE,
} from 'ee/design_management/utils/error_messages'; } from '~/design_management/utils/error_messages';
import createFlash from '~/flash'; import createFlash from '~/flash';
const localVue = createLocalVue(); const localVue = createLocalVue();
......
import { mount, createLocalVue } from '@vue/test-utils'; import { mount, createLocalVue } from '@vue/test-utils';
import VueRouter from 'vue-router'; import VueRouter from 'vue-router';
import App from 'ee/design_management/components/app.vue'; import App from '~/design_management/components/app.vue';
import Designs from 'ee/design_management/pages/index.vue'; import Designs from '~/design_management/pages/index.vue';
import DesignDetail from 'ee/design_management/pages/design/index.vue'; import DesignDetail from '~/design_management/pages/design/index.vue';
import createRouter from 'ee/design_management/router'; import createRouter from '~/design_management/router';
import { import {
ROOT_ROUTE_NAME, ROOT_ROUTE_NAME,
DESIGNS_ROUTE_NAME, DESIGNS_ROUTE_NAME,
DESIGN_ROUTE_NAME, DESIGN_ROUTE_NAME,
} from 'ee/design_management/router/constants'; } from '~/design_management/router/constants';
import '~/commons/bootstrap'; import '~/commons/bootstrap';
jest.mock('mousetrap', () => ({ jest.mock('mousetrap', () => ({
......
...@@ -5,13 +5,13 @@ import { ...@@ -5,13 +5,13 @@ import {
updateStoreAfterAddImageDiffNote, updateStoreAfterAddImageDiffNote,
updateStoreAfterUploadDesign, updateStoreAfterUploadDesign,
updateStoreAfterUpdateImageDiffNote, updateStoreAfterUpdateImageDiffNote,
} from 'ee/design_management/utils/cache_update'; } from '~/design_management/utils/cache_update';
import { import {
designDeletionError, designDeletionError,
ADD_DISCUSSION_COMMENT_ERROR, ADD_DISCUSSION_COMMENT_ERROR,
ADD_IMAGE_DIFF_NOTE_ERROR, ADD_IMAGE_DIFF_NOTE_ERROR,
UPDATE_IMAGE_DIFF_NOTE_ERROR, UPDATE_IMAGE_DIFF_NOTE_ERROR,
} from 'ee/design_management/utils/error_messages'; } from '~/design_management/utils/error_messages';
import design from '../mock_data/design'; import design from '../mock_data/design';
import createFlash from '~/flash'; import createFlash from '~/flash';
......
...@@ -6,7 +6,7 @@ import { ...@@ -6,7 +6,7 @@ import {
updateImageDiffNoteOptimisticResponse, updateImageDiffNoteOptimisticResponse,
isValidDesignFile, isValidDesignFile,
extractDesign, extractDesign,
} from 'ee/design_management/utils/design_management_utils'; } from '~/design_management/utils/design_management_utils';
import mockResponseNoDesigns from '../mock_data/no_designs'; import mockResponseNoDesigns from '../mock_data/no_designs';
import mockResponseWithDesigns from '../mock_data/designs'; import mockResponseWithDesigns from '../mock_data/designs';
import mockDesign from '../mock_data/design'; import mockDesign from '../mock_data/design';
......
import { import {
designDeletionError, designDeletionError,
designUploadSkippedWarning, designUploadSkippedWarning,
} from 'ee/design_management/utils/error_messages'; } from '~/design_management/utils/error_messages';
const mockFilenames = n => const mockFilenames = n =>
Array(n) Array(n)
......
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