diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/GroupsTableRenderer.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/GroupsTableRenderer.svelte
index 57bd834803..885277a6eb 100644
--- a/packages/builder/src/pages/builder/portal/manage/users/_components/GroupsTableRenderer.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/users/_components/GroupsTableRenderer.svelte
@@ -1,20 +1,21 @@
- {#if value?.groups?.length === 0}
-
-
No groups
+ {#if value.length === 0}
+
0
+ {:else if value.length === 1}
+
+ {value[0].name}
- {:else if value?.groups?.length === 1}
- {value.groups[0]?.name}
{:else}
- {parseInt(value?.groups?.length) || 0}
+ {parseInt(value.length) || 0} groups
{/if}
@@ -23,6 +24,10 @@
display: flex;
}
+ .opacity {
+ opacity: 0.7;
+ }
+
.spacing {
margin-right: var(--spacing-m);
}
diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/RoleTableRenderer.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/RoleTableRenderer.svelte
new file mode 100644
index 0000000000..571a5d1a34
--- /dev/null
+++ b/packages/builder/src/pages/builder/portal/manage/users/_components/RoleTableRenderer.svelte
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/SettingsTableRenderer.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/SettingsTableRenderer.svelte
new file mode 100644
index 0000000000..0ead895893
--- /dev/null
+++ b/packages/builder/src/pages/builder/portal/manage/users/_components/SettingsTableRenderer.svelte
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/builder/src/pages/builder/portal/manage/users/index.svelte b/packages/builder/src/pages/builder/portal/manage/users/index.svelte
index 669b82e48d..c16a9a897f 100644
--- a/packages/builder/src/pages/builder/portal/manage/users/index.svelte
+++ b/packages/builder/src/pages/builder/portal/manage/users/index.svelte
@@ -5,27 +5,26 @@
Button,
ButtonGroup,
Table,
- Label,
Layout,
Modal,
Icon,
notifications,
} from "@budibase/bbui"
- import AddUserModal from "./_components/AddUserModal.svelte"
import BasicOnboardingModal from "./_components/BasicOnboardingModal.svelte"
import { users, groups } from "stores/portal"
import { onMount } from "svelte"
import GroupsTableRenderer from "./_components/GroupsTableRenderer.svelte"
import AppsTableRenderer from "./_components/AppsTableRenderer.svelte"
import NameTableRenderer from "./_components/NameTableRenderer.svelte"
+ import SettingsTableRenderer from "./_components/SettingsTableRenderer.svelte"
const schema = {
name: {},
email: {},
role: {},
- userGroup: { displayName: "User group" },
+ userGroups: { displayName: "User groups" },
apps: {},
- settings: { displayName: "" },
+ settings: { width: "50px", displayName: "", align: "Right" },
// access: {},
// group: {}
}
@@ -57,10 +56,25 @@
adminAccess: !!user.admin?.global,
}))
- let createUserModal
- let basicOnboardingModal
+ $: enrichedUsers = $users.map(user => {
+ let userGroups = []
+ $groups.forEach(group => {
+ if (group.users) {
+ group.users?.forEach(y => {
+ if (y._id === user._id) {
+ userGroups.push(group)
+ }
+ })
+ }
+ })
+ return {
+ ...user,
+ userGroups,
+ }
+ })
- function openBasicOnboardingModal() {
+ let createUserModal
+ let basicOnboardingModal = function openBasicOnboardingModal() {
createUserModal.hide()
basicOnboardingModal.show()
}
@@ -103,23 +117,21 @@
-
-
-
diff --git a/packages/builder/src/stores/portal/groups.js b/packages/builder/src/stores/portal/groups.js
index 26e0f87041..3380fa9ca2 100644
--- a/packages/builder/src/stores/portal/groups.js
+++ b/packages/builder/src/stores/portal/groups.js
@@ -2,7 +2,14 @@ import { writable } from "svelte/store"
import { API } from "api"
export function createGroupsStore() {
- const store = writable([])
+ const DEFAULT_CONFIG = {
+ name: "",
+ icon: "",
+ color: "",
+ users: [],
+ }
+
+ const store = writable([DEFAULT_CONFIG])
const actions = {
init: async () => {