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
Boxiang Sun
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
app/controllers/projects/boards/issues_controller.rb
app/controllers/projects/boards/issues_controller.rb
+5
-2
app/models/issue.rb
app/models/issue.rb
+6
-0
spec/controllers/projects/boards/issues_controller_spec.rb
spec/controllers/projects/boards/issues_controller_spec.rb
+2
-0
spec/fixtures/api/schemas/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
...
@@ -76,8 +76,11 @@ module Projects
only:
[
:iid
,
:title
,
:confidential
,
:due_date
],
only:
[
:iid
,
:title
,
:confidential
,
:due_date
],
include:
{
include:
{
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
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
end
end
end
...
...
app/models/issue.rb
View file @
7d20a91b
...
@@ -274,4 +274,10 @@ class Issue < ActiveRecord::Base
...
@@ -274,4 +274,10 @@ class Issue < ActiveRecord::Base
def
check_for_spam?
def
check_for_spam?
project
.
public?
project
.
public?
end
end
def
as_json
(
options
=
{})
super
(
options
).
tap
do
|
json
|
json
[
:subscribed
]
=
subscribed?
(
options
[
:user
])
if
options
.
has_key?
(
:user
)
end
end
end
end
spec/controllers/projects/boards/issues_controller_spec.rb
View file @
7d20a91b
...
@@ -20,9 +20,11 @@ describe Projects::Boards::IssuesController do
...
@@ -20,9 +20,11 @@ describe Projects::Boards::IssuesController do
context
'with valid list id'
do
context
'with valid list id'
do
it
'returns issues that have the list label applied'
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'
)))
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:
[
planning
])
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
],
due_date:
Date
.
tomorrow
)
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
],
due_date:
Date
.
tomorrow
)
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
],
assignee:
johndoe
)
create
(
:labeled_issue
,
project:
project
,
labels:
[
development
],
assignee:
johndoe
)
issue
.
subscribe
(
johndoe
)
list_issues
user:
user
,
list_id:
list2
list_issues
user:
user
,
list_id:
list2
...
...
spec/fixtures/api/schemas/issue.json
View file @
7d20a91b
...
@@ -43,7 +43,8 @@
...
@@ -43,7 +43,8 @@
"name"
:
{
"type"
:
"string"
},
"name"
:
{
"type"
:
"string"
},
"username"
:
{
"type"
:
"string"
},
"username"
:
{
"type"
:
"string"
},
"avatar_url"
:
{
"type"
:
"uri"
}
"avatar_url"
:
{
"type"
:
"uri"
}
}
},
"subscribed"
:
{
"type"
:
[
"boolean"
,
"null"
]
}
},
},
"additionalProperties"
:
false
"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