Commit 5eae329b authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ee-admin-dispatcher' into 'master'

EE port of admin-dispatcher

See merge request gitlab-org/gitlab-ee!3970
parents 0e427d63 3266f890
......@@ -13,8 +13,6 @@ import groupAvatar from './group_avatar';
import GroupLabelSubscription from './group_label_subscription';
import LineHighlighter from './line_highlighter';
import groupsSelect from './groups_select';
import initAdmin from './admin';
import NamespaceSelect from './namespace_select';
import NewCommitForm from './new_commit_form';
import Project from './project';
import projectAvatar from './project_avatar';
......@@ -52,14 +50,12 @@ import GfmAutoComplete from './gfm_auto_complete';
import ShortcutsBlob from './shortcuts_blob';
import Star from './star';
import TreeView from './tree';
import UsagePing from './usage_ping';
import VersionCheckImage from './version_check_image';
import Wikis from './wikis';
import ZenMode from './zen_mode';
import initSettingsPanels from './settings_panels';
import initExperimentalFlags from './experimental_flags';
import PerformanceBar from './performance_bar';
import initBroadcastMessagesForm from './broadcast_message';
import initNotes from './init_notes';
import initLegacyFilters from './init_legacy_filters';
import initIssuableSidebar from './init_issuable_sidebar';
......@@ -67,7 +63,6 @@ import initProjectVisibilitySelector from './project_visibility';
import GpgBadges from './gpg_badges';
import initChangesDropdown from './init_changes_dropdown';
import NewGroupChild from './groups/new_group_child';
import AbuseReports from './abuse_reports';
import { ajaxGet, convertPermissionToBoolean } from './lib/utils/common_utils';
import AjaxLoadingSpinner from './ajax_loading_spinner';
import GlFieldErrors from './gl_field_errors';
......@@ -87,10 +82,8 @@ import Activities from './activities';
// EE-only
import ApproversSelect from 'ee/approvers_select'; // eslint-disable-line import/first
import AuditLogs from 'ee/audit_logs'; // eslint-disable-line import/first
import initGeoInfoModal from 'ee/init_geo_info_modal'; // eslint-disable-line import/first
import initGroupAnalytics from 'ee/init_group_analytics'; // eslint-disable-line import/first
import AdminEmailSelect from 'ee/admin_email_select'; // eslint-disable-line import/first
import initPathLocks from 'ee/path_locks'; // eslint-disable-line import/first
import WeightSelect from 'ee/weight_select'; // eslint-disable-line import/first
import initApprovals from 'ee/approvals'; // eslint-disable-line import/first
......@@ -257,9 +250,6 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
.then(callDefault)
.catch(fail);
break;
case 'admin:projects:index':
new ProjectsList();
break;
case 'explore:groups:index':
import('./pages/explore/groups')
.then(callDefault)
......@@ -487,15 +477,23 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
new UsersSelect();
break;
case 'groups:new':
case 'admin:groups:new':
case 'groups:create':
case 'admin:groups:create':
BindInOut.initAll();
new Group();
groupAvatar();
break;
case 'groups:edit':
case 'admin:groups:create':
case 'admin:groups:new':
import('./pages/admin/groups/new')
.then(callDefault)
.catch(fail);
break;
case 'admin:groups:edit':
import('./pages/admin/groups/edit')
.then(callDefault)
.catch(fail);
break;
case 'groups:edit':
groupAvatar();
break;
case 'projects:tree:show':
......@@ -589,10 +587,10 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
new UsersSelect();
break;
case 'admin:emails:show':
new AdminEmailSelect();
import(/* webpackChunkName: "ee_admin_emails_show" */ 'ee/pages/admin/emails/show').then(m => m.default()).catch(fail);
break;
case 'admin:audit_logs:index':
new AuditLogs();
import(/* webpackChunkName: "ee_audit_logs" */ 'ee/pages/admin/audit_logs').then(m => m.default()).catch(fail);
break;
case 'projects:settings:repository:show':
new UsersSelect();
......@@ -632,8 +630,12 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
case 'import:fogbugz:new_user_map':
import('./pages/import/fogbugz/new_user_map').then(m => m.default()).catch(fail);
break;
case 'profiles:personal_access_tokens:index':
case 'admin:impersonation_tokens:index':
import('./pages/admin/impersonation_tokens')
.then(callDefault)
.catch(fail);
break;
case 'profiles:personal_access_tokens:index':
new DueDateSelectors();
break;
case 'projects:clusters:show':
......@@ -653,18 +655,7 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
});
break;
case 'admin:licenses:new':
const $licenseFile = $('.license-file');
const $licenseKey = $('.license-key');
const showLicenseType = () => {
const $checkedFile = $('input[name="license_type"]:checked').val() === 'file';
$licenseFile.toggle($checkedFile);
$licenseKey.toggle(!$checkedFile);
};
$('input[name="license_type"]').on('change', showLicenseType);
showLicenseType();
import(/* webpackChunkName: "admin_licenses" */ 'ee/pages/admin/licenses/new').then(m => m.default()).catch(fail);
break;
case 'groups:analytics:show':
initGroupAnalytics();
......@@ -688,36 +679,55 @@ import initLDAPGroupsSelect from 'ee/ldap_groups_select'; // eslint-disable-line
// needed in rspec
gl.u2fAuthenticate = u2fAuthenticate;
case 'admin':
initAdmin();
import('./pages/admin')
.then(callDefault)
.catch(fail);
switch (path[1]) {
case 'broadcast_messages':
initBroadcastMessagesForm();
import('./pages/admin/broadcast_messages')
.then(callDefault)
.catch(fail);
break;
case 'cohorts':
new UsagePing();
import('./pages/admin/cohorts')
.then(callDefault)
.catch(fail);
break;
case 'groups':
new UsersSelect();
switch (path[2]) {
case 'show':
import('./pages/admin/groups/show')
.then(callDefault)
.catch(fail);
break;
case 'edit':
initLDAPGroupsSelect();
import(/* webpackChunkName: "ee_admin_groups_edit" */ 'ee/pages/admin/groups/edit').then(m => m.default()).catch(fail);
break;
}
break;
case 'projects':
document.querySelectorAll('.js-namespace-select')
.forEach(dropdown => new NamespaceSelect({ dropdown }));
import('./pages/admin/projects')
.then(callDefault)
.catch(fail);
break;
case 'labels':
switch (path[2]) {
case 'new':
import('./pages/admin/labels/new')
.then(callDefault)
.catch(fail);
break;
case 'edit':
new Labels();
import('./pages/admin/labels/edit')
.then(callDefault)
.catch(fail);
break;
}
case 'abuse_reports':
new AbuseReports();
import('./pages/admin/abuse_reports')
.then(callDefault)
.catch(fail);
break;
case 'geo_nodes':
import(/* webpackChunkName: 'geo_node_form' */ './geo/geo_node_form')
......
import { truncate } from './lib/utils/text_utility';
import { truncate } from '../../../lib/utils/text_utility';
const MAX_MESSAGE_LENGTH = 500;
const MESSAGE_CELL_SELECTOR = '.abuse-reports .message';
......
import AbuseReports from './abuse_reports';
export default () => new AbuseReports();
import { refreshCurrentPage } from './lib/utils/url_utility';
import { refreshCurrentPage } from '../../lib/utils/url_utility';
function showBlacklistType() {
if ($('input[name="blacklist_type"]:checked').val() === 'file') {
......
import initBroadcastMessagesForm from './broadcast_message';
export default () => initBroadcastMessagesForm();
import initUsagePing from './usage_ping';
export default () => initUsagePing();
import groupAvatar from '../../../../group_avatar';
export default () => groupAvatar();
import BindInOut from '../../../../behaviors/bind_in_out';
import Group from '../../../../group';
import groupAvatar from '../../../../group_avatar';
export default () => {
BindInOut.initAll();
new Group(); // eslint-disable-line no-new
groupAvatar();
};
import UsersSelect from '../../../../users_select';
export default () => new UsersSelect();
import DueDateSelectors from '../../../due_date_select';
export default () => new DueDateSelectors();
import initAdmin from './admin';
export default () => initAdmin();
import Labels from '../../../../labels';
export default () => new Labels();
import Labels from '../../../../labels';
export default () => new Labels();
import ProjectsList from '../../../projects_list';
import NamespaceSelect from '../../../namespace_select';
export default () => {
new ProjectsList(); // eslint-disable-line no-new
document.querySelectorAll('.js-namespace-select')
.forEach(dropdown => new NamespaceSelect({ dropdown }));
};
import AuditLogs from './audit_logs';
export default () => new AuditLogs();
import AdminEmailSelect from './admin_email_select';
export default () => new AdminEmailSelect();
import initLDAPGroupsSelect from '../../../../ldap_groups_select';
export default () => initLDAPGroupsSelect();
export default () => {
const $licenseFile = $('.license-file');
const $licenseKey = $('.license-key');
const showLicenseType = () => {
const $checkedFile = $('input[name="license_type"]:checked').val() === 'file';
$licenseFile.toggle($checkedFile);
$licenseKey.toggle(!$checkedFile);
};
$('input[name="license_type"]').on('change', showLicenseType);
showLicenseType();
};
import '~/lib/utils/text_utility';
import AbuseReports from '~/abuse_reports';
import AbuseReports from '~/pages/admin/abuse_reports/abuse_reports';
describe('Abuse Reports', () => {
const FIXTURE = 'abuse_reports/abuse_reports_list.html.raw';
......
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