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
4ccd7998
Commit
4ccd7998
authored
Jun 09, 2017
by
vanadium23
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept image for avatar in project API
parent
34dcfae9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
0 deletions
+17
-0
changelogs/unreleased/33003-avatar-in-project-api.yml
changelogs/unreleased/33003-avatar-in-project-api.yml
+4
-0
doc/api/projects.md
doc/api/projects.md
+3
-0
lib/api/projects.rb
lib/api/projects.rb
+1
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+9
-0
No files found.
changelogs/unreleased/33003-avatar-in-project-api.yml
0 → 100644
View file @
4ccd7998
---
title
:
Accept image for avatar in project API
merge_request
:
11988
author
:
Ivan Chernov
doc/api/projects.md
View file @
4ccd7998
...
...
@@ -343,6 +343,7 @@ Parameters:
|
`lfs_enabled`
| boolean | no | Enable LFS |
|
`request_access_enabled`
| boolean | no | Allow users to request member access |
|
`tag_list`
| array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
|
`avatar`
| mixed | no | Image file for avatar of the project |
### Create project for user
...
...
@@ -377,6 +378,7 @@ Parameters:
|
`lfs_enabled`
| boolean | no | Enable LFS |
|
`request_access_enabled`
| boolean | no | Allow users to request member access |
|
`tag_list`
| array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
|
`avatar`
| mixed | no | Image file for avatar of the project |
### Edit project
...
...
@@ -410,6 +412,7 @@ Parameters:
|
`lfs_enabled`
| boolean | no | Enable LFS |
|
`request_access_enabled`
| boolean | no | Allow users to request member access |
|
`tag_list`
| array | no | The list of tags for a project; put array of tags, that should be finally assigned to a project |
|
`avatar`
| mixed | no | Image file for avatar of the project |
### Fork project
...
...
lib/api/projects.rb
View file @
4ccd7998
...
...
@@ -22,6 +22,7 @@ module API
optional
:only_allow_merge_if_pipeline_succeeds
,
type:
Boolean
,
desc:
'Only allow to merge if builds succeed'
optional
:only_allow_merge_if_all_discussions_are_resolved
,
type:
Boolean
,
desc:
'Only allow to merge if all discussions are resolved'
optional
:tag_list
,
type:
Array
[
String
],
desc:
'The list of tags for a project'
optional
:avatar
,
type:
File
,
desc:
'Avatar image for project'
end
params
:optional_params
do
...
...
spec/requests/api/projects_spec.rb
View file @
4ccd7998
...
...
@@ -398,6 +398,15 @@ describe API::Projects do
expect
(
json_response
[
'tag_list'
]).
to
eq
(
%w[tagFirst tagSecond]
)
end
it
'uploads avatar for project a project'
do
project
=
attributes_for
(
:project
,
avatar:
fixture_file_upload
(
Rails
.
root
+
'spec/fixtures/banana_sample.gif'
,
'image/gif'
))
post
api
(
'/projects'
,
user
),
project
project_id
=
json_response
[
'id'
]
expect
(
json_response
[
'avatar_url'
]).
to
eq
(
"http://localhost/uploads/system/project/avatar/
#{
project_id
}
/banana_sample.gif"
)
end
it
'sets a project as allowing merge even if build fails'
do
project
=
attributes_for
(
:project
,
{
only_allow_merge_if_pipeline_succeeds:
false
})
post
api
(
'/projects'
,
user
),
project
...
...
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