Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
f2c0ab39
Commit
f2c0ab39
authored
Jul 18, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor users bundle, remove inline javascript, and transform into an async chunk
parent
339baf8f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
50 deletions
+25
-50
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+7
-0
app/assets/javascripts/users/index.js
app/assets/javascripts/users/index.js
+18
-4
app/assets/javascripts/users/user.js
app/assets/javascripts/users/user.js
+0
-34
app/views/users/show.html.haml
app/views/users/show.html.haml
+0
-10
config/webpack.config.js
config/webpack.config.js
+0
-2
No files found.
app/assets/javascripts/dispatcher.js
View file @
f2c0ab39
...
...
@@ -516,6 +516,13 @@ import PerformanceBar from './performance_bar';
case
'
protected_branches
'
:
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
)
{
...
...
app/assets/javascripts/users/index.js
View file @
f2c0ab39
import
User
from
'
./user
'
;
import
Cookies
from
'
js-cookie
'
;
import
UserTabs
from
'
./user_tabs
'
;
// use legacy exports until embedded javascript is refactored
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
User
=
User
;
export
default
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
();
});
}
app/assets/javascripts/users/user.js
deleted
100644 → 0
View file @
339baf8f
/* eslint-disable class-methods-use-this */
import
Cookies
from
'
js-cookie
'
;
import
UserTabs
from
'
./user_tabs
'
;
export
default
class
User
{
constructor
({
action
})
{
this
.
action
=
action
;
this
.
placeProfileAvatarsToTop
();
this
.
initTabs
();
this
.
hideProjectLimitMessage
();
}
placeProfileAvatarsToTop
()
{
$
(
'
.profile-groups-avatars
'
).
tooltip
({
placement
:
'
top
'
,
});
}
initTabs
()
{
return
new
UserTabs
({
parentEl
:
'
.user-profile
'
,
action
:
this
.
action
,
});
}
hideProjectLimitMessage
()
{
$
(
'
.hide-project-limit-message
'
).
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
Cookies
.
set
(
'
hide_project_limit_message
'
,
'
false
'
);
$
(
this
).
parents
(
'
.project-limit-message
'
).
remove
();
});
}
}
app/views/users/show.html.haml
View file @
f2c0ab39
-
page_title
@user
.
name
-
page_description
@user
.
bio
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_bundle_tag
(
'common_d3'
)
=
page_specific_javascript_bundle_tag
(
'users'
)
-
header_title
@user
.
name
,
user_path
(
@user
)
-
@no_container
=
true
...
...
@@ -129,10 +126,3 @@
.loading-status
=
spinner
:javascript
var
userProfile
;
userProfile
=
new
gl
.
User
({
action
:
"
#{
controller
.
action_name
}
"
});
config/webpack.config.js
View file @
f2c0ab39
...
...
@@ -66,7 +66,6 @@ var config = {
stl_viewer
:
'
./blob/stl_viewer.js
'
,
terminal
:
'
./terminal/terminal_bundle.js
'
,
u2f
:
[
'
vendor/u2f
'
],
users
:
'
./users/index.js
'
,
raven
:
'
./raven/index.js
'
,
vue_merge_request_widget
:
'
./vue_merge_request_widget/index.js
'
,
test
:
'
./test.js
'
,
...
...
@@ -184,7 +183,6 @@ var config = {
name
:
'
common_d3
'
,
chunks
:
[
'
graphs
'
,
'
users
'
,
'
monitoring
'
,
],
}),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment