From 0d1af3d2049320c1472faf7beba773958070ea0c Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Wed, 10 Jan 2018 11:10:58 -0600 Subject: [PATCH 1/2] Refactor dispatcher dashboard mr path --- app/assets/javascripts/dispatcher.js | 5 +++-- .../javascripts/pages/dashboard/merge_requests/index.js | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/pages/dashboard/merge_requests/index.js diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index a282b67b0fc..0a8bf69a022 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -209,8 +209,9 @@ import Activities from './activities'; .catch(fail); break; case 'dashboard:merge_requests': - projectSelect(); - initLegacyFilters(); + import('./pages/dashboard/merge_requests') + .then(callDefault) + .catch(fail); break; case 'groups:issues': case 'groups:merge_requests': diff --git a/app/assets/javascripts/pages/dashboard/merge_requests/index.js b/app/assets/javascripts/pages/dashboard/merge_requests/index.js new file mode 100644 index 00000000000..b7353669e65 --- /dev/null +++ b/app/assets/javascripts/pages/dashboard/merge_requests/index.js @@ -0,0 +1,7 @@ +import projectSelect from '~/project_select'; +import initLegacyFilters from '~/init_legacy_filters'; + +export default () => { + projectSelect(); + initLegacyFilters(); +}; From b3ea91a1f60952d614dcfce95c05d2fb6ea2f714 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Wed, 10 Jan 2018 11:56:36 -0600 Subject: [PATCH 2/2] Remove initLegacyFilters reference in dispatcher --- app/assets/javascripts/dispatcher.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index 0a8bf69a022..d36fa49e00b 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -67,7 +67,6 @@ import OAuthRememberMe from './oauth_remember_me'; 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'; import initProjectVisibilitySelector from './project_visibility'; import GpgBadges from './gpg_badges';