4b9b2a43d0
Adding new `AddAwardEmoji`, `RemoveAwardEmoji` and `ToggleAwardEmoji` GraphQL mutations. Adding new `#authorized_find_with_pre_checks!` and (unused, but for completeness `#authorized_find_with_post_checks!`) authorization methods. These allow us to perform an authorized find, and run our own additional checks before or after the authorization runs. https://gitlab.com/gitlab-org/gitlab-ce/issues/62826
27 lines
440 B
Ruby
27 lines
440 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AwardEmojiPresenter < Gitlab::View::Presenter::Delegated
|
|
presents :award_emoji
|
|
|
|
def description
|
|
as_emoji['description']
|
|
end
|
|
|
|
def unicode
|
|
as_emoji['unicode']
|
|
end
|
|
|
|
def emoji
|
|
as_emoji['moji']
|
|
end
|
|
|
|
def unicode_version
|
|
Gitlab::Emoji.emoji_unicode_version(award_emoji.name)
|
|
end
|
|
|
|
private
|
|
|
|
def as_emoji
|
|
@emoji ||= Gitlab::Emoji.emojis[award_emoji.name] || {}
|
|
end
|
|
end
|