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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f788d43a
Commit
f788d43a
authored
Jan 14, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
876dc390
82852058
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
changelogs/unreleased/sh-fix-gon-helper-avatar.yml
changelogs/unreleased/sh-fix-gon-helper-avatar.yml
+5
-0
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+11
-4
spec/lib/gitlab/gon_helper_spec.rb
spec/lib/gitlab/gon_helper_spec.rb
+9
-0
No files found.
changelogs/unreleased/sh-fix-gon-helper-avatar.yml
0 → 100644
View file @
f788d43a
---
title
:
Fix no avatar not showing in user selection box
merge_request
:
24346
author
:
type
:
fixed
lib/gitlab/gon_helper.rb
View file @
f788d43a
...
...
@@ -8,10 +8,7 @@ module Gitlab
def
add_gon_variables
gon
.
api_version
=
'v4'
gon
.
default_avatar_url
=
Gitlab
::
Utils
.
append_path
(
Gitlab
.
config
.
gitlab
.
url
,
ActionController
::
Base
.
helpers
.
image_path
(
'no_avatar.png'
))
gon
.
default_avatar_url
=
default_avatar_url
gon
.
max_file_size
=
Gitlab
::
CurrentSettings
.
max_attachment_size
gon
.
asset_host
=
ActionController
::
Base
.
asset_host
gon
.
webpack_public_path
=
webpack_public_path
...
...
@@ -50,5 +47,15 @@ module Gitlab
# use this method to push multiple feature flags.
gon
.
push
({
features:
{
var_name
=>
enabled
}
},
true
)
end
def
default_avatar_url
# We can't use ActionController::Base.helpers.image_url because it
# doesn't return an actual URL because request is nil for some reason.
#
# We also can't use Gitlab::Utils.append_path because the image path
# may be an absolute URL.
URI
.
join
(
Gitlab
.
config
.
gitlab
.
url
,
ActionController
::
Base
.
helpers
.
image_path
(
'no_avatar.png'
)).
to_s
end
end
end
spec/lib/gitlab/gon_helper_spec.rb
View file @
f788d43a
...
...
@@ -29,4 +29,13 @@ describe Gitlab::GonHelper do
helper
.
push_frontend_feature_flag
(
:my_feature_flag
,
10
)
end
end
describe
'#default_avatar_url'
do
it
'returns an absolute URL'
do
url
=
helper
.
default_avatar_url
expect
(
url
).
to
match
(
/^http/
)
expect
(
url
).
to
match
(
/no_avatar.*png$/
)
end
end
end
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