Merge pull request #8908 from Budibase/bug/sev2/invite-modal

Re-add invite modal
This commit is contained in:
melohagan 2022-12-02 13:27:15 +00:00 committed by GitHub
commit 44293c2179
2 changed files with 6 additions and 17 deletions

View File

@ -50,7 +50,7 @@
}
</script>
<ModalContent showCancelButton={false} {title} confirmText="Done">
<ModalContent size="M" showCancelButton={false} {title} confirmText="Done">
{#if hasSuccess}
<Body size="XS">
Your users should now receive an email invite to get access to their
@ -70,6 +70,3 @@
/>
{/if}
</ModalContent>
<style>
</style>

View File

@ -7,7 +7,6 @@
Table,
Layout,
Modal,
ModalContent,
Search,
notifications,
Pagination,
@ -23,6 +22,7 @@
import { goto } from "@roxi/routify"
import OnboardingTypeModal from "./_components/OnboardingTypeModal.svelte"
import PasswordModal from "./_components/PasswordModal.svelte"
import InvitedModal from "./_components/InvitedModal.svelte"
import ImportUsersModal from "./_components/ImportUsersModal.svelte"
import { get } from "svelte/store"
import { Constants, Utils, fetchData } from "@budibase/frontend-core"
@ -67,6 +67,8 @@
sortable: false,
},
}
$: userData = []
$: inviteUsersResponse = { successful: [], unsuccessful: [] }
$: {
enrichedUsers = $fetch.rows?.map(user => {
let userGroups = []
@ -112,8 +114,7 @@
groups: userData.groups,
}))
try {
const res = await users.invite(payload)
notifications.success(res.message)
inviteUsersResponse = await users.invite(payload)
inviteConfirmationModal.show()
} catch (error) {
notifications.error("Error inviting user")
@ -273,16 +274,7 @@
</Modal>
<Modal bind:this={inviteConfirmationModal}>
<ModalContent
showCancelButton={false}
title="Invites sent!"
confirmText="Done"
>
<Body size="S">
Your users should now recieve an email invite to get access to their
Budibase account
</Body>
</ModalContent>
<InvitedModal {inviteUsersResponse} />
</Modal>
<Modal bind:this={onboardingTypeModal}>