generated from discourse/discourse-plugin-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "DEV: Updates to sentiment analysis reports (#1161)"
This reverts commit 8863cf0. The conditionals added around the report registrations are incompatible with multisite environment and skip_db=true
- Loading branch information
1 parent
e255c7a
commit 86bdc7b
Showing
9 changed files
with
75 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 15 additions & 21 deletions
36
assets/javascripts/initializers/ai-sentiment-admin-nav.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import { apiInitializer } from "discourse/lib/api"; | ||
|
||
export default apiInitializer("1.15.0", (api) => { | ||
const currentUser = api.getCurrentUser(); | ||
const settings = api.container.lookup("service:site-settings"); | ||
|
||
if ( | ||
!currentUser || | ||
!currentUser.admin || | ||
!currentUser.can_see_sentiment_reports | ||
) { | ||
return; | ||
if (settings.ai_sentiment_enabled) { | ||
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", | ||
}); | ||
} | ||
|
||
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", | ||
}); | ||
}); |
Oops, something went wrong.