mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 03:43:39 +08:00
30 lines
803 B
JavaScript
30 lines
803 B
JavaScript
|
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"),
|
||
|
|
||
|
onShow() {
|
||
|
this.set("targetUsername", null);
|
||
|
},
|
||
|
|
||
|
@discourseComputed("username", "targetUsername")
|
||
|
mergeDisabled(username, targetUsername) {
|
||
|
return !targetUsername || username === targetUsername;
|
||
|
},
|
||
|
|
||
|
actions: {
|
||
|
merge() {
|
||
|
this.send("closeModal");
|
||
|
this.adminUserIndex.send("showMergeConfirmation", this.targetUsername);
|
||
|
},
|
||
|
|
||
|
cancel() {
|
||
|
this.send("closeModal");
|
||
|
}
|
||
|
}
|
||
|
});
|