Commit 4448b911 authored by Tim Zallmann's avatar Tim Zallmann

Merge branch...

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
parents ad5b9695 16a97d64
...@@ -634,12 +634,6 @@ import U2FAuthenticate from './u2f/authenticate'; ...@@ -634,12 +634,6 @@ import U2FAuthenticate from './u2f/authenticate';
shortcut_handler = new ShortcutsNavigation(); shortcut_handler = new ShortcutsNavigation();
} }
break; 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 we haven't installed a custom shortcut handler, install the default one
if (!shortcut_handler) { if (!shortcut_handler) {
......
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import UserTabs from './user_tabs'; import UserTabs from './user_tabs';
export default function initUserProfile(action) { function initUserProfile(action) {
// place profile avatars to top // place profile avatars to top
$('.profile-groups-avatars').tooltip({ $('.profile-groups-avatars').tooltip({
placement: 'top', placement: 'top',
...@@ -17,3 +17,9 @@ export default function initUserProfile(action) { ...@@ -17,3 +17,9 @@ export default function initUserProfile(action) {
$(this).parents('.project-limit-message').remove(); $(this).parents('.project-limit-message').remove();
}); });
} }
document.addEventListener('DOMContentLoaded', () => {
const page = $('body').attr('data-page');
const action = page.split(':')[1];
initUserProfile(action);
});
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
- page_description @user.bio - page_description @user.bio
- header_title @user.name, user_path(@user) - header_title @user.name, user_path(@user)
- @no_container = true - @no_container = true
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_d3'
= webpack_bundle_tag 'users'
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity") = auto_discovery_link_tag(:atom, user_url(@user, format: :atom), title: "#{@user.name} activity")
......
---
title: Removed d3.js from the graph and users bundles and used the common_d3 bundle
instead
merge_request: 14826
author:
type: other
...@@ -84,6 +84,7 @@ var config = { ...@@ -84,6 +84,7 @@ var config = {
vue_merge_request_widget: './vue_merge_request_widget/index.js', vue_merge_request_widget: './vue_merge_request_widget/index.js',
test: './test.js', test: './test.js',
two_factor_auth: './two_factor_auth.js', two_factor_auth: './two_factor_auth.js',
users: './users/index.js',
performance_bar: './performance_bar.js', performance_bar: './performance_bar.js',
webpack_runtime: './webpack.js', webpack_runtime: './webpack.js',
}, },
...@@ -215,7 +216,9 @@ var config = { ...@@ -215,7 +216,9 @@ var config = {
name: 'common_d3', name: 'common_d3',
chunks: [ chunks: [
'graphs', 'graphs',
'graphs_show',
'monitoring', 'monitoring',
'users',
], ],
}), }),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment