diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 18:09:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-17 18:09:44 +0000 |
commit | 2c156e3c7bbade01c36eee18327f1ced6eebea79 (patch) | |
tree | 115fa8dbf6bc05037378b380311d31acb805f54c /lib/api/entities | |
parent | 8e129497b2565b8c595ef4f806d9a9595ca654e5 (diff) | |
download | gitlab-ce-2c156e3c7bbade01c36eee18327f1ced6eebea79.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/entities')
-rw-r--r-- | lib/api/entities/discussion.rb | 2 | ||||
-rw-r--r-- | lib/api/entities/note_with_gitlab_employee_badge.rb | 10 | ||||
-rw-r--r-- | lib/api/entities/user_with_gitlab_employee_badge.rb | 9 |
3 files changed, 20 insertions, 1 deletions
diff --git a/lib/api/entities/discussion.rb b/lib/api/entities/discussion.rb index dd1dd40da23..0740de97897 100644 --- a/lib/api/entities/discussion.rb +++ b/lib/api/entities/discussion.rb @@ -5,7 +5,7 @@ module API class Discussion < Grape::Entity expose :id expose :individual_note?, as: :individual_note - expose :notes, using: Entities::Note + expose :notes, using: Entities::NoteWithGitlabEmployeeBadge end end end diff --git a/lib/api/entities/note_with_gitlab_employee_badge.rb b/lib/api/entities/note_with_gitlab_employee_badge.rb new file mode 100644 index 00000000000..2ea300ffeb6 --- /dev/null +++ b/lib/api/entities/note_with_gitlab_employee_badge.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module API + module Entities + class NoteWithGitlabEmployeeBadge < Note + expose :author, using: Entities::UserWithGitlabEmployeeBadge + expose :resolved_by, using: Entities::UserWithGitlabEmployeeBadge, if: ->(note, options) { note.resolvable? } + end + end +end diff --git a/lib/api/entities/user_with_gitlab_employee_badge.rb b/lib/api/entities/user_with_gitlab_employee_badge.rb new file mode 100644 index 00000000000..36b9f633132 --- /dev/null +++ b/lib/api/entities/user_with_gitlab_employee_badge.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module API + module Entities + class UserWithGitlabEmployeeBadge < UserBasic + expose :gitlab_employee?, as: :is_gitlab_employee, if: ->(user, options) { ::Feature.enabled?(:gitlab_employee_badge) && user.gitlab_employee? } + end + end +end |