mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This commit introduces a new feature that allows staff to bulk select and delete users directly from the users list at `/admin/users/list`. The main use-case for this feature is make deleting spammers easier when a site is under a large spam attack. Internal topic: t/140321.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class AdminUsersListShowRoute extends DiscourseRoute {
|
|
queryParams = {
|
|
order: { refreshModel: true },
|
|
asc: { refreshModel: true },
|
|
username: { refreshModel: true },
|
|
};
|
|
|
|
// TODO: this has been introduced to fix a bug in admin-users-list-show
|
|
// loading AdminUser model multiple times without refactoring the controller
|
|
beforeModel(transition) {
|
|
const routeName = "adminUsersList.show";
|
|
|
|
if (transition.targetName === routeName) {
|
|
const params = transition.routeInfos.find(
|
|
(a) => a.name === routeName
|
|
).params;
|
|
const controller = this.controllerFor(routeName);
|
|
if (controller) {
|
|
controller.setProperties({
|
|
order: transition.to.queryParams.order,
|
|
asc: transition.to.queryParams.asc,
|
|
listFilter: transition.to.queryParams.username,
|
|
query: params.filter,
|
|
refreshing: false,
|
|
bulkSelectedUsersMap: {},
|
|
bulkSelectedUserIdsSet: new Set(),
|
|
displayBulkActions: false,
|
|
});
|
|
|
|
controller.resetFilters();
|
|
}
|
|
}
|
|
}
|
|
}
|