Skip to content

Commit e400d8e

Browse files
committed
fix(NewUserDialog): allow to deselect a group from the list
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
1 parent 43aa883 commit e400d8e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

apps/settings/src/components/Users/NewUserDialog.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
:create-option="(value) => ({ id: value, name: value, isCreating: true })"
8484
@search="searchGroups"
8585
@option:created="createGroup"
86+
@option:deselected="removeGroup"
8687
@option:selected="options => addGroup(options.at(-1))" />
8788
<!-- If user is not admin, they are a subadmin.
8889
Subadmins can't create users outside their groups
@@ -348,6 +349,18 @@ export default {
348349
this.newUser.groups.push(group)
349350
},
350351
352+
/**
353+
* Remove user from group
354+
*
355+
* @param {object} group Group object
356+
*/
357+
removeGroup(group) {
358+
if (group.canRemove === false) {
359+
return
360+
}
361+
this.newUser.groups = this.newUser.groups.filter((g) => g.id !== group.id)
362+
},
363+
351364
/**
352365
* Validate quota string to make sure it's a valid human file size
353366
*

0 commit comments

Comments
 (0)