diff options
author | Constance Okoghenun <cokoghenun@gitlab.com> | 2018-02-12 22:24:58 +0100 |
---|---|---|
committer | Constance Okoghenun <cokoghenun@gitlab.com> | 2018-02-12 22:24:58 +0100 |
commit | a459d16f9318ba107c853167c3da749b310474aa (patch) | |
tree | b1885519206fb560f44e941e5ff130a93f263488 | |
parent | 1d21a63a6af12783ab00306de3741d114bcffbd5 (diff) | |
download | gitlab-ce-a459d16f9318ba107c853167c3da749b310474aa.tar.gz |
Removed webpack bundle tag and entry for '/javascripts/usersusers-show-dispatcher-refactor
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 7 | ||||
-rw-r--r-- | app/assets/javascripts/pages/users/show/index.js | 26 | ||||
-rw-r--r-- | app/assets/javascripts/users/index.js | 25 | ||||
-rw-r--r-- | config/webpack.config.js | 1 |
4 files changed, 29 insertions, 30 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index e3d30442339..86de8a9418c 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -463,12 +463,13 @@ var Dispatcher; .catch(fail); break; case 'users:show': + case 'users:groups': + case 'users:contributed': + case 'users:projects': + case 'users:snippets': import('./pages/users/show') .then(callDefault) .catch(fail); - import('./users') - .then(callDefault) - .catch(fail); break; case 'admin:conversational_development_index:show': import('./pages/admin/conversational_development_index/show') diff --git a/app/assets/javascripts/pages/users/show/index.js b/app/assets/javascripts/pages/users/show/index.js index f18f98b4e9a..cc030100944 100644 --- a/app/assets/javascripts/pages/users/show/index.js +++ b/app/assets/javascripts/pages/users/show/index.js @@ -1,3 +1,27 @@ import UserCallout from '~/user_callout'; +import Cookies from 'js-cookie'; +import UserTabs from '../../../users/user_tabs'; -export default () => new UserCallout(); +const initUserProfile = (action) => { + // place profile avatars to top + $('.profile-groups-avatars').tooltip({ + placement: 'top', + }); + + // eslint-disable-next-line no-new + new UserTabs({ parentEl: '.user-profile', action }); + + // hide project limit message + $('.hide-project-limit-message').on('click', (e) => { + e.preventDefault(); + Cookies.set('hide_project_limit_message', 'false'); + $(this).parents('.project-limit-message').remove(); + }); +}; + +export default () => { + const page = $('body').attr('data-page'); + const action = page.split(':')[1]; + initUserProfile(action); + new UserCallout(); // eslint-disable-line no-new +}; diff --git a/app/assets/javascripts/users/index.js b/app/assets/javascripts/users/index.js deleted file mode 100644 index 687f4de377c..00000000000 --- a/app/assets/javascripts/users/index.js +++ /dev/null @@ -1,25 +0,0 @@ -import Cookies from 'js-cookie'; -import UserTabs from './user_tabs'; - -function initUserProfile(action) { - // place profile avatars to top - $('.profile-groups-avatars').tooltip({ - placement: 'top', - }); - - // eslint-disable-next-line no-new - new UserTabs({ parentEl: '.user-profile', action }); - - // hide project limit message - $('.hide-project-limit-message').on('click', (e) => { - e.preventDefault(); - Cookies.set('hide_project_limit_message', 'false'); - $(this).parents('.project-limit-message').remove(); - }); -} - -export default () => { - const page = $('body').attr('data-page'); - const action = page.split(':')[1]; - initUserProfile(action); -}; diff --git a/config/webpack.config.js b/config/webpack.config.js index 7f3fe551a03..601d85d725b 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -102,7 +102,6 @@ var config = { vue_merge_request_widget: './vue_merge_request_widget/index.js', test: './test.js', two_factor_auth: './two_factor_auth.js', - users: './users/index.js', webpack_runtime: './webpack.js', }, |