DEV: improve code readability & add tests for user guardian.

a511bea4cc3f50bd1e067a46bdbf5cd19eb335a3
This commit is contained in:
Vinoth Kannan
2020-04-30 20:59:33 +05:30
parent c092370847
commit 71241a50f7
8 changed files with 62 additions and 30 deletions

View File

@ -2,6 +2,7 @@ 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";
import { action } from "@ember/object";
export default Controller.extend(ModalFunctionality, {
adminUserIndex: controller(),
@ -16,14 +17,14 @@ export default Controller.extend(ModalFunctionality, {
return !targetUsername || username === targetUsername;
},
actions: {
merge() {
this.send("closeModal");
this.adminUserIndex.send("showMergeConfirmation", this.targetUsername);
},
@action
showConfirmation() {
this.send("closeModal");
this.adminUserIndex.send("showMergeConfirmation", this.targetUsername);
},
cancel() {
this.send("closeModal");
}
@action
close() {
this.send("closeModal");
}
});