Commit e5b9b8c3 authored by Clement Ho's avatar Clement Ho Committed by Jacob Schatz

Remove ee dynamic imports

parent 2c258dbe
......@@ -57,6 +57,7 @@ var Dispatcher;
case 'projects:commits:show':
case 'projects:show':
case 'groups:show':
case 'projects:tree:show':
case 'projects:find_file:show':
case 'projects:blob:show':
case 'projects:blame:show':
......@@ -65,12 +66,6 @@ var Dispatcher;
case 'projects:artifacts:file':
shortcut_handler = true;
break;
case 'projects:tree:show':
import(/* webpackChunkName: "ee_projects_edit" */ 'ee/pages/projects/tree/show')
.then(callDefault)
.catch(fail);
shortcut_handler = true;
break;
}
switch (path[0]) {
case 'admin':
......@@ -155,108 +150,6 @@ var Dispatcher;
new Shortcuts();
}
// EE-only route-based code
switch (page) {
case 'groups:epics:show':
import(/* webpackChunkName: "ee_epics_show" */ 'ee/pages/groups/epics/show')
.then(callDefault)
.catch(fail);
break;
case 'groups:epics:index':
import(/* webpackChunkName: "ee_epics_index" */ 'ee/pages/groups/epics/index')
.then(callDefault)
.catch(fail);
break;
case 'projects:milestones:show':
import(/* webpackChunkName: "ee_projects_milestones_show" */ 'ee/pages/projects/milestones/show')
.then(callDefault)
.catch(fail);
break;
case 'search:show':
import(/* webpackChunkName: "ee_search_show" */ 'ee/pages/search/show')
.then(callDefault)
.catch(fail);
break;
case 'projects:merge_requests:creations:new':
import(/* webpackChunkName: "ee_merge_requests_creations_new" */ 'ee/pages/projects/merge_requests/creations/new')
.then(callDefault)
.catch(fail);
break;
case 'projects:merge_requests:creations:diffs':
import(/* webpackChunkName: "ee_merge_requests_creations_diffs" */ 'ee/pages/projects/merge_requests/creations/diffs')
.then(callDefault)
.catch(fail);
break;
case 'projects:merge_requests:edit':
import(/* webpackChunkName: "ee_merge_requests_edit" */ 'ee/pages/projects/merge_requests/edit')
.then(callDefault)
.catch(fail);
break;
case 'projects:show':
import(/* webpackChunkName: "ee_projects_show" */ 'ee/pages/projects/show')
.then(callDefault)
.catch(fail);
break;
case 'projects:blob:show':
import(/* webpackChunkName: "ee_projects_blob_show" */ 'ee/pages/projects/blob/show')
.then(callDefault)
.catch(fail);
break;
case 'projects:blame:show':
import(/* webpackChunkName: "ee_projects_blame_show" */ 'ee/pages/projects/blame/show')
.then(callDefault)
.catch(fail);
break;
case 'admin:emails:show':
import(/* webpackChunkName: "ee_admin_emails_show" */ 'ee/pages/admin/emails/show').then(m => m.default()).catch(fail);
break;
case 'admin:audit_logs:index':
import(/* webpackChunkName: "ee_audit_logs" */ 'ee/pages/admin/audit_logs').then(m => m.default()).catch(fail);
break;
case 'projects:settings:repository:show':
import(/* webpackChunkName: "ee_projects_settings_repository_show" */ 'ee/pages/projects/settings/repository/show')
.then(callDefault)
.catch(fail);
break;
case 'admin:licenses:new':
import(/* webpackChunkName: "admin_licenses" */ 'ee/pages/admin/licenses/new').then(m => m.default()).catch(fail);
break;
case 'groups:analytics:show':
import(/* webpackChunkName: "ee_groups_analytics_show" */ 'ee/pages/groups/analytics/show')
.then(callDefault)
.catch(fail);
break;
case 'groups:ldap_group_links:index':
import(/* webpackChunkName: "ee_groups_ldap_links" */ 'ee/pages/groups/ldap_group_links')
.then(callDefault)
.catch(fail);
break;
case 'admin:groups:edit':
import(/* webpackChunkName: "ee_admin_groups_edit" */ 'ee/pages/admin/groups/edit').then(m => m.default()).catch(fail);
break;
case 'admin:geo_nodes:new':
import(/* webpackChunkName: 'ee_admin_geo_nodes_new' */ 'ee/pages/admin/geo_nodes/new')
.then(callDefault)
.catch(fail);
break;
case 'admin:geo_nodes:create':
import(/* webpackChunkName: 'ee_admin_geo_nodes_create' */ 'ee/pages/admin/geo_nodes/create')
.then(callDefault)
.catch(fail);
break;
case 'admin:geo_nodes:edit':
import(/* webpackChunkName: 'ee_admin_geo_nodes_edit' */ 'ee/pages/admin/geo_nodes/edit')
.then(callDefault)
.catch(fail);
break;
case 'admin:geo_nodes:update':
import(/* webpackChunkName: 'ee_admin_geo_nodes_update' */ 'ee/pages/admin/geo_nodes/update')
.then(callDefault)
.catch(fail);
break;
}
if (document.querySelector('#peek')) {
import('./performance_bar')
.then(m => new m.default({ container: '#peek' })) // eslint-disable-line new-cap
......
import AuditLogs from './audit_logs';
export default () => new AuditLogs();
document.addEventListener('DOMContentLoaded', () => new AuditLogs());
import AdminEmailSelect from './admin_email_select';
export default () => new AdminEmailSelect();
document.addEventListener('DOMContentLoaded', () => new AdminEmailSelect());
import initForm from '../shared/init_form';
export default () => initForm();
document.addEventListener('DOMContentLoaded', initForm);
import initForm from '../shared/init_form';
export default () => initForm();
document.addEventListener('DOMContentLoaded', initForm);
import initForm from '../shared/init_form';
export default () => initForm();
document.addEventListener('DOMContentLoaded', initForm);
import initForm from '../shared/init_form';
export default () => initForm();
document.addEventListener('DOMContentLoaded', initForm);
import initLDAPGroupsSelect from '../../../../ldap_groups_select';
import initLDAPGroupsSelect from 'ee/ldap_groups_select';
export default () => initLDAPGroupsSelect();
document.addEventListener('DOMContentLoaded', initLDAPGroupsSelect);
export default () => {
document.addEventListener('DOMContentLoaded', () => {
const $licenseFile = $('.license-file');
const $licenseKey = $('.license-key');
......@@ -11,4 +11,4 @@ export default () => {
$('input[name="license_type"]').on('change', showLicenseType);
showLicenseType();
};
});
import Chart from 'chart.js';
export default () => {
document.addEventListener('DOMContentLoaded', () => {
const dataEl = document.getElementById('js-analytics-data');
if (dataEl) {
const data = JSON.parse(dataEl.innerHTML);
......@@ -33,4 +33,4 @@ export default () => {
$('#event-stats').tablesorter();
}
};
});
import FilteredSearchManager from '~/filtered_search/filtered_search_manager';
import FilteredSearchTokenKeysEpics from 'ee/filtered_search/filtered_search_token_keys_epics';
export default () => {
document.addEventListener('DOMContentLoaded', () => {
const filteredSearchEnabled = FilteredSearchManager && document.querySelector('.filtered-search');
if (filteredSearchEnabled) {
const filteredSearchManager = new FilteredSearchManager({
......@@ -11,4 +11,4 @@ export default () => {
});
filteredSearchManager.setup();
}
};
});
import ZenMode from '~/zen_mode';
export default () => new ZenMode();
document.addEventListener('DOMContentLoaded', () => new ZenMode());
import initLDAPGroupsSelect from 'ee/ldap_groups_select';
export default initLDAPGroupsSelect;
document.addEventListener('DOMContentLoaded', initLDAPGroupsSelect);
import '~/pages/projects/blame/show/index';
import initBlob from '../../shared/init_blob';
export default () => initBlob();
document.addEventListener('DOMContentLoaded', initBlob);
import '~/pages/projects/blob/show/index';
import initBlob from '../../shared/init_blob';
export default initBlob;
document.addEventListener('DOMContentLoaded', initBlob);
import initForm from '../../shared/init_form';
export default () => initForm();
document.addEventListener('DOMContentLoaded', initForm);
......@@ -2,7 +2,7 @@ import '~/pages/projects/merge_requests/creations/new/index';
import UserCallout from '~/user_callout';
import initForm from '../../shared/init_form';
export default () => {
document.addEventListener('DOMContentLoaded', () => {
initForm();
return new UserCallout();
};
});
import '~/pages/projects/merge_requests/edit/index';
import initForm from '../shared/init_form';
export default () => initForm();
document.addEventListener('DOMContentLoaded', initForm);
import '~/pages/projects/milestones/show/index';
import UserCallout from '~/user_callout';
export default () => new UserCallout();
document.addEventListener('DOMContentLoaded', () => new UserCallout());
......@@ -2,7 +2,7 @@ import '~/pages/projects/settings/repository/show/index';
import UsersSelect from '~/users_select';
import UserCallout from '~/user_callout';
export default () => {
document.addEventListener('DOMContentLoaded', () => {
new UsersSelect(); // eslint-disable-line no-new
new UserCallout(); // eslint-disable-line no-new
};
});
import '~/pages/projects/show/index';
import initGeoInfoModal from '../../../init_geo_info_modal';
export default () => initGeoInfoModal();
document.addEventListener('DOMContentLoaded', initGeoInfoModal);
import '~/pages/projects/tree/show/index';
import initPathLocks from 'ee/path_locks';
export default () => {
document.addEventListener('DOMContentLoaded', () => {
if (document.querySelector('.js-tree-content').dataset.pathLocksAvailable === 'true') {
initPathLocks(
document.querySelector('.js-tree-content').dataset.pathLocksToggle,
document.querySelector('.js-tree-content').dataset.pathLocksPath,
);
}
};
});
import '~/pages/search/show/index';
import UserCallout from '~/user_callout';
export default () => new UserCallout();
document.addEventListener('DOMContentLoaded', () => new UserCallout());
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