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
Léo-Paul Géneau
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
Hide 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
...
@@ -8,12 +8,12 @@ class AutocompleteController < ApplicationController
def
users
def
users
@users
=
AutocompleteUsersFinder
.
new
(
params:
params
,
current_user:
current_user
,
project:
@project
,
group:
@group
).
execute
@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
end
def
user
def
user
@user
=
User
.
find
(
params
[
:id
])
@user
=
User
.
find
(
params
[
:id
])
render
json:
@user
,
only:
[
:name
,
:username
,
:id
],
methods:
[
:avatar_url
]
render
json:
UserSerializer
.
new
.
represent
(
@user
)
end
end
def
projects
def
projects
...
...
app/helpers/form_helper.rb
View file @
2f92238a
...
@@ -35,7 +35,7 @@ module FormHelper
...
@@ -35,7 +35,7 @@ module FormHelper
multi_select:
true
,
multi_select:
true
,
'input-meta'
:
'name'
,
'input-meta'
:
'name'
,
'always-show-selectbox'
:
true
,
'always-show-selectbox'
:
true
,
current_user_info:
current_user
.
to_json
(
only:
[
:id
,
:name
]
)
current_user_info:
UserSerializer
.
new
.
represent
(
current_user
)
}
}
}
}
end
end
...
...
app/helpers/issuables_helper.rb
View file @
2f92238a
...
@@ -362,7 +362,7 @@ module IssuablesHelper
...
@@ -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
),
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
),
projectsAutocompleteEndpoint:
autocomplete_projects_path
(
project_id:
@project
.
id
),
editable:
can_edit_issuable
,
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
,
rootPath:
root_path
,
fullPath:
@project
.
full_path
fullPath:
@project
.
full_path
}
}
...
...
app/helpers/search_helper.rb
View file @
2f92238a
...
@@ -139,7 +139,7 @@ module SearchHelper
...
@@ -139,7 +139,7 @@ module SearchHelper
id:
"filtered-search-
#{
type
}
"
,
id:
"filtered-search-
#{
type
}
"
,
placeholder:
'Search or filter results...'
,
placeholder:
'Search or filter results...'
,
data:
{
data:
{
'username-params'
=>
@users
.
to_json
(
only:
[
:id
,
:username
]
)
'username-params'
=>
UserSerializer
.
new
.
represent
(
@users
)
},
},
autocomplete:
'off'
autocomplete:
'off'
}
}
...
...
app/views/shared/boards/components/_sidebar.html.haml
View file @
2f92238a
%board-sidebar
{
"inline-template"
=>
true
,
%board-sidebar
{
"inline-template"
=>
true
,
":current-user"
=>
(
UserSerializer
.
new
.
represent
(
current_user
)
||
{}).
to_json
}
":current-user"
=>
"#{current_user ? current_user.to_json(only: [:username, :id, :name], methods: [:avatar_url]) : {}}"
}
%transition
{
name:
"boards-sidebar-slide"
}
%transition
{
name:
"boards-sidebar-slide"
}
%aside
.right-sidebar.right-sidebar-expanded.issue-boards-sidebar
{
"v-show"
=>
"showSidebar"
}
%aside
.right-sidebar.right-sidebar-expanded.issue-boards-sidebar
{
"v-show"
=>
"showSidebar"
}
.issuable-sidebar
.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