summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-01-22 17:09:08 -0600
committerClement Ho <ClemMakesApps@gmail.com>2018-01-22 17:09:08 -0600
commit57749eca898ca12546313068f2492ab4d2d0afe2 (patch)
tree402602e89cbae5dc674fd608b54b57ba3469cf73
parent10a246b64a5b369f0addda99dd9c0ecfa9749e0f (diff)
downloadgitlab-ce-57749eca898ca12546313068f2492ab4d2d0afe2.tar.gz
Refactor dispatcher milestones show pathdispatcher-milestones-show-path
-rw-r--r--app/assets/javascripts/dispatcher.js11
-rw-r--r--app/assets/javascripts/pages/groups/milestones/show/index.js3
-rw-r--r--app/assets/javascripts/pages/init_milestones_show.js9
-rw-r--r--app/assets/javascripts/pages/projects/milestones/show/index.js3
4 files changed, 22 insertions, 4 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index a8855df502b..8ab159da3c5 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -1,9 +1,7 @@
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-arrow-callback, wrap-iife, no-shadow, consistent-return, one-var, one-var-declaration-per-line, camelcase, default-case, no-new, quotes, no-duplicate-case, no-case-declarations, no-fallthrough, max-len */
-import Milestone from './milestone';
import notificationsDropdown from './notifications_dropdown';
import LineHighlighter from './line_highlighter';
import MergeRequest from './merge_request';
-import Sidebar from './right_sidebar';
import Flash from './flash';
import BlobViewer from './blob/viewer/index';
import GfmAutoComplete from './gfm_auto_complete';
@@ -92,9 +90,14 @@ import SearchAutocomplete from './search_autocomplete';
.catch(fail);
break;
case 'projects:milestones:show':
+ import('./pages/projects/milestones/show')
+ .then(callDefault)
+ .catch(fail);
+ break;
case 'groups:milestones:show':
- new Milestone();
- new Sidebar();
+ import('./pages/groups/milestones/show')
+ .then(callDefault)
+ .catch(fail);
break;
case 'dashboard:milestones:show':
import('./pages/dashboard/milestones/show')
diff --git a/app/assets/javascripts/pages/groups/milestones/show/index.js b/app/assets/javascripts/pages/groups/milestones/show/index.js
new file mode 100644
index 00000000000..0c3ce848e3d
--- /dev/null
+++ b/app/assets/javascripts/pages/groups/milestones/show/index.js
@@ -0,0 +1,3 @@
+import initMilestonesShow from '~/pages/init_milestones_show';
+
+export default initMilestonesShow;
diff --git a/app/assets/javascripts/pages/init_milestones_show.js b/app/assets/javascripts/pages/init_milestones_show.js
new file mode 100644
index 00000000000..7aa5be0d5b9
--- /dev/null
+++ b/app/assets/javascripts/pages/init_milestones_show.js
@@ -0,0 +1,9 @@
+/* eslint-disable no-new */
+
+import Milestone from '~/milestone';
+import Sidebar from '~/right_sidebar';
+
+export default () => {
+ new Milestone();
+ new Sidebar();
+};
diff --git a/app/assets/javascripts/pages/projects/milestones/show/index.js b/app/assets/javascripts/pages/projects/milestones/show/index.js
new file mode 100644
index 00000000000..0c3ce848e3d
--- /dev/null
+++ b/app/assets/javascripts/pages/projects/milestones/show/index.js
@@ -0,0 +1,3 @@
+import initMilestonesShow from '~/pages/init_milestones_show';
+
+export default initMilestonesShow;