From 2ad882113e6f0d32155b84788f352e9adc7373bc Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 7 Sep 2018 16:49:44 +0200 Subject: [PATCH] FIX: corrects top-referred and trending-search dates (#6372) --- .../admin-dashboard-next-general.js.es6 | 36 +++++++++++++++---- .../templates/dashboard_next_general.hbs | 4 ++- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 b/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 index 84ad3623274..687f66333ea 100644 --- a/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-dashboard-next-general.js.es6 @@ -23,11 +23,6 @@ export default Ember.Controller.extend(PeriodComputationMixin, { ), shouldDisplayDurability: Ember.computed.and("diskSpace"), - @computed - topReferredTopicsTopions() { - return { table: { total: false, limit: 8 } }; - }, - @computed activityMetrics() { return [ @@ -48,9 +43,38 @@ export default Ember.Controller.extend(PeriodComputationMixin, { }; }, + @computed + topReferredTopicsOptions() { + return { + table: { total: false, limit: 8 } + }; + }, + + @computed + topReferredTopicsFilters() { + return { + startDate: moment() + .subtract(2, "days") + .startOf("day"), + endDate: this.get("today") + }; + }, + + @computed + trendingSearchFilters() { + return { + startDate: moment() + .subtract(2, "days") + .startOf("day"), + endDate: this.get("today") + }; + }, + @computed trendingSearchOptions() { - return { table: { total: false, limit: 8 } }; + return { + table: { total: false, limit: 8 } + }; }, usersByTypeReport: staticReport("users_by_type"), diff --git a/app/assets/javascripts/admin/templates/dashboard_next_general.hbs b/app/assets/javascripts/admin/templates/dashboard_next_general.hbs index c0ce8d74a1f..98ca3f03048 100644 --- a/app/assets/javascripts/admin/templates/dashboard_next_general.hbs +++ b/app/assets/javascripts/admin/templates/dashboard_next_general.hbs @@ -154,12 +154,14 @@
{{admin-report + filters=topReferredTopicsFilters dataSourceName="top_referred_topics" - reportOptions=topReferredTopicsTopions}} + reportOptions=topReferredTopicsOptions}} {{admin-report dataSourceName="trending_search" reportOptions=trendingSearchOptions + filters=trendingSearchFilters isEnabled=logSearchQueriesEnabled disabledLabel="admin.dashboard.reports.trending_search.disabled"}} {{{i18n "admin.dashboard.reports.trending_search.more"}}}