summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-01-11 16:48:17 +0000
committerPhil Hughes <me@iamphill.com>2018-01-11 16:48:17 +0000
commitd41f0ee721278adb48a39c89654f53bb495af03d (patch)
tree8450ebe14521c79a335f4ab13aa62fbc1b18918d
parentd9aaf0ba81c3138fc315d669398b8306b284b7cf (diff)
parent0fe784cbfb56a701259d83c989341afb1b7bc124 (diff)
downloadgitlab-ce-d41f0ee721278adb48a39c89654f53bb495af03d.tar.gz
Merge branch 'help-profiles-dispatcher-refactor' into 'master'
Refactored profile:* and help:* imports in dispatcher See merge request gitlab-org/gitlab-ce!16330
-rw-r--r--app/assets/javascripts/dispatcher.js22
-rw-r--r--app/assets/javascripts/pages/help/index.js3
-rw-r--r--app/assets/javascripts/pages/profiles/index/index.js7
-rw-r--r--app/assets/javascripts/pages/profiles/personal_access_tokens/index.js3
4 files changed, 24 insertions, 11 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 2c1809c929c..72a6426e901 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -47,11 +47,9 @@ import GfmAutoComplete from './gfm_auto_complete';
import ShortcutsBlob from './shortcuts_blob';
import Star from './star';
import TreeView from './tree';
-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 initNotes from './init_notes';
import initLegacyFilters from './init_legacy_filters';
@@ -143,9 +141,6 @@ import Activities from './activities';
const filteredSearchEnabled = gl.FilteredSearchManager && document.querySelector('.filtered-search');
switch (page) {
- case 'profiles:preferences:show':
- initExperimentalFlags();
- break;
case 'sessions:new':
import('./pages/sessions/new')
.then(callDefault)
@@ -513,7 +508,9 @@ import Activities from './activities';
shortcut_handler = true;
break;
case 'help:index':
- VersionCheckImage.bindErrorEvent($('img.js-version-status-badge'));
+ import('./pages/help')
+ .then(callDefault)
+ .catch(fail);
break;
case 'search:show':
import('./pages/search/show')
@@ -556,14 +553,16 @@ import Activities from './activities';
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':
+ import('./pages/profiles/personal_access_tokens')
+ .then(callDefault)
+ .catch(fail);
+ break;
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':
import(/* webpackChunkName: "clusters" */ './clusters/clusters_bundle')
.then(cluster => new cluster.default()) // eslint-disable-line new-cap
@@ -649,8 +648,9 @@ import Activities from './activities';
new UserCallout();
break;
case 'profiles':
- new NotificationsForm();
- notificationsDropdown();
+ import('./pages/profiles/index/')
+ .then(callDefault)
+ .catch(fail);
break;
case 'projects':
new Project();
diff --git a/app/assets/javascripts/pages/help/index.js b/app/assets/javascripts/pages/help/index.js
new file mode 100644
index 00000000000..4cf8afc4b7e
--- /dev/null
+++ b/app/assets/javascripts/pages/help/index.js
@@ -0,0 +1,3 @@
+import VersionCheckImage from '../../version_check_image';
+
+export default () => VersionCheckImage.bindErrorEvent($('img.js-version-status-badge'));
diff --git a/app/assets/javascripts/pages/profiles/index/index.js b/app/assets/javascripts/pages/profiles/index/index.js
new file mode 100644
index 00000000000..90eed38777a
--- /dev/null
+++ b/app/assets/javascripts/pages/profiles/index/index.js
@@ -0,0 +1,7 @@
+import NotificationsForm from '../../../notifications_form';
+import notificationsDropdown from '../../../notifications_dropdown';
+
+export default () => {
+ new NotificationsForm(); // eslint-disable-line no-new
+ notificationsDropdown();
+};
diff --git a/app/assets/javascripts/pages/profiles/personal_access_tokens/index.js b/app/assets/javascripts/pages/profiles/personal_access_tokens/index.js
new file mode 100644
index 00000000000..030328a1363
--- /dev/null
+++ b/app/assets/javascripts/pages/profiles/personal_access_tokens/index.js
@@ -0,0 +1,3 @@
+import DueDateSelectors from '../../../due_date_select';
+
+export default () => new DueDateSelectors();