discourse/app/assets/javascripts/admin/addon/controllers/admin-dashboard-moderation.js
David Taylor 0ed4b09527
DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`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.
2025-01-13 13:02:49 +00:00

50 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 };
}
}