mirror of
https://github.com/discourse/discourse.git
synced 2025-06-22 23:11:55 +08:00

Follow-up to https://github.com/discourse/discourse/pull/31887 This commit introduces a new design for the components listing page, which is not linked from anywhere in the UI at the moment, but it can be accessed by heading to the `/admin/config/customize/components` path directly. We'll make this new design available from the sidebar and remove the old page once we've tested and validated the new design internally. Internal topic: t/146007. --------- Co-authored-by: Ella <ella.estigoy@gmail.com>
24 lines
634 B
Ruby
24 lines
634 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ComponentIndexSerializer < BasicThemeSerializer
|
|
attributes :remote_theme_id, :supported?, :enabled?, :disabled_at
|
|
|
|
has_one :user, serializer: UserNameSerializer, embed: :object
|
|
has_one :disabled_by, serializer: UserNameSerializer, embed: :object
|
|
|
|
has_many :parent_themes, serializer: BasicThemeSerializer, embed: :objects
|
|
has_one :remote_theme, serializer: RemoteThemeSerializer, embed: :objects
|
|
|
|
def parent_themes
|
|
object.parent_themes
|
|
end
|
|
|
|
def include_disabled_at?
|
|
object.component? && !object.enabled?
|
|
end
|
|
|
|
def include_disabled_by?
|
|
include_disabled_at?
|
|
end
|
|
end
|