diff --git a/assets/javascripts/discourse/components/assign-user-form.js b/assets/javascripts/discourse/components/assign-user-form.js index 6f7f7dd..d9df235 100644 --- a/assets/javascripts/discourse/components/assign-user-form.js +++ b/assets/javascripts/discourse/components/assign-user-form.js @@ -27,18 +27,4 @@ export default class AssignUserForm extends Component { await this.args.onSubmit(); } - - @action - assignUsername([name]) { - this.assigneeName = name; - this.assigneeError = false; - - if (this.taskActions.allowedGroupsForAssignment.includes(name)) { - this.args.model.username = null; - this.args.model.group_name = name; - } else { - this.args.model.username = name; - this.args.model.group_name = null; - } - } } diff --git a/assets/javascripts/discourse/components/assignment.js b/assets/javascripts/discourse/components/assignment.js index 950a71b..62304fb 100644 --- a/assets/javascripts/discourse/components/assignment.js +++ b/assets/javascripts/discourse/components/assignment.js @@ -28,6 +28,20 @@ export default class Assignment extends Component { } } + @action + setAssignee([newAssignee]) { + this.assigneeName = newAssignee; + // this.assigneeError = false; fixme andrei + + if (this.taskActions.allowedGroupsForAssignment.includes(newAssignee)) { + this.args.model.username = null; + this.args.model.group_name = newAssignee; + } else { + this.args.model.username = newAssignee; + this.args.model.group_name = null; + } + } + get #assignStatuses() { return this.siteSettings.assign_statuses.split("|"); }