mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-14 23:27:06 +08:00
`discourse-common` was created in the past to share logic between the 'wizard' app and the main 'discourse' app. Since then, the wizard has been consolidated into the main app, so the separation of `discourse-common` is no longer useful. This commit moves `discourse-common/(lib|utils)/*` into `discourse/lib/*`, adds shims for the imports, and updates existing uses in core.
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
import { computed } from "@ember/object";
|
|
import discourseComputed from "discourse/lib/decorators";
|
|
import AdminDashboardTabController from "./admin-dashboard-tab";
|
|
|
|
export default class AdminDashboardModerationController extends AdminDashboardTabController {
|
|
@discourseComputed
|
|
flagsStatusOptions() {
|
|
return {
|
|
table: {
|
|
total: false,
|
|
perPage: 10,
|
|
},
|
|
};
|
|
}
|
|
|
|
@computed("siteSettings.dashboard_hidden_reports")
|
|
get isModeratorsActivityVisible() {
|
|
return !(this.siteSettings.dashboard_hidden_reports || "")
|
|
.split("|")
|
|
.filter(Boolean)
|
|
.includes("moderators_activity");
|
|
}
|
|
|
|
@discourseComputed
|
|
userFlaggingRatioOptions() {
|
|
return {
|
|
table: {
|
|
total: false,
|
|
perPage: 10,
|
|
},
|
|
};
|
|
}
|
|
|
|
@computed("startDate", "endDate")
|
|
get filters() {
|
|
return { startDate: this.startDate, endDate: this.endDate };
|
|
}
|
|
|
|
@discourseComputed("endDate")
|
|
lastWeekFilters(endDate) {
|
|
const lastWeek = moment()
|
|
.locale("en")
|
|
.utc()
|
|
.endOf("day")
|
|
.subtract(1, "week");
|
|
|
|
return { lastWeek, endDate };
|
|
}
|
|
}
|