mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 12:24:55 +00:00
dbcefcf85e
When the user sees no results in their admin sidebar query, we are adding two additional links: * "Search site settings" - Navigates to the site settings page with the filter prefilled in the search * "Admin user list" - Navigates to the user list with the filter prefilled in the username search This will bridge the gap until we have a full admin-wide search. Also make admin site setting search param refresh on filter changes --------- Co-authored-by: Jarek Radosz <jradosz@gmail.com>
34 lines
1.0 KiB
JavaScript
34 lines
1.0 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,
|
|
});
|
|
|
|
controller.resetFilters();
|
|
}
|
|
}
|
|
}
|
|
}
|