Commit 6fcccc15 authored by Illya Klymov's avatar Illya Klymov

Move import-related assets to generalized locations

- introduce page-specific bundle
- move related javascripts to top-level folder
parent 53e51823
...@@ -3,8 +3,8 @@ import { mapState, mapGetters, mapActions } from 'vuex'; ...@@ -3,8 +3,8 @@ import { mapState, mapGetters, mapActions } from 'vuex';
import { GlIcon, GlBadge } from '@gitlab/ui'; import { GlIcon, GlBadge } from '@gitlab/ui';
import Select2Select from '~/vue_shared/components/select2_select.vue'; import Select2Select from '~/vue_shared/components/select2_select.vue';
import { __ } from '~/locale'; import { __ } from '~/locale';
import ImportStatus from './import_status.vue'; import ImportStatus from '../../components/import_status.vue';
import { STATUSES } from '../constants'; import { STATUSES } from '../../constants';
import { isProjectImportable, isIncompatible, getImportStatus } from '../utils'; import { isProjectImportable, isIncompatible, getImportStatus } from '../utils';
export default { export default {
......
import Vue from 'vue'; import Vue from 'vue';
import Translate from '../vue_shared/translate'; import Translate from '~/vue_shared/translate';
import { parseBoolean } from '~/lib/utils/common_utils';
import ImportProjectsTable from './components/import_projects_table.vue'; import ImportProjectsTable from './components/import_projects_table.vue';
import { parseBoolean } from '../lib/utils/common_utils';
import createStore from './store'; import createStore from './store';
Vue.use(Translate); Vue.use(Translate);
......
import { STATUSES } from '../constants'; import { STATUSES } from '../../constants';
import { isProjectImportable, isIncompatible } from '../utils'; import { isProjectImportable, isIncompatible } from '../utils';
export const isLoading = state => state.isLoadingRepos || state.isLoadingNamespaces; export const isLoading = state => state.isLoadingRepos || state.isLoadingNamespaces;
......
import Vue from 'vue'; import Vue from 'vue';
import * as types from './mutation_types'; import * as types from './mutation_types';
import { STATUSES } from '../constants'; import { STATUSES } from '../../constants';
const makeNewImportedProject = importedProject => ({ const makeNewImportedProject = importedProject => ({
importSource: { importSource: {
......
import { STATUSES } from './constants'; import { STATUSES } from '../constants';
export function isIncompatible(project) { export function isIncompatible(project) {
return project.importSource.incompatible; return project.importSource.incompatible;
......
import Vue from 'vue'; import Vue from 'vue';
import { initStoreFromElement, initPropsFromElement } from '~/import_projects'; import { initStoreFromElement, initPropsFromElement } from '~/import_entities/import_projects';
import BitbucketStatusTable from '~/import_projects/components/bitbucket_status_table.vue'; import BitbucketStatusTable from '~/import_entities/import_projects/components/bitbucket_status_table.vue';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const mountElement = document.getElementById('import-projects-mount-element'); const mountElement = document.getElementById('import-projects-mount-element');
......
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import BitbucketStatusTable from '~/import_projects/components/bitbucket_status_table.vue'; import BitbucketStatusTable from '~/import_entities/import_projects/components/bitbucket_status_table.vue';
export default { export default {
components: { components: {
......
import Vue from 'vue'; import Vue from 'vue';
import { initStoreFromElement, initPropsFromElement } from '~/import_projects'; import { initStoreFromElement, initPropsFromElement } from '~/import_entities/import_projects';
import BitbucketServerStatusTable from './components/bitbucket_server_status_table.vue'; import BitbucketServerStatusTable from './components/bitbucket_server_status_table.vue';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
......
import mountImportProjectsTable from '~/import_projects'; import mountImportProjectsTable from '~/import_entities/import_projects';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const mountElement = document.getElementById('import-projects-mount-element'); const mountElement = document.getElementById('import-projects-mount-element');
......
import mountImportProjectsTable from '~/import_projects'; import mountImportProjectsTable from '~/import_entities/import_projects';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const mountElement = document.getElementById('import-projects-mount-element'); const mountElement = document.getElementById('import-projects-mount-element');
......
import mountImportProjectsTable from '~/import_projects'; import mountImportProjectsTable from '~/import_entities/import_projects';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const mountElement = document.getElementById('import-projects-mount-element'); const mountElement = document.getElementById('import-projects-mount-element');
......
import mountImportProjectsTable from '~/import_projects'; import mountImportProjectsTable from '~/import_entities/import_projects';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const mountElement = document.getElementById('import-projects-mount-element'); const mountElement = document.getElementById('import-projects-mount-element');
......
import mountImportProjectsTable from '~/import_projects'; import mountImportProjectsTable from '~/import_entities/import_projects';
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const mountElement = document.getElementById('import-projects-mount-element'); const mountElement = document.getElementById('import-projects-mount-element');
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
@import './pages/events'; @import './pages/events';
@import './pages/groups'; @import './pages/groups';
@import './pages/help'; @import './pages/help';
@import './pages/import';
@import './pages/incident_management_list'; @import './pages/incident_management_list';
@import './pages/issuable'; @import './pages/issuable';
@import './pages/issues/issue_count_badge'; @import './pages/issues/issue_count_badge';
......
@import 'mixins_and_variables_and_functions';
.import-jobs-to-col { .import-jobs-to-col {
width: 39%; width: 39%;
} }
...@@ -39,3 +41,17 @@ ...@@ -39,3 +41,17 @@
.import-projects-loading-icon { .import-projects-loading-icon {
margin-top: $gl-padding-32; margin-top: $gl-padding-32;
} }
.import-entities-target-select {
.select2-container {
> .select2-choice {
border-color: var(--gray-200, $gray-200);
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
.gl-form-input {
box-shadow: inset 0 0 0 1px var(--gray-200, $gray-200);
}
}
- add_page_specific_style 'page_bundles/import'
- provider = local_assigns.fetch(:provider) - provider = local_assigns.fetch(:provider)
- extra_data = local_assigns.fetch(:extra_data, {}) - extra_data = local_assigns.fetch(:extra_data, {})
- filterable = local_assigns.fetch(:filterable, true) - filterable = local_assigns.fetch(:filterable, true)
......
...@@ -187,6 +187,7 @@ module Gitlab ...@@ -187,6 +187,7 @@ module Gitlab
config.assets.precompile << "page_bundles/error_tracking_index.css" config.assets.precompile << "page_bundles/error_tracking_index.css"
config.assets.precompile << "page_bundles/signup.css" config.assets.precompile << "page_bundles/signup.css"
config.assets.precompile << "page_bundles/ide.css" config.assets.precompile << "page_bundles/ide.css"
config.assets.precompile << "page_bundles/import.css"
config.assets.precompile << "page_bundles/issues_list.css" config.assets.precompile << "page_bundles/issues_list.css"
config.assets.precompile << "page_bundles/jira_connect.css" config.assets.precompile << "page_bundles/jira_connect.css"
config.assets.precompile << "page_bundles/jira_connect_users.css" config.assets.precompile << "page_bundles/jira_connect_users.css"
......
...@@ -12,7 +12,7 @@ module QA ...@@ -12,7 +12,7 @@ module QA
element :authenticate_button element :authenticate_button
end end
view 'app/assets/javascripts/import_projects/components/provider_repo_table_row.vue' do view 'app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue' do
element :project_import_row element :project_import_row
element :project_namespace_select element :project_namespace_select
element :project_path_field element :project_path_field
......
...@@ -2,8 +2,8 @@ import { nextTick } from 'vue'; ...@@ -2,8 +2,8 @@ import { nextTick } from 'vue';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlAlert } from '@gitlab/ui'; import { GlAlert } from '@gitlab/ui';
import BitbucketStatusTable from '~/import_projects/components/bitbucket_status_table.vue'; import BitbucketStatusTable from '~/import_entities/import_projects/components/bitbucket_status_table.vue';
import ImportProjectsTable from '~/import_projects/components/import_projects_table.vue'; import ImportProjectsTable from '~/import_entities/import_projects/components/import_projects_table.vue';
const ImportProjectsTableStub = { const ImportProjectsTableStub = {
name: 'ImportProjectsTable', name: 'ImportProjectsTable',
......
...@@ -2,11 +2,11 @@ import { nextTick } from 'vue'; ...@@ -2,11 +2,11 @@ import { nextTick } from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlLoadingIcon, GlButton, GlIntersectionObserver } from '@gitlab/ui'; import { GlLoadingIcon, GlButton, GlIntersectionObserver } from '@gitlab/ui';
import state from '~/import_projects/store/state'; import state from '~/import_entities/import_projects/store/state';
import * as getters from '~/import_projects/store/getters'; import * as getters from '~/import_entities/import_projects/store/getters';
import { STATUSES } from '~/import_projects/constants'; import { STATUSES } from '~/import_entities/constants';
import ImportProjectsTable from '~/import_projects/components/import_projects_table.vue'; import ImportProjectsTable from '~/import_entities/import_projects/components/import_projects_table.vue';
import ProviderRepoTableRow from '~/import_projects/components/provider_repo_table_row.vue'; import ProviderRepoTableRow from '~/import_entities/import_projects/components/provider_repo_table_row.vue';
describe('ImportProjectsTable', () => { describe('ImportProjectsTable', () => {
let wrapper; let wrapper;
......
...@@ -2,9 +2,9 @@ import { nextTick } from 'vue'; ...@@ -2,9 +2,9 @@ import { nextTick } from 'vue';
import Vuex from 'vuex'; import Vuex from 'vuex';
import { createLocalVue, shallowMount } from '@vue/test-utils'; import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlBadge } from '@gitlab/ui'; import { GlBadge } from '@gitlab/ui';
import ProviderRepoTableRow from '~/import_projects/components/provider_repo_table_row.vue'; import ProviderRepoTableRow from '~/import_entities/import_projects/components/provider_repo_table_row.vue';
import ImportStatus from '~/import_projects/components/import_status.vue'; import ImportStatus from '~/import_entities/components/import_status.vue';
import { STATUSES } from '~/import_projects/constants'; import { STATUSES } from '~/import_entities//constants';
import Select2Select from '~/vue_shared/components/select2_select.vue'; import Select2Select from '~/vue_shared/components/select2_select.vue';
describe('ProviderRepoTableRow', () => { describe('ProviderRepoTableRow', () => {
......
...@@ -17,11 +17,11 @@ import { ...@@ -17,11 +17,11 @@ import {
RECEIVE_NAMESPACES_ERROR, RECEIVE_NAMESPACES_ERROR,
SET_PAGE, SET_PAGE,
SET_FILTER, SET_FILTER,
} from '~/import_projects/store/mutation_types'; } from '~/import_entities/import_projects/store/mutation_types';
import actionsFactory from '~/import_projects/store/actions'; import actionsFactory from '~/import_entities/import_projects/store/actions';
import { getImportTarget } from '~/import_projects/store/getters'; import { getImportTarget } from '~/import_entities/import_projects/store/getters';
import state from '~/import_projects/store/state'; import state from '~/import_entities/import_projects/store/state';
import { STATUSES } from '~/import_projects/constants'; import { STATUSES } from '~/import_entities/constants';
jest.mock('~/flash'); jest.mock('~/flash');
......
...@@ -5,9 +5,9 @@ import { ...@@ -5,9 +5,9 @@ import {
hasImportableRepos, hasImportableRepos,
importAllCount, importAllCount,
getImportTarget, getImportTarget,
} from '~/import_projects/store/getters'; } from '~/import_entities/import_projects/store/getters';
import { STATUSES } from '~/import_projects/constants'; import { STATUSES } from '~/import_entities/constants';
import state from '~/import_projects/store/state'; import state from '~/import_entities/import_projects/store/state';
const IMPORTED_REPO = { const IMPORTED_REPO = {
importSource: {}, importSource: {},
......
import * as types from '~/import_projects/store/mutation_types'; import * as types from '~/import_entities/import_projects/store/mutation_types';
import mutations from '~/import_projects/store/mutations'; import mutations from '~/import_entities/import_projects/store/mutations';
import getInitialState from '~/import_projects/store/state'; import getInitialState from '~/import_entities/import_projects/store/state';
import { STATUSES } from '~/import_projects/constants'; import { STATUSES } from '~/import_entities/constants';
describe('import_projects store mutations', () => { describe('import_projects store mutations', () => {
let state; let state;
......
import { isProjectImportable, isIncompatible, getImportStatus } from '~/import_projects/utils'; import {
import { STATUSES } from '~/import_projects/constants'; isProjectImportable,
isIncompatible,
getImportStatus,
} from '~/import_entities/import_projects/utils';
import { STATUSES } from '~/import_entities/constants';
describe('import_projects utils', () => { describe('import_projects utils', () => {
const COMPATIBLE_PROJECT = { const COMPATIBLE_PROJECT = {
......
...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; ...@@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import BitbucketServerStatusTable from '~/pages/import/bitbucket_server/status/components/bitbucket_server_status_table.vue'; import BitbucketServerStatusTable from '~/pages/import/bitbucket_server/status/components/bitbucket_server_status_table.vue';
import BitbucketStatusTable from '~/import_projects/components/bitbucket_status_table.vue'; import BitbucketStatusTable from '~/import_entities/import_projects/components/bitbucket_status_table.vue';
const BitbucketStatusTableStub = { const BitbucketStatusTableStub = {
name: 'BitbucketStatusTable', name: 'BitbucketStatusTable',
......
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