mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add meta_topic_id plugin metadata (#23838)
For the admin plugin list we want to be able to link to a meta topic for plugins, but we have no standard way to do this at the moment. This adds support for meta_topic_id alongside other plugin metadata like authors, URL etc, that gets built into a Meta topic URL in the serializer.
This commit is contained in:
@@ -12,7 +12,8 @@ class AdminPluginSerializer < ApplicationSerializer
|
||||
:has_settings,
|
||||
:is_official,
|
||||
:commit_hash,
|
||||
:commit_url
|
||||
:commit_url,
|
||||
:meta_url
|
||||
|
||||
def id
|
||||
object.directory_name
|
||||
@@ -78,4 +79,9 @@ class AdminPluginSerializer < ApplicationSerializer
|
||||
def commit_url
|
||||
object.commit_url
|
||||
end
|
||||
|
||||
def meta_url
|
||||
return if object.metadata.meta_topic_id.blank?
|
||||
"https://meta.discourse.org/t/#{object.metadata.meta_topic_id}"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user