Resolve CE/EE diffs in dropdown_user

Part of single codebase changes.
This commit is contained in:
Luke Bennett 2019-05-22 04:08:30 +01:00
parent e63b65cd4f
commit d0bb69c02a
No known key found for this signature in database
GPG Key ID: 402ED51FB5D306C2
1 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ export default class DropdownUser extends DropdownAjaxFilter {
group_id: this.getGroupId(),
project_id: this.getProjectId(),
current_user: true,
...this.projectOrGroupId(),
},
onLoadingFinished: () => {
this.hideCurrentUser();
@ -36,4 +37,17 @@ export default class DropdownUser extends DropdownAjaxFilter {
getProjectId() {
return this.input.getAttribute('data-project-id');
}
projectOrGroupId() {
const projectId = this.getProjectId();
const groupId = this.getGroupId();
if (groupId) {
return {
group_id: groupId,
};
}
return {
project_id: projectId,
};
}
}