Added pending users to user portal screen
This commit is contained in:
parent
3e78989e74
commit
5dff2f3017
|
@ -110,6 +110,27 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
let invitesLoaded = false
|
||||||
|
let pendingInvites = []
|
||||||
|
let parsedInvites = []
|
||||||
|
|
||||||
|
const invitesToSchema = invites => {
|
||||||
|
return invites.map(invite => {
|
||||||
|
const { admin, builder, userGroups, apps } = invite.info
|
||||||
|
|
||||||
|
return {
|
||||||
|
email: invite.email,
|
||||||
|
builder,
|
||||||
|
admin,
|
||||||
|
userGroups: userGroups,
|
||||||
|
apps: apps ? [...new Set(Object.keys(apps))] : undefined,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$: parsedInvites = invitesToSchema(pendingInvites)
|
||||||
|
$: console.log("parsed invites ", parsedInvites)
|
||||||
|
// $: console.log(pendingInvites)
|
||||||
|
$: console.log(enrichedUsers)
|
||||||
|
|
||||||
const updateFetch = email => {
|
const updateFetch = email => {
|
||||||
fetch.update({
|
fetch.update({
|
||||||
|
@ -232,6 +253,9 @@
|
||||||
try {
|
try {
|
||||||
await groups.actions.init()
|
await groups.actions.init()
|
||||||
groupsLoaded = true
|
groupsLoaded = true
|
||||||
|
|
||||||
|
pendingInvites = await users.getInvites()
|
||||||
|
invitesLoaded = true
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error fetching user group data")
|
notifications.error("Error fetching user group data")
|
||||||
}
|
}
|
||||||
|
@ -326,6 +350,23 @@
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
||||||
|
<Layout noPadding gap="M">
|
||||||
|
<Layout gap="XS" noPadding>
|
||||||
|
<Heading>Pending invitations</Heading>
|
||||||
|
<Body>A list of all pending user invitations</Body>
|
||||||
|
</Layout>
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
<Table
|
||||||
|
{schema}
|
||||||
|
data={parsedInvites}
|
||||||
|
allowEditColumns={false}
|
||||||
|
allowEditRows={false}
|
||||||
|
{customRenderers}
|
||||||
|
loading={!invitesLoaded}
|
||||||
|
/>
|
||||||
|
</Layout>
|
||||||
|
|
||||||
<Modal bind:this={createUserModal}>
|
<Modal bind:this={createUserModal}>
|
||||||
<AddUserModal {showOnboardingTypeModal} />
|
<AddUserModal {showOnboardingTypeModal} />
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
Loading…
Reference in New Issue