Restructure user list page a bit

This commit is contained in:
Andrew Kingston 2023-10-31 12:10:31 +00:00
parent d5629bb4ec
commit 9e18c666ad
1 changed files with 16 additions and 14 deletions

View File

@ -45,6 +45,10 @@
datasource: { datasource: {
type: "user", type: "user",
}, },
options: {
paginate: true,
limit: 10,
},
}) })
let groupsLoaded = !$licensing.groupsEnabled || $groups?.length let groupsLoaded = !$licensing.groupsEnabled || $groups?.length
@ -64,10 +68,12 @@
{ column: "role", component: RoleTableRenderer }, { column: "role", component: RoleTableRenderer },
] ]
let userData = [] let userData = []
let invitesLoaded = false
let pendingInvites = []
let parsedInvites = []
$: isOwner = $auth.accountPortalAccess && $admin.cloud $: isOwner = $auth.accountPortalAccess && $admin.cloud
$: readonly = !sdk.users.isAdmin($auth.user) || $features.isScimEnabled $: readonly = !sdk.users.isAdmin($auth.user) || $features.isScimEnabled
$: debouncedUpdateFetch(searchEmail) $: debouncedUpdateFetch(searchEmail)
$: schema = { $: schema = {
email: { email: {
@ -87,16 +93,6 @@
width: "1fr", width: "1fr",
}, },
} }
const getPendingSchema = tblSchema => {
if (!tblSchema) {
return {}
}
let pendingSchema = JSON.parse(JSON.stringify(tblSchema))
pendingSchema.email.displayName = "Pending Invites"
return pendingSchema
}
$: pendingSchema = getPendingSchema(schema) $: pendingSchema = getPendingSchema(schema)
$: userData = [] $: userData = []
$: inviteUsersResponse = { successful: [], unsuccessful: [] } $: inviteUsersResponse = { successful: [], unsuccessful: [] }
@ -120,9 +116,15 @@
} }
}) })
} }
let invitesLoaded = false
let pendingInvites = [] const getPendingSchema = tblSchema => {
let parsedInvites = [] if (!tblSchema) {
return {}
}
let pendingSchema = JSON.parse(JSON.stringify(tblSchema))
pendingSchema.email.displayName = "Pending Invites"
return pendingSchema
}
const invitesToSchema = invites => { const invitesToSchema = invites => {
return invites.map(invite => { return invites.map(invite => {