FIX: Further improvements for plugin list (#24622)

Followup e37fb3042d6f56a27a01614e57bc7029f472b0c9

* Automatically remove the prefix `Discourse ` from all the plugin titles to avoid repetition
* Remove the :discourse_dev: icon from the author. Consider a "By Discourse" with no labels as official
* We add a `label` metadata to plugin.rb
  * Only plugins made by us in `discourse` and `discourse-org` GitHub organizations will show these in the list
* Make the plugin author font size a little smaller
* Make the commit sha look like a link so it's more obvious it goes to the code

Also I added some validation and truncation for plugin metadata
parsing since currently you can put absolutely anything in there
and it will show on the plugin list.
This commit is contained in:
Martin Brennan
2023-11-30 10:53:17 +10:00
committed by GitHub
parent bcb7e86c24
commit c58cd697d2
7 changed files with 98 additions and 32 deletions

View File

@ -11,8 +11,8 @@ class AdminPluginSerializer < ApplicationSerializer
:enabled_setting,
:has_settings,
:is_official,
:is_experimental,
:is_discourse_owned,
:label,
:commit_hash,
:commit_url,
:meta_url,
@ -79,8 +79,13 @@ class AdminPluginSerializer < ApplicationSerializer
Plugin::Metadata::OFFICIAL_PLUGINS.include?(object.name)
end
def is_experimental
object.metadata.experimental
def include_label?
is_discourse_owned
end
def label
return if !is_discourse_owned
object.metadata.label
end
def is_discourse_owned