diff --git a/assets/javascripts/discourse/components/admin-report-emotion.hbs b/assets/javascripts/discourse/components/admin-report-emotion.hbs
index fb0119bd..08298b7c 100644
--- a/assets/javascripts/discourse/components/admin-report-emotion.hbs
+++ b/assets/javascripts/discourse/components/admin-report-emotion.hbs
@@ -6,14 +6,18 @@
@@ -21,7 +25,9 @@
class="cell value sevendays-count {{this.model.sevenDaysTrend}}"
title={{this.model.sevenDaysCountTitle}}
>
- {{number this.model.lastSevenDaysCount}}
+
+ {{number this.model.lastSevenDaysCount}}
+
{{d-icon this.model.sevenDaysTrendIcon}}
@@ -29,7 +35,10 @@
class="cell value thirty-days-count {{this.model.thirtyDaysTrend}}"
title={{this.model.thirtyDaysCountTitle}}
>
- {{number this.model.lastThirtyDaysCount}}
+
+
+ {{number this.model.lastThirtyDaysCount}}
+
{{#if this.model.canDisplayTrendIcon}}
{{d-icon this.model.thirtyDaysTrendIcon}}
{{/if}}
diff --git a/assets/javascripts/discourse/components/admin-report-emotion.js b/assets/javascripts/discourse/components/admin-report-emotion.js
index 221f7123..16aeb639 100644
--- a/assets/javascripts/discourse/components/admin-report-emotion.js
+++ b/assets/javascripts/discourse/components/admin-report-emotion.js
@@ -5,23 +5,35 @@ import getURL from "discourse-common/lib/get-url";
@classNames("admin-report-counters")
@attributeBindings("model.description:title")
export default class AdminReportEmotion extends Component {
- get filterURL() {
- return getURL(`/filter?q=`);
+ get todayLink() {
+ let date = moment().format("YYYY-MM-DD");
+ return this._filterURL(date);
}
- get today() {
- return moment().format("YYYY-MM-DD");
+ get yesterdayLink() {
+ let date = moment().subtract(1, "day").format("YYYY-MM-DD");
+ return this._filterURL(date);
}
- get yesterday() {
- return moment().subtract(1, "day").format("YYYY-MM-DD");
+ get lastSevenDaysLink() {
+ let date = moment().subtract(1, "week").format("YYYY-MM-DD");
+ return this._filterURL(date);
}
- get lastWeek() {
- return moment().subtract(1, "week").format("YYYY-MM-DD");
+ get lastThirtyDaysLink() {
+ let date = moment().subtract(1, "month").format("YYYY-MM-DD");
+ return this._filterURL(date);
}
- get lastMonth() {
- return moment().subtract(1, "month").format("YYYY-MM-DD");
+ _baseFilter() {
+ return "/filter?q=activity-after%3A";
+ }
+
+ _model() {
+ return "%20order%3A" + this.model.type;
+ }
+
+ _filterURL(date) {
+ return getURL(`${this._baseFilter()}${date}${this._model()}`);
}
}
diff --git a/spec/system/admin_dashboard_spec.rb b/spec/system/admin_dashboard_spec.rb
index 3c21d92d..b59310e0 100644
--- a/spec/system/admin_dashboard_spec.rb
+++ b/spec/system/admin_dashboard_spec.rb
@@ -12,4 +12,14 @@ RSpec.describe "Admin dashboard", type: :system do
expect(page).to have_css(".section.sentiment")
end
+
+ xit "displays the emotion table with links" do
+ SiteSetting.ai_sentiment_enabled = true
+ sign_in(admin)
+
+ visit "/admin"
+ find(".navigation-item.sentiment").click()
+
+ expect(page).to have_css(".admin-report.emotion-love .cell.value.today-count a")
+ end
end