mirror of
https://github.com/discourse/discourse.git
synced 2024-12-20 13:46:30 +08:00
6d4c6ee154
Conversion of `/admin/users` page to follow admin UX guidelines. In addition, add the username to the title on the user admin page.
33 lines
816 B
JavaScript
33 lines
816 B
JavaScript
import Group from "discourse/models/group";
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class AdminUserIndexRoute extends DiscourseRoute {
|
|
model() {
|
|
return this.modelFor("adminUser");
|
|
}
|
|
|
|
titleToken() {
|
|
return this.currentModel.username;
|
|
}
|
|
|
|
afterModel(model) {
|
|
if (this.currentUser.admin) {
|
|
return Group.findAll().then((groups) => {
|
|
this._availableGroups = groups.filterBy("automatic", false);
|
|
return model;
|
|
});
|
|
}
|
|
}
|
|
|
|
setupController(controller, model) {
|
|
controller.setProperties({
|
|
originalPrimaryGroupId: model.primary_group_id,
|
|
availableGroups: this._availableGroups,
|
|
customGroupIdsBuffer: model.customGroups.mapBy("id"),
|
|
ssoExternalEmail: null,
|
|
ssoLastPayload: null,
|
|
model,
|
|
});
|
|
}
|
|
}
|