UX: show all preinstalled plugins and label them as such (#33681)

Instead of listing the redundant commit hash, this now shows
"preinstalled" for the relevant components and links to
https://meta.discourse.org/t/bundling-more-popular-plugins-with-discourse-core/373574.
This is accomplished by checking the URL of the plugin for
`"/discourse/discourse/tree/main/plugins/"` which indicates it's part of
the core Discourse repo.

I've also removed the `hide_plugin` flag from existing preinstalled
plugins. Now Discourse admins will have more clarity into what's
included.

I also made some minor layout adjustments: 
* Larger click area for "how to install a plugin" banner
* Moved "Learn more" into a separate line for consistent positioning

Before:
<img width="2182" height="1192" alt="image"
src="https://github.com/user-attachments/assets/b2943a7f-5212-4abd-8b80-d0d071378f06"
/>


After:
<img width="2226" height="1184" alt="image"
src="https://github.com/user-attachments/assets/0846a2c9-fc1b-435c-b51f-b966af5ade09"
/>
This commit is contained in:
Kris
2025-07-17 15:11:52 -04:00
committed by GitHub
parent 116b63145b
commit 2d111e2a9a
15 changed files with 43 additions and 21 deletions
@@ -58,6 +58,12 @@ export default class AdminPluginsListItem extends Component {
return "";
}
get isPreinstalled() {
return this.args.plugin.url?.includes(
"/discourse/discourse/tree/main/plugins/"
);
}
<template>
<tr
data-plugin-name={{@plugin.name}}
@@ -96,9 +102,10 @@ export default class AdminPluginsListItem extends Component {
href={{@plugin.linkUrl}}
rel="noopener noreferrer"
target="_blank"
class="admin-plugins-list__about-link"
>
{{i18n "admin.plugins.learn_more"}}
{{icon "up-right-from-square"}}
{{i18n "admin.plugins.learn_more"}}
</a>
{{/if}}
</div>
@@ -113,7 +120,18 @@ export default class AdminPluginsListItem extends Component {
@outletArgs={{lazyHash plugin=@plugin}}
>
{{@plugin.version}}<br />
<PluginCommitHash @plugin={{@plugin}} />
{{#if this.isPreinstalled}}
<a
href="https://meta.discourse.org/t/bundling-more-popular-plugins-with-discourse-core/373574"
rel="noopener noreferrer"
target="_blank"
class="admin-plugins-list__preinstalled-link"
>
{{i18n "admin.plugins.preinstalled"}}
</a>
{{else}}
<PluginCommitHash @plugin={{@plugin}} />
{{/if}}
</PluginOutlet>
</div>
</td>
@@ -47,9 +47,9 @@ export default RouteTemplate(
</:tabs>
</DPageHeader>
<div class="alert alert-info -top-margin admin-plugins-howto">
{{icon "circle-info"}}
<div class="alert alert-info admin-plugins-howto">
<a href="https://meta.discourse.org/t/install-a-plugin/19157">
{{icon "circle-info"}}
{{i18n "admin.plugins.howto"}}
</a>
</div>
@@ -149,16 +149,18 @@
&-name {
font-weight: 700;
max-width: 80%;
margin-bottom: var(--space-1);
margin-bottom: 0;
}
&-author {
font-size: var(--font-down-1);
margin-bottom: var(--space-1);
color: var(--primary-high);
}
&-about {
padding-right: var(--space-4);
max-width: 75ch;
@include viewport.until(md) {
padding-top: var(--space-1);
+14
View File
@@ -58,6 +58,11 @@
margin-right: var(--space-1);
}
}
&__about-link {
white-space: nowrap;
display: block;
}
}
}
@@ -139,3 +144,12 @@
width: 100%;
}
}
.admin-plugins-howto {
margin: var(--space-2) 0 0;
a {
display: inline-block;
width: 100%;
}
}
@@ -46,10 +46,6 @@
}
}
}
&.-top-margin {
margin-top: 1em;
}
}
a.alert.clickable {
+1
View File
@@ -6592,6 +6592,7 @@ en:
author: "By %{author}"
experimental_badge: "experimental"
learn_more: "Learn more"
preinstalled: "Preinstalled"
navigation_menu:
sidebar: "Sidebar"
-1
View File
@@ -11,4 +11,3 @@ enabled_site_setting :checklist_enabled
register_asset "stylesheets/checklist.scss"
register_svg_icon "spinner"
hide_plugin
-1
View File
@@ -7,7 +7,6 @@
# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-details
enabled_site_setting :details_enabled
hide_plugin
register_asset "stylesheets/details.scss"
-1
View File
@@ -6,7 +6,6 @@
# authors: Jan Cernik
# url: https://github.com/discourse/discourse-lazy-videos
hide_plugin
enabled_site_setting :lazy_videos_enabled
register_asset "stylesheets/lazy-videos.scss"
-2
View File
@@ -5,8 +5,6 @@
# version: 0.1
# author: Joffrey Jaffeux
hide_plugin
register_asset "stylesheets/common/discourse-local-dates.scss"
register_asset "moment.js", :vendored_core_pretty_text
register_asset "moment-timezone.js", :vendored_core_pretty_text
@@ -7,7 +7,6 @@
# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-narrative-bot
enabled_site_setting :discourse_narrative_bot_enabled
hide_plugin
require_relative "lib/discourse_narrative_bot/welcome_post_type_site_setting"
register_asset "stylesheets/discourse-narrative-bot.scss"
-1
View File
@@ -7,7 +7,6 @@
# url: https://github.com/discourse/discourse/tree/main/plugins/discourse-presence
enabled_site_setting :presence_enabled
hide_plugin
register_asset "stylesheets/presence.scss"
-1
View File
@@ -14,7 +14,6 @@ register_asset "stylesheets/common/poll-breakdown.scss"
register_svg_icon "far-square-check"
enabled_site_setting :poll_enabled
hide_plugin
after_initialize do
module ::DiscoursePoll
-1
View File
@@ -8,7 +8,6 @@
register_asset "stylesheets/styleguide.scss"
enabled_site_setting :styleguide_enabled
hide_plugin
require_relative "lib/styleguide/engine"
@@ -7,16 +7,16 @@ RSpec.describe "Styleguide assets" do
end
context "when visiting homepage" do
it "doesnt load styleguide assets" do
it "doesn't load styleguide assets" do
get "/"
expect(response.body).to_not include("styleguide")
expect(response.body).to_not include('data-target="styleguide"')
end
end
context "when visiting styleguide" do
it "loads styleguide assets" do
get "/styleguide"
expect(response.body).to include("styleguide")
expect(response.body).to include('data-target="styleguide"')
end
end
end