Commit ddd0dae2 authored by Brett Walker's avatar Brett Walker

Add EE specific IssueBoardEntity

parent a861167f
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
class IssueBoardEntity < Grape::Entity class IssueBoardEntity < Grape::Entity
include RequestAwareEntity include RequestAwareEntity
prepend ::EE::IssueBoardEntity
expose :id expose :id
expose :iid expose :iid
...@@ -11,7 +12,6 @@ class IssueBoardEntity < Grape::Entity ...@@ -11,7 +12,6 @@ class IssueBoardEntity < Grape::Entity
expose :due_date expose :due_date
expose :project_id expose :project_id
expose :relative_position expose :relative_position
expose :weight, if: -> (*) { respond_to?(:weight) }
expose :project do |issue| expose :project do |issue|
API::Entities::Project.represent issue.project, only: [:id, :path] API::Entities::Project.represent issue.project, only: [:id, :path]
......
# frozen_string_literal: true
module EE
module IssueBoardEntity
extend ActiveSupport::Concern
prepended do
expose :weight, if: ->(issue, _) { issue.supports_weight? }
end
end
end
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"project_id": { "type": "integer" }, "project_id": { "type": "integer" },
"relative_position": { "type": ["integer", "null"] }, "relative_position": { "type": ["integer", "null"] },
"time_estimate": { "type": "integer" }, "time_estimate": { "type": "integer" },
"weight": { "type": "integer" }, "weight": { "type": ["integer", "null"] },
"project": { "project": {
"type": "object", "type": "object",
"properties": { "properties": {
......
...@@ -2,14 +2,16 @@ ...@@ -2,14 +2,16 @@
"type": "object", "type": "object",
"required" : [ "required" : [
"issues", "issues",
"size" "size",
"total_weight"
], ],
"properties" : { "properties" : {
"issues": { "issues": {
"type": "array", "type": "array",
"items": { "$ref": "issue_board.json" } "items": { "$ref": "issue_board.json" }
}, },
"size": { "type": "integer" } "size": { "type": "integer" },
"total_weight": { "type": "integer" }
}, },
"additionalProperties": false "additionalProperties": false
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment