mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-09 15:43:28 +00:00
**This PR includes a variety of updates to the Sentiment Analysis report:** - [X] Conditionally showing sentiment reports based on `sentiment_enabled` setting - [X] Sentiment reports should only be visible in sidebar if data is in the reports - [X] Fix infinite loading of posts in drill down - [x] Fix markdown emojis showing not showing as emoji representation - [x] Drill down of posts should have URL - [x] ~~Different doughnut sizing based on post count~~ [reverting and will address in follow-up (see: `/t/146786/47`)] - [X] Hide non-functional export button - [X] Sticky drill down filter nav
28 lines
711 B
JavaScript
28 lines
711 B
JavaScript
import { apiInitializer } from "discourse/lib/api";
|
|
|
|
export default apiInitializer("1.15.0", (api) => {
|
|
const currentUser = api.getCurrentUser();
|
|
|
|
if (
|
|
!currentUser ||
|
|
!currentUser.admin ||
|
|
!currentUser.can_see_sentiment_reports
|
|
) {
|
|
return;
|
|
}
|
|
|
|
api.addAdminSidebarSectionLink("reports", {
|
|
name: "sentiment_overview",
|
|
route: "admin.dashboardSentiment",
|
|
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",
|
|
});
|
|
});
|