diff --git a/packages/builder/src/pages/builder/portal/users/users/[userId].svelte b/packages/builder/src/pages/builder/portal/users/users/[userId].svelte
index 67ea23ceed..d3e709db69 100644
--- a/packages/builder/src/pages/builder/portal/users/users/[userId].svelte
+++ b/packages/builder/src/pages/builder/portal/users/users/[userId].svelte
@@ -18,20 +18,63 @@
Modal,
notifications,
Banner,
- StatusLight,
+ Table,
} from "@budibase/bbui"
- import { onMount } from "svelte"
+ import { onMount, setContext } from "svelte"
import { users, auth, groups, apps, licensing } from "stores/portal"
import { roles } from "stores/backend"
import ForceResetPasswordModal from "./_components/ForceResetPasswordModal.svelte"
import UserGroupPicker from "components/settings/UserGroupPicker.svelte"
import DeleteUserModal from "./_components/DeleteUserModal.svelte"
import GroupIcon from "../groups/_components/GroupIcon.svelte"
- import { Constants, RoleUtils } from "@budibase/frontend-core"
+ import { Constants } from "@budibase/frontend-core"
import { Breadcrumbs, Breadcrumb } from "components/portal/page"
+ import RemoveGroupTableRenderer from "./_components/RemoveGroupTableRenderer.svelte"
+ import GroupNameTableRenderer from "../groups/_components/GroupNameTableRenderer.svelte"
+ import AppNameTableRenderer from "./_components/AppNameTableRenderer.svelte"
+ import AppRoleTableRenderer from "./_components/AppRoleTableRenderer.svelte"
export let userId
+ const groupSchema = {
+ name: {
+ width: "1fr",
+ },
+ _id: {
+ displayName: "",
+ width: "auto",
+ borderLeft: true,
+ },
+ }
+ const appSchema = {
+ name: {
+ width: "2fr",
+ },
+ role: {
+ width: "1fr",
+ },
+ }
+ const customGroupTableRenderers = [
+ {
+ column: "name",
+ component: GroupNameTableRenderer,
+ },
+ {
+ column: "_id",
+ component: RemoveGroupTableRenderer,
+ },
+ ]
+ const customAppTableRenderers = [
+ {
+ column: "name",
+ component: AppNameTableRenderer,
+ },
+ {
+ column: "role",
+ component: AppRoleTableRenderer,
+ },
+ ]
+
let deleteModal
let resetPasswordModal
let popoverAnchor
@@ -113,11 +156,6 @@
.join("")
}
- const getRoleLabel = roleId => {
- const role = $roles.find(x => x._id === roleId)
- return role?.name || "Custom role"
- }
-
async function updateUserFirstName(evt) {
try {
await users.save({ ...user, firstName: evt.target.value })
@@ -172,6 +210,10 @@
await fetchUser()
}
+ setContext("groups", {
+ removeGroup,
+ })
+
onMount(async () => {
try {
await Promise.all([
@@ -272,61 +314,43 @@
/>
-
- {#if userGroups.length}
- {#each userGroups as group}
-
+