FEATURE: admin UI to merge two users. (#9509)

This commit is contained in:
Vinoth Kannan
2020-04-22 14:07:51 +05:30
committed by GitHub
parent 13956017da
commit a511bea4cc
13 changed files with 238 additions and 1 deletions

View File

@ -0,0 +1,35 @@
import Controller, { inject as controller } from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import discourseComputed from "discourse-common/utils/decorators";
import { alias } from "@ember/object/computed";
export default Controller.extend(ModalFunctionality, {
adminUserIndex: controller(),
username: alias("model.username"),
targetUsername: alias("model.targetUsername"),
onShow() {
this.set("value", null);
},
@discourseComputed("username", "targetUsername")
text(username, targetUsername) {
return `transfer @${username} to @${targetUsername}`;
},
@discourseComputed("value", "text")
mergeDisabled(value, text) {
return !value || text !== value;
},
actions: {
merge() {
this.adminUserIndex.send("merge", this.targetUsername);
this.send("closeModal");
},
cancel() {
this.send("closeModal");
}
}
});