From e4b0c55aa6175b493b9dcc97921275baf53fe5b4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 5 May 2023 20:10:54 +0100 Subject: [PATCH 1/2] Split group users component --- .../portal/users/groups/[groupId].svelte | 159 ++--------------- .../groups/_components/GroupUsers.svelte | 166 ++++++++++++++++++ 2 files changed, 179 insertions(+), 146 deletions(-) create mode 100644 packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte diff --git a/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte b/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte index 589df5c599..08c32bfeb9 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/[groupId].svelte @@ -1,62 +1,28 @@ + +
+ Users + {#if !scimEnabled} +
+ +
+ {:else} + + {/if} + + user._id)} + list={$users.data} + on:select={async e => { + await groups.actions.addUser(groupId, e.detail) + fetchGroupUsers.getInitialData() + }} + on:deselect={async e => { + await groups.actions.removeUser(groupId, e.detail) + fetchGroupUsers.getInitialData() + }} + /> + +
+ + $goto(`../users/${e.detail._id}`)} +> +
+ This user group doesn't have any users +
+
+ + + + From b1f1095c89d41722268b6a78a1ee33fb9786a381 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 5 May 2023 20:21:06 +0100 Subject: [PATCH 2/2] Split components --- .../groups/_components/EditUserPicker.svelte | 59 +++++++++++++++++ .../groups/_components/GroupUsers.svelte | 64 ++----------------- 2 files changed, 64 insertions(+), 59 deletions(-) create mode 100644 packages/builder/src/pages/builder/portal/users/groups/_components/EditUserPicker.svelte diff --git a/packages/builder/src/pages/builder/portal/users/groups/_components/EditUserPicker.svelte b/packages/builder/src/pages/builder/portal/users/groups/_components/EditUserPicker.svelte new file mode 100644 index 0000000000..a71634b262 --- /dev/null +++ b/packages/builder/src/pages/builder/portal/users/groups/_components/EditUserPicker.svelte @@ -0,0 +1,59 @@ + + +
+ +
+ + user._id)} + list={$users.data} + on:select={async e => { + await groups.actions.addUser(groupId, e.detail) + onUsersUpdated() + }} + on:deselect={async e => { + await groups.actions.removeUser(groupId, e.detail) + onUsersUpdated() + }} + /> + diff --git a/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte b/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte index ecc896989a..9c18008e44 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte @@ -1,18 +1,11 @@