diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-23 21:08:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-23 21:08:14 +0300 |
commit | 5e555ebcf6ee2ce13e9956ae599fd811a79b4dbd (patch) | |
tree | 6dd67e2f8f49b54e0fb1f266d1720f461393df59 /app/serializers | |
parent | 3e53902ee13fc4e0bf3162c0c392dcfe1a0ede4b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/issue_board_entity.rb | 9 | ||||
-rw-r--r-- | app/serializers/issue_entity.rb | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/app/serializers/issue_board_entity.rb b/app/serializers/issue_board_entity.rb index bcad28d6aad..ebd0f037160 100644 --- a/app/serializers/issue_board_entity.rb +++ b/app/serializers/issue_board_entity.rb @@ -3,6 +3,10 @@ class IssueBoardEntity < Grape::Entity include RequestAwareEntity + format_with(:upcase) do |item| + item.try(:upcase) + end + expose :id expose :iid expose :title @@ -51,6 +55,11 @@ class IssueBoardEntity < Grape::Entity expose :assignable_labels_endpoint, if: -> (issue) { issue.project } do |issue| project_labels_path(issue.project, format: :json, include_ancestor_groups: true) end + + expose :issue_type, + as: :type, + format_with: :upcase, + documentation: { type: "String", desc: "One of #{::WorkItems::Type.base_types.keys.map(&:upcase)}" } end IssueBoardEntity.prepend_mod_with('IssueBoardEntity') diff --git a/app/serializers/issue_entity.rb b/app/serializers/issue_entity.rb index 852a2e62b7d..eba2c49bc2e 100644 --- a/app/serializers/issue_entity.rb +++ b/app/serializers/issue_entity.rb @@ -3,6 +3,10 @@ class IssueEntity < IssuableEntity include TimeTrackableEntity + format_with(:upcase) do |item| + item.try(:upcase) + end + expose :state expose :milestone_id expose :updated_by_id @@ -75,6 +79,11 @@ class IssueEntity < IssuableEntity expose :issue_email_participants do |issue| issue.issue_email_participants.map { |x| { email: x.email } } end + + expose :issue_type, + as: :type, + format_with: :upcase, + documentation: { type: "String", desc: "One of #{::WorkItems::Type.base_types.keys.map(&:upcase)}" } end IssueEntity.prepend_mod_with('IssueEntity') |