Commit d41f0ee7 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'help-profiles-dispatcher-refactor' into 'master'

Refactored profile:* and help:* imports in dispatcher

See merge request gitlab-org/gitlab-ce!16330
parents d9aaf0ba 0fe784cb
...@@ -47,11 +47,9 @@ import GfmAutoComplete from './gfm_auto_complete'; ...@@ -47,11 +47,9 @@ import GfmAutoComplete from './gfm_auto_complete';
import ShortcutsBlob from './shortcuts_blob'; import ShortcutsBlob from './shortcuts_blob';
import Star from './star'; import Star from './star';
import TreeView from './tree'; import TreeView from './tree';
import VersionCheckImage from './version_check_image';
import Wikis from './wikis'; import Wikis from './wikis';
import ZenMode from './zen_mode'; import ZenMode from './zen_mode';
import initSettingsPanels from './settings_panels'; import initSettingsPanels from './settings_panels';
import initExperimentalFlags from './experimental_flags';
import PerformanceBar from './performance_bar'; import PerformanceBar from './performance_bar';
import initNotes from './init_notes'; import initNotes from './init_notes';
import initLegacyFilters from './init_legacy_filters'; import initLegacyFilters from './init_legacy_filters';
...@@ -143,9 +141,6 @@ import Activities from './activities'; ...@@ -143,9 +141,6 @@ import Activities from './activities';
const filteredSearchEnabled = gl.FilteredSearchManager && document.querySelector('.filtered-search'); const filteredSearchEnabled = gl.FilteredSearchManager && document.querySelector('.filtered-search');
switch (page) { switch (page) {
case 'profiles:preferences:show':
initExperimentalFlags();
break;
case 'sessions:new': case 'sessions:new':
import('./pages/sessions/new') import('./pages/sessions/new')
.then(callDefault) .then(callDefault)
...@@ -513,7 +508,9 @@ import Activities from './activities'; ...@@ -513,7 +508,9 @@ import Activities from './activities';
shortcut_handler = true; shortcut_handler = true;
break; break;
case 'help:index': case 'help:index':
VersionCheckImage.bindErrorEvent($('img.js-version-status-badge')); import('./pages/help')
.then(callDefault)
.catch(fail);
break; break;
case 'search:show': case 'search:show':
import('./pages/search/show') import('./pages/search/show')
...@@ -556,14 +553,16 @@ import Activities from './activities'; ...@@ -556,14 +553,16 @@ import Activities from './activities';
case 'import:fogbugz:new_user_map': case 'import:fogbugz:new_user_map':
import('./pages/import/fogbugz/new_user_map').then(m => m.default()).catch(fail); import('./pages/import/fogbugz/new_user_map').then(m => m.default()).catch(fail);
break; break;
case 'profiles:personal_access_tokens:index':
import('./pages/profiles/personal_access_tokens')
.then(callDefault)
.catch(fail);
break;
case 'admin:impersonation_tokens:index': case 'admin:impersonation_tokens:index':
import('./pages/admin/impersonation_tokens') import('./pages/admin/impersonation_tokens')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
case 'profiles:personal_access_tokens:index':
new DueDateSelectors();
break;
case 'projects:clusters:show': case 'projects:clusters:show':
import(/* webpackChunkName: "clusters" */ './clusters/clusters_bundle') import(/* webpackChunkName: "clusters" */ './clusters/clusters_bundle')
.then(cluster => new cluster.default()) // eslint-disable-line new-cap .then(cluster => new cluster.default()) // eslint-disable-line new-cap
...@@ -649,8 +648,9 @@ import Activities from './activities'; ...@@ -649,8 +648,9 @@ import Activities from './activities';
new UserCallout(); new UserCallout();
break; break;
case 'profiles': case 'profiles':
new NotificationsForm(); import('./pages/profiles/index/')
notificationsDropdown(); .then(callDefault)
.catch(fail);
break; break;
case 'projects': case 'projects':
new Project(); new Project();
......
import VersionCheckImage from '../../version_check_image';
export default () => VersionCheckImage.bindErrorEvent($('img.js-version-status-badge'));
import NotificationsForm from '../../../notifications_form';
import notificationsDropdown from '../../../notifications_dropdown';
export default () => {
new NotificationsForm(); // eslint-disable-line no-new
notificationsDropdown();
};
import DueDateSelectors from '../../../due_date_select';
export default () => new DueDateSelectors();
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