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
a0193694
Commit
a0193694
authored
Sep 26, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose avatar_url when requesting list of projects from API with simple=true
parent
923ad9a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
5 deletions
+14
-5
changelogs/unreleased/dm-simple-project-avatar-url.yml
changelogs/unreleased/dm-simple-project-avatar-url.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+6
-5
spec/requests/api/environments_spec.rb
spec/requests/api/environments_spec.rb
+1
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-0
spec/requests/api/v3/projects_spec.rb
spec/requests/api/v3/projects_spec.rb
+1
-0
No files found.
changelogs/unreleased/dm-simple-project-avatar-url.yml
0 → 100644
View file @
a0193694
---
title
:
Expose avatar_url when requesting list of projects from API with simple=true
merge_request
:
author
:
type
:
added
lib/api/entities.rb
View file @
a0193694
...
@@ -89,6 +89,9 @@ module API
...
@@ -89,6 +89,9 @@ module API
expose
:ssh_url_to_repo
,
:http_url_to_repo
,
:web_url
expose
:ssh_url_to_repo
,
:http_url_to_repo
,
:web_url
expose
:name
,
:name_with_namespace
expose
:name
,
:name_with_namespace
expose
:path
,
:path_with_namespace
expose
:path
,
:path_with_namespace
expose
:avatar_url
do
|
project
,
options
|
project
.
avatar_url
(
only_path:
false
)
end
expose
:star_count
,
:forks_count
expose
:star_count
,
:forks_count
expose
:created_at
,
:last_activity_at
expose
:created_at
,
:last_activity_at
end
end
...
@@ -146,9 +149,7 @@ module API
...
@@ -146,9 +149,7 @@ module API
expose
:forked_from_project
,
using:
Entities
::
BasicProjectDetails
,
if:
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:forked_from_project
,
using:
Entities
::
BasicProjectDetails
,
if:
lambda
{
|
project
,
options
|
project
.
forked?
}
expose
:import_status
expose
:import_status
expose
:import_error
,
if:
lambda
{
|
_project
,
options
|
options
[
:user_can_admin_project
]
}
expose
:import_error
,
if:
lambda
{
|
_project
,
options
|
options
[
:user_can_admin_project
]
}
expose
:avatar_url
do
|
user
,
options
|
user
.
avatar_url
(
only_path:
false
)
end
expose
:open_issues_count
,
if:
lambda
{
|
project
,
options
|
project
.
feature_available?
(
:issues
,
options
[
:current_user
])
}
expose
:open_issues_count
,
if:
lambda
{
|
project
,
options
|
project
.
feature_available?
(
:issues
,
options
[
:current_user
])
}
expose
:runners_token
,
if:
lambda
{
|
_project
,
options
|
options
[
:user_can_admin_project
]
}
expose
:runners_token
,
if:
lambda
{
|
_project
,
options
|
options
[
:user_can_admin_project
]
}
expose
:public_builds
,
as: :public_jobs
expose
:public_builds
,
as: :public_jobs
...
@@ -193,8 +194,8 @@ module API
...
@@ -193,8 +194,8 @@ module API
class
Group
<
Grape
::
Entity
class
Group
<
Grape
::
Entity
expose
:id
,
:name
,
:path
,
:description
,
:visibility
expose
:id
,
:name
,
:path
,
:description
,
:visibility
expose
:lfs_enabled?
,
as: :lfs_enabled
expose
:lfs_enabled?
,
as: :lfs_enabled
expose
:avatar_url
do
|
user
,
options
|
expose
:avatar_url
do
|
group
,
options
|
user
.
avatar_url
(
only_path:
false
)
group
.
avatar_url
(
only_path:
false
)
end
end
expose
:web_url
expose
:web_url
expose
:request_access_enabled
expose
:request_access_enabled
...
...
spec/requests/api/environments_spec.rb
View file @
a0193694
...
@@ -20,6 +20,7 @@ describe API::Environments do
...
@@ -20,6 +20,7 @@ describe API::Environments do
path path_with_namespace
path path_with_namespace
star_count forks_count
star_count forks_count
created_at last_activity_at
created_at last_activity_at
avatar_url
)
)
get
api
(
"/projects/
#{
project
.
id
}
/environments"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/environments"
,
user
)
...
...
spec/requests/api/projects_spec.rb
View file @
a0193694
...
@@ -193,6 +193,7 @@ describe API::Projects do
...
@@ -193,6 +193,7 @@ describe API::Projects do
path path_with_namespace
path path_with_namespace
star_count forks_count
star_count forks_count
created_at last_activity_at
created_at last_activity_at
avatar_url
)
)
get
api
(
'/projects?simple=true'
,
user
)
get
api
(
'/projects?simple=true'
,
user
)
...
...
spec/requests/api/v3/projects_spec.rb
View file @
a0193694
...
@@ -89,6 +89,7 @@ describe API::V3::Projects do
...
@@ -89,6 +89,7 @@ describe API::V3::Projects do
path path_with_namespace
path path_with_namespace
star_count forks_count
star_count forks_count
created_at last_activity_at
created_at last_activity_at
avatar_url
)
)
get
v3_api
(
'/projects?simple=true'
,
user
)
get
v3_api
(
'/projects?simple=true'
,
user
)
...
...
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