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
2f92238a
Commit
2f92238a
authored
Sep 19, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use UserSerializer instead of `User.to_json`
parent
6f1df8df
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
7 deletions
+6
-7
app/controllers/autocomplete_controller.rb
app/controllers/autocomplete_controller.rb
+2
-2
app/helpers/form_helper.rb
app/helpers/form_helper.rb
+1
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-1
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+1
-1
app/views/shared/boards/components/_sidebar.html.haml
app/views/shared/boards/components/_sidebar.html.haml
+1
-2
No files found.
app/controllers/autocomplete_controller.rb
View file @
2f92238a
...
...
@@ -8,12 +8,12 @@ class AutocompleteController < ApplicationController
def
users
@users
=
AutocompleteUsersFinder
.
new
(
params:
params
,
current_user:
current_user
,
project:
@project
,
group:
@group
).
execute
render
json:
@users
,
only:
[
:name
,
:username
,
:id
],
methods:
[
:avatar_url
]
render
json:
UserSerializer
.
new
.
represent
(
@users
)
end
def
user
@user
=
User
.
find
(
params
[
:id
])
render
json:
@user
,
only:
[
:name
,
:username
,
:id
],
methods:
[
:avatar_url
]
render
json:
UserSerializer
.
new
.
represent
(
@user
)
end
def
projects
...
...
app/helpers/form_helper.rb
View file @
2f92238a
...
...
@@ -35,7 +35,7 @@ module FormHelper
multi_select:
true
,
'input-meta'
:
'name'
,
'always-show-selectbox'
:
true
,
current_user_info:
current_user
.
to_json
(
only:
[
:id
,
:name
]
)
current_user_info:
UserSerializer
.
new
.
represent
(
current_user
)
}
}
end
...
...
app/helpers/issuables_helper.rb
View file @
2f92238a
...
...
@@ -362,7 +362,7 @@ module IssuablesHelper
moveIssueEndpoint:
move_namespace_project_issue_path
(
namespace_id:
issuable
.
project
.
namespace
.
to_param
,
project_id:
issuable
.
project
,
id:
issuable
),
projectsAutocompleteEndpoint:
autocomplete_projects_path
(
project_id:
@project
.
id
),
editable:
can_edit_issuable
,
currentUser:
current_user
.
as_json
(
only:
[
:username
,
:id
,
:name
],
methods: :avatar_url
),
currentUser:
UserSerializer
.
new
.
represent
(
current_user
),
rootPath:
root_path
,
fullPath:
@project
.
full_path
}
...
...
app/helpers/search_helper.rb
View file @
2f92238a
...
...
@@ -139,7 +139,7 @@ module SearchHelper
id:
"filtered-search-
#{
type
}
"
,
placeholder:
'Search or filter results...'
,
data:
{
'username-params'
=>
@users
.
to_json
(
only:
[
:id
,
:username
]
)
'username-params'
=>
UserSerializer
.
new
.
represent
(
@users
)
},
autocomplete:
'off'
}
...
...
app/views/shared/boards/components/_sidebar.html.haml
View file @
2f92238a
%board-sidebar
{
"inline-template"
=>
true
,
":current-user"
=>
"#{current_user ? current_user.to_json(only: [:username, :id, :name], methods: [:avatar_url]) : {}}"
}
%board-sidebar
{
"inline-template"
=>
true
,
":current-user"
=>
(
UserSerializer
.
new
.
represent
(
current_user
)
||
{}).
to_json
}
%transition
{
name:
"boards-sidebar-slide"
}
%aside
.right-sidebar.right-sidebar-expanded.issue-boards-sidebar
{
"v-show"
=>
"showSidebar"
}
.issuable-sidebar
...
...
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