diff options
author | Felipe Artur <felipefac@gmail.com> | 2018-04-05 00:43:33 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2018-04-05 20:58:49 +0300 |
commit | 22423d284704c3ec2f7715736a75155d14ff413d (patch) | |
tree | af4f3c9ec4e2e486af3c7d292d54d07ccc2ff741 /app/models | |
parent | 6b3585d8ea15a7ee1a5cd2f5799caace48ab0c32 (diff) |
Show issues of subgroups in group-level issue board
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/issue.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 13abc6c1a0d..13d9e42bcc8 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -272,11 +272,17 @@ class Issue < ActiveRecord::Base def as_json(options = {}) super(options).tap do |json| - if options.key?(:sidebar_endpoints) && project + if options.key?(:issue_endpoints) && project url_helper = Gitlab::Routing.url_helpers - json.merge!(issue_sidebar_endpoint: url_helper.project_issue_path(project, self, format: :json, serializer: 'sidebar'), - toggle_subscription_endpoint: url_helper.toggle_subscription_project_issue_path(project, self)) + issue_reference = options[:include_full_project_path] ? to_reference(full: true) : to_reference + + json.merge!( + reference_path: issue_reference, + real_path: url_helper.project_issue_path(project, self), + issue_sidebar_endpoint: url_helper.project_issue_path(project, self, format: :json, serializer: 'sidebar'), + toggle_subscription_endpoint: url_helper.toggle_subscription_project_issue_path(project, self) + ) end if options.key?(:labels) |