Merge remote-tracking branch 'origin/develop' into feature/db-query-save-prompt

This commit is contained in:
Dean 2023-05-15 12:09:25 +01:00
commit 5b2f37e175
4 changed files with 49 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "2.6.8-alpha.10", "version": "2.6.8-alpha.11",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/backend-core", "packages/backend-core",

View File

@ -22,7 +22,11 @@
export let rowCount export let rowCount
export let disableSorting = false export let disableSorting = false
export let customPlaceholder = false export let customPlaceholder = false
<<<<<<< HEAD
export let allowEditing = true export let allowEditing = true
=======
export let allowClickRows
>>>>>>> origin/develop
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -112,6 +116,7 @@
{customPlaceholder} {customPlaceholder}
{allowEditing} {allowEditing}
showAutoColumns={!hideAutocolumns} showAutoColumns={!hideAutocolumns}
{allowClickRows}
on:clickrelationship={e => selectRelationship(e.detail)} on:clickrelationship={e => selectRelationship(e.detail)}
on:sort on:sort
> >

View File

@ -555,7 +555,7 @@
{#if filteredUsers?.length} {#if filteredUsers?.length}
<div class="auth-entity-section"> <div class="auth-entity-section">
<div class="auth-entity-header "> <div class="auth-entity-header">
<div class="auth-entity-title">Users</div> <div class="auth-entity-title">Users</div>
<div class="auth-entity-access-title">Access</div> <div class="auth-entity-access-title">Access</div>
</div> </div>
@ -696,7 +696,7 @@
max-width: calc(100vw - 40px); max-width: calc(100vw - 40px);
background: var(--background); background: var(--background);
border-left: var(--border-light); border-left: var(--border-light);
z-index: 3; z-index: 999;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: auto; overflow-y: auto;

View File

@ -88,6 +88,16 @@
}, },
} }
const getPendingSchema = tblSchema => {
if (!tblSchema) {
return {}
}
let pendingSchema = JSON.parse(JSON.stringify(tblSchema))
pendingSchema.email.displayName = "Pending Invites"
return pendingSchema
}
$: pendingSchema = getPendingSchema(schema)
$: userData = [] $: userData = []
$: inviteUsersResponse = { successful: [], unsuccessful: [] } $: inviteUsersResponse = { successful: [], unsuccessful: [] }
$: { $: {
@ -110,6 +120,24 @@
} }
}) })
} }
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)
const updateFetch = email => { const updateFetch = email => {
fetch.update({ fetch.update({
@ -144,6 +172,7 @@
})) }))
try { try {
inviteUsersResponse = await users.invite(payload) inviteUsersResponse = await users.invite(payload)
pendingInvites = await users.getInvites()
inviteConfirmationModal.show() inviteConfirmationModal.show()
} catch (error) { } catch (error) {
notifications.error("Error inviting user") notifications.error("Error inviting user")
@ -232,6 +261,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")
} }
@ -324,6 +356,15 @@
goToNextPage={fetch.nextPage} goToNextPage={fetch.nextPage}
/> />
</div> </div>
<Table
schema={pendingSchema}
data={parsedInvites}
allowEditColumns={false}
allowEditRows={false}
{customRenderers}
loading={!invitesLoaded}
allowClickRows={false}
/>
</Layout> </Layout>
<Modal bind:this={createUserModal}> <Modal bind:this={createUserModal}>