BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7d20a91b
Commit
7d20a91b
authored
Oct 07, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore subscribe status in JSON
parent
1aff95c7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
issues_controller.rb
app/controllers/projects/boards/issues_controller.rb
+5
-2
issue.rb
app/models/issue.rb
+6
-0
issues_controller_spec.rb
spec/controllers/projects/boards/issues_controller_spec.rb
+2
-0
issue.json
spec/fixtures/api/schemas/issue.json
+2
-1
No files found.
app/controllers/projects/boards/issues_controller.rb
View file @
7d20a91b
...
...
@@ -76,8 +76,11 @@ module Projects
only:
[
:iid
,
:title
,
:confidential
,
:due_date
],
include:
{
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
labels:
{
only:
[
:id
,
:title
,
:description
,
:color
,
:priority
],
methods:
[
:text_color
]
}
})
labels:
{
only:
[
:id
,
:title
,
:description
,
:color
,
:priority
],
methods:
[
:text_color
]
},
milestone:
{
only:
[
:id
,
:title
]
}
},
user:
current_user
)
end
end
end
...
...
app/models/issue.rb
View file @
7d20a91b
...
...
@@ -274,4 +274,10 @@ class Issue < ActiveRecord::Base
def
check_for_spam?
project
.
public?
end
def
as_json
(
options
=
{})
super
(
options
).
tap
do
|
json
|
json
[
:subscribed
]
=
subscribed?
(
options
[
:user
])
if
options
.
has_key?
(
:user
)
end
end
end
spec/controllers/projects/boards/issues_controller_spec.rb
View file @
7d20a91b
...
...
@@ -20,9 +20,11 @@ describe Projects::Boards::IssuesController do
context
'with valid list id'
do
it
'returns issues that have the list label applied'
do
johndoe
=
create
(
:user
,
avatar:
fixture_file_upload
(
File
.
join
(
Rails
.
root
,
'spec/fixtures/dk.png'
)))
issue
=
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
])
create
(
:labeled_issue
,
project:
project
,
labels:
[
planning
])
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
],
due_date:
Date
.
tomorrow
)
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
],
assignee:
johndoe
)
issue
.
subscribe
(
johndoe
)
list_issues
user:
user
,
list_id:
list2
...
...
spec/fixtures/api/schemas/issue.json
View file @
7d20a91b
...
...
@@ -43,7 +43,8 @@
"name"
:
{
"type"
:
"string"
},
"username"
:
{
"type"
:
"string"
},
"avatar_url"
:
{
"type"
:
"uri"
}
}
},
"subscribed"
:
{
"type"
:
[
"boolean"
,
"null"
]
}
},
"additionalProperties"
:
false
}
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