mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-01 06:49:30 +00:00
UX: add links to sentiment to admin sidebar (#1158)
This commit is contained in:
parent
eccfbad046
commit
5368b0c7d0
@ -1,7 +1,7 @@
|
||||
<div class="sentiment section">
|
||||
<div class="period-section">
|
||||
<div class="section-title">
|
||||
<h2>
|
||||
<h2 id="sentiment-heading">
|
||||
{{i18n "discourse_ai.sentiments.dashboard.title"}}
|
||||
</h2>
|
||||
|
||||
|
21
assets/javascripts/initializers/ai-sentiment-admin-nav.js
Normal file
21
assets/javascripts/initializers/ai-sentiment-admin-nav.js
Normal file
@ -0,0 +1,21 @@
|
||||
import { apiInitializer } from "discourse/lib/api";
|
||||
|
||||
export default apiInitializer("1.15.0", (api) => {
|
||||
const settings = api.container.lookup("service:site-settings");
|
||||
|
||||
if (settings.ai_sentiment_enabled) {
|
||||
api.addAdminSidebarSectionLink("reports", {
|
||||
name: "sentiment_overview",
|
||||
href: "/admin/dashboard/sentiment#sentiment-heading",
|
||||
label: "discourse_ai.sentiments.sidebar.overview",
|
||||
icon: "chart-column",
|
||||
});
|
||||
api.addAdminSidebarSectionLink("reports", {
|
||||
name: "sentiment_analysis",
|
||||
route: "adminReports.show",
|
||||
routeModels: ["sentiment_analysis"],
|
||||
label: "discourse_ai.sentiments.sidebar.analysis",
|
||||
icon: "chart-pie",
|
||||
});
|
||||
}
|
||||
});
|
@ -652,6 +652,9 @@ en:
|
||||
sentiments:
|
||||
dashboard:
|
||||
title: "Sentiment"
|
||||
sidebar:
|
||||
overview: "Sentiment overview"
|
||||
analysis: "Sentiment analysis"
|
||||
sentiment_analysis:
|
||||
filter_types:
|
||||
all: "All"
|
||||
|
Loading…
x
Reference in New Issue
Block a user