summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-10-12 08:15:21 +0000
committerTim Zallmann <tzallmann@gitlab.com>2017-10-12 08:15:21 +0000
commit4448b911602f6d6f784f8692898f31e536864ab4 (patch)
tree350d650859c6d7888e6c4a348a033df01ca23bb6 /app
parentad5b96952e9eb90dc72d640f01aca01b5d0a2a12 (diff)
parent16a97d644c442f67ff23caa4d744d8cfa06f144b (diff)
downloadgitlab-ce-4448b911602f6d6f784f8692898f31e536864ab4.tar.gz
Merge branch '39033-d3-js-is-being-included-in-the-user_profile-and-graphs_show-bundles' into 'master'
Resolve "d3.js is being included in the user_profile and graphs_show bundles" Closes #39033 See merge request gitlab-org/gitlab-ce!14826
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/dispatcher.js6
-rw-r--r--app/assets/javascripts/users/index.js8
-rw-r--r--app/views/users/show.html.haml3
3 files changed, 10 insertions, 7 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index 4442e2ebf44..0a653d7fefc 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -634,12 +634,6 @@ import U2FAuthenticate from './u2f/authenticate';
shortcut_handler = new ShortcutsNavigation();
}
break;
- case 'users':
- const action = path[1];
- import(/* webpackChunkName: 'user_profile' */ './users')
- .then(user => user.default(action))
- .catch(() => {});
- break;
}
// If we haven't installed a custom shortcut handler, install the default one
if (!shortcut_handler) {
diff --git a/app/assets/javascripts/users/index.js b/app/assets/javascripts/users/index.js
index 33a83f8dae5..9fd8452a2b6 100644
--- a/app/assets/javascripts/users/index.js
+++ b/app/assets/javascripts/users/index.js
@@ -1,7 +1,7 @@
import Cookies from 'js-cookie';
import UserTabs from './user_tabs';
-export default function initUserProfile(action) {
+function initUserProfile(action) {
// place profile avatars to top
$('.profile-groups-avatars').tooltip({
placement: 'top',
@@ -17,3 +17,9 @@ export default function initUserProfile(action) {
$(this).parents('.project-limit-message').remove();
});
}
+
+document.addEventListener('DOMContentLoaded', () => {
+ const page = $('body').attr('data-page');
+ const action = page.split(':')[1];
+ initUserProfile(action);
+});
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index 6c3cd6ecefe..cc59f8660fd 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -4,6 +4,9 @@
- page_description @user.bio
- header_title @user.name, user_path(@user)
- @no_container = true
+- content_for :page_specific_javascripts do
+ = webpack_bundle_tag 'common_d3'
+ = webpack_bundle_tag 'users'
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity")