BigW Consortium Gitlab

Commit 5d58766f by Constance Okoghenun

Refactored profile:* and help:* imports in dispatcher

parent 8de1bb9e
...@@ -59,11 +59,9 @@ import Star from './star'; ...@@ -59,11 +59,9 @@ import Star from './star';
import TreeView from './tree'; import TreeView from './tree';
import UsagePing from './usage_ping'; import UsagePing from './usage_ping';
import UsernameValidator from './username_validator'; import UsernameValidator from './username_validator';
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 OAuthRememberMe from './oauth_remember_me'; import OAuthRememberMe from './oauth_remember_me';
import PerformanceBar from './performance_bar'; import PerformanceBar from './performance_bar';
import initBroadcastMessagesForm from './broadcast_message'; import initBroadcastMessagesForm from './broadcast_message';
...@@ -159,7 +157,9 @@ import Activities from './activities'; ...@@ -159,7 +157,9 @@ import Activities from './activities';
switch (page) { switch (page) {
case 'profiles:preferences:show': case 'profiles:preferences:show':
initExperimentalFlags(); import('./pages/profiles/preferences')
.then(callDefault)
.catch(fail);
break; break;
case 'sessions:new': case 'sessions:new':
new UsernameValidator(); new UsernameValidator();
...@@ -512,7 +512,7 @@ import Activities from './activities'; ...@@ -512,7 +512,7 @@ import Activities from './activities';
new BlobViewer(); new BlobViewer();
break; break;
case 'help:index': case 'help:index':
VersionCheckImage.bindErrorEvent($('img.js-version-status-badge')); import('./pages/help').then(module => module.default()).catch(fail);
break; break;
case 'search:show': case 'search:show':
new Search(); new Search();
...@@ -557,6 +557,10 @@ import Activities from './activities'; ...@@ -557,6 +557,10 @@ import Activities from './activities';
new UsersSelect(); new UsersSelect();
break; break;
case 'profiles:personal_access_tokens:index': 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':
new DueDateSelectors(); new DueDateSelectors();
break; break;
...@@ -623,8 +627,9 @@ import Activities from './activities'; ...@@ -623,8 +627,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();
import initExperimentalFlags from '../../../experimental_flags';
export default () => initExperimentalFlags();
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