Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 5368b0c

Browse files
authored
UX: add links to sentiment to admin sidebar (#1158)
1 parent eccfbad commit 5368b0c

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

assets/javascripts/discourse/templates/admin-dashboard-sentiment.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="sentiment section">
22
<div class="period-section">
33
<div class="section-title">
4-
<h2>
4+
<h2 id="sentiment-heading">
55
{{i18n "discourse_ai.sentiments.dashboard.title"}}
66
</h2>
77

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { apiInitializer } from "discourse/lib/api";
2+
3+
export default apiInitializer("1.15.0", (api) => {
4+
const settings = api.container.lookup("service:site-settings");
5+
6+
if (settings.ai_sentiment_enabled) {
7+
api.addAdminSidebarSectionLink("reports", {
8+
name: "sentiment_overview",
9+
href: "/admin/dashboard/sentiment#sentiment-heading",
10+
label: "discourse_ai.sentiments.sidebar.overview",
11+
icon: "chart-column",
12+
});
13+
api.addAdminSidebarSectionLink("reports", {
14+
name: "sentiment_analysis",
15+
route: "adminReports.show",
16+
routeModels: ["sentiment_analysis"],
17+
label: "discourse_ai.sentiments.sidebar.analysis",
18+
icon: "chart-pie",
19+
});
20+
}
21+
});

config/locales/client.en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,9 @@ en:
652652
sentiments:
653653
dashboard:
654654
title: "Sentiment"
655+
sidebar:
656+
overview: "Sentiment overview"
657+
analysis: "Sentiment analysis"
655658
sentiment_analysis:
656659
filter_types:
657660
all: "All"

plugin.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def self.public_asset_path(name)
123123
end
124124

125125
plugin_icons = %w[
126+
chart-column
126127
spell-check
127128
language
128129
images

0 commit comments

Comments
 (0)