UX: use "icon-picker" & "image-uploader" fields to set group flair. (#9779)

This commit is contained in:
Vinoth Kannan
2020-05-25 11:08:47 +05:30
committed by GitHub
parent 13d5ccedf5
commit 8e56197728
18 changed files with 270 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true
class GroupShowSerializer < BasicGroupSerializer
attributes :is_group_user, :is_group_owner, :is_group_owner_display, :mentionable, :messageable
attributes :is_group_user, :is_group_owner, :is_group_owner_display, :mentionable, :messageable, :flair_icon, :flair_type
def include_is_group_user?
authenticated?
@@ -43,6 +43,14 @@ class GroupShowSerializer < BasicGroupSerializer
Group.messageable(scope.user).exists?(id: object.id)
end
def include_flair_icon?
is_group_owner && flair_icon.present?
end
def include_flair_type?
is_group_owner && flair_type.present?
end
private
def authenticated?