FIX: simplify filters on admin-report component (#6193)
This commit is contained in:
parent
6740631fdb
commit
b7d1864d0a
|
@ -50,6 +50,7 @@ export default Ember.Component.extend({
|
|||
reportOptions: null,
|
||||
forcedModes: null,
|
||||
showAllReportsLink: false,
|
||||
filters: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
category: null,
|
||||
|
@ -77,7 +78,7 @@ export default Ember.Component.extend({
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
const state = this.get("filteringState") || {};
|
||||
const state = this.get("filters") || {};
|
||||
this.setProperties({
|
||||
category: Category.findById(state.categoryId),
|
||||
groupId: state.groupId,
|
||||
|
|
|
@ -77,6 +77,11 @@ export default Ember.Controller.extend(PeriodComputationMixin, {
|
|||
}
|
||||
},
|
||||
|
||||
@computed("startDate", "endDate")
|
||||
filters(startDate, endDate) {
|
||||
return { startDate, endDate };
|
||||
},
|
||||
|
||||
@computed("model.attributes.updated_at")
|
||||
updatedTimestamp(updatedAt) {
|
||||
return moment(updatedAt).format("LLL");
|
||||
|
@ -88,6 +93,6 @@ export default Ember.Controller.extend(PeriodComputationMixin, {
|
|||
},
|
||||
|
||||
_reportsForPeriodURL(period) {
|
||||
return Discourse.getURL(`/admin/dashboard/general?period=${period}`);
|
||||
return Discourse.getURL(`/admin?period=${period}`);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -12,6 +12,16 @@ export default Ember.Controller.extend(PeriodComputationMixin, {
|
|||
};
|
||||
},
|
||||
|
||||
@computed("startDate", "endDate")
|
||||
filters(startDate, endDate) {
|
||||
return { startDate, endDate };
|
||||
},
|
||||
|
||||
@computed("lastWeek", "endDate")
|
||||
lastWeekfilters(startDate, endDate) {
|
||||
return { startDate, endDate };
|
||||
},
|
||||
|
||||
_reportsForPeriodURL(period) {
|
||||
return Discourse.getURL(`/admin/dashboard/moderation?period=${period}`);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export default Ember.Controller.extend({
|
|||
},
|
||||
|
||||
@computed("category_id", "group_id", "start_date", "end_date")
|
||||
filteringState(categoryId, groupId, startDate, endDate) {
|
||||
filters(categoryId, groupId, startDate, endDate) {
|
||||
return {
|
||||
categoryId,
|
||||
groupId,
|
||||
|
|
|
@ -18,43 +18,37 @@
|
|||
dataSourceName="signups"
|
||||
showTrend=true
|
||||
forcedModes="chart"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
filters=filters}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="topics"
|
||||
showTrend=true
|
||||
forcedModes="chart"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
filters=filters}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="posts"
|
||||
showTrend=true
|
||||
forcedModes="chart"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
filters=filters}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="dau_by_mau"
|
||||
showTrend=true
|
||||
forcedModes="chart"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
filters=filters}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="daily_engaged_users"
|
||||
showTrend=true
|
||||
forcedModes="chart"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
filters=filters}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="new_contributors"
|
||||
showTrend=true
|
||||
forcedModes="chart"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
filters=filters}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -170,17 +164,13 @@
|
|||
<div class="section-column">
|
||||
{{admin-report
|
||||
dataSourceName="top_referred_topics"
|
||||
reportOptions=topReferredTopicsTopions
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
reportOptions=topReferredTopicsTopions}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="trending_search"
|
||||
reportOptions=trendingSearchOptions
|
||||
isEnabled=logSearchQueriesEnabled
|
||||
disabledLabel="admin.dashboard.reports.trending_search.disabled"
|
||||
startDate=startDate
|
||||
endDate=endDate}}
|
||||
disabledLabel="admin.dashboard.reports.trending_search.disabled"}}
|
||||
{{{i18n "admin.dashboard.reports.trending_search.more"}}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
<div class="section-body">
|
||||
{{admin-report
|
||||
startDate=startDate
|
||||
endDate=endDate
|
||||
filters=filters
|
||||
showHeader=false
|
||||
dataSourceName="moderators_activity"}}
|
||||
</div>
|
||||
|
@ -27,14 +26,12 @@
|
|||
<div class="main-section">
|
||||
{{admin-report
|
||||
dataSourceName="flags_status"
|
||||
startDate=lastWeek
|
||||
reportOptions=flagsStatusOptions
|
||||
endDate=endDate}}
|
||||
filters=lastWeekfilters}}
|
||||
|
||||
{{admin-report
|
||||
dataSourceName="post_edits"
|
||||
startDate=lastWeek
|
||||
endDate=endDate}}
|
||||
filters=lastWeekfilters}}
|
||||
|
||||
{{plugin-outlet name="admin-dashboard-moderation-bottom"}}
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{{admin-report
|
||||
showAllReportsLink=true
|
||||
dataSourceName=model.type
|
||||
filteringState=filteringState
|
||||
filters=filters
|
||||
reportOptions=reportOptions
|
||||
showFilteringUI=true
|
||||
onRefresh=(action "onParamsChange")}}
|
||||
|
|
Loading…
Reference in New Issue