assigned users autocomplete self

This commit is contained in:
Yuri Kuznetsov
2024-09-20 11:17:00 +03:00
parent 6b2fff5634
commit e4e61cf84c
+18
View File
@@ -62,6 +62,24 @@ class AssignedUsersFieldView extends LinkMultipleFieldView {
return avatarHtml + ' ' + html;
}
/** @inheritDoc */
getOnEmptyAutocomplete() {
if (this.params.autocompleteOnEmpty) {
return undefined;
}
if (this.ids && this.ids.includes(this.getUser().id)) {
return Promise.resolve([]);
}
return Promise.resolve([
{
id: this.getUser().id,
name: this.getUser().get('name'),
},
]);
}
}
export default AssignedUsersFieldView;