FIX: broken suggestions (#189)

We need to pass name to assignUser because it is used in 2 places.
One is multiselect and another are suggestions.
This commit is contained in:
Krzysztof Kotlarek 2021-08-27 12:57:17 +10:00 committed by GitHub
parent 1306a69b06
commit 9d7d39705e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -39,27 +39,27 @@ export default Controller.extend({
},
@action
assignUser(assignee) {
assignUser(name) {
if (this.isBulkAction) {
this.bulkAction(assignee.name);
this.bulkAction(name);
return;
}
if (this.allowedGroupsForAssignment.includes(assignee.name)) {
if (this.allowedGroupsForAssignment.includes(name)) {
this.setProperties({
"model.username": null,
"model.group_name": assignee.name,
"model.group_name": name,
"model.allowedGroups": this.taskActions.allowedGroups,
});
} else {
this.setProperties({
"model.username": assignee.name,
"model.username": name,
"model.group_name": null,
"model.allowedGroups": this.taskActions.allowedGroups,
});
}
if (assignee.name) {
if (name) {
return this.assign();
}
},
@ -107,6 +107,6 @@ export default Controller.extend({
@action
assignUsername(selected) {
this.assignUser({ name: selected.firstObject });
this.assignUser(selected.firstObject);
},
});

View File

@ -19,7 +19,7 @@
}}
<div class="assign-suggestions">
{{#each assignSuggestions as |user|}}
<a href {{action "assignUser" user}}>
<a href {{action "assignUser" user.username }}>
{{avatar user imageSize="small"}}
</a>
{{/each}}