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

View File

@ -7,7 +7,6 @@
Table, Table,
Layout, Layout,
Modal, Modal,
ModalContent,
Search, Search,
notifications, notifications,
Pagination, Pagination,
@ -23,6 +22,7 @@
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
import OnboardingTypeModal from "./_components/OnboardingTypeModal.svelte" import OnboardingTypeModal from "./_components/OnboardingTypeModal.svelte"
import PasswordModal from "./_components/PasswordModal.svelte" import PasswordModal from "./_components/PasswordModal.svelte"
import InvitedModal from "./_components/InvitedModal.svelte"
import ImportUsersModal from "./_components/ImportUsersModal.svelte" import ImportUsersModal from "./_components/ImportUsersModal.svelte"
import { get } from "svelte/store" import { get } from "svelte/store"
import { Constants, Utils, fetchData } from "@budibase/frontend-core" import { Constants, Utils, fetchData } from "@budibase/frontend-core"
@ -67,6 +67,8 @@
sortable: false, sortable: false,
}, },
} }
$: userData = []
$: inviteUsersResponse = { successful: [], unsuccessful: [] }
$: { $: {
enrichedUsers = $fetch.rows?.map(user => { enrichedUsers = $fetch.rows?.map(user => {
let userGroups = [] let userGroups = []
@ -112,8 +114,7 @@
groups: userData.groups, groups: userData.groups,
})) }))
try { try {
const res = await users.invite(payload) inviteUsersResponse = await users.invite(payload)
notifications.success(res.message)
inviteConfirmationModal.show() inviteConfirmationModal.show()
} catch (error) { } catch (error) {
notifications.error("Error inviting user") notifications.error("Error inviting user")
@ -273,16 +274,7 @@
</Modal> </Modal>
<Modal bind:this={inviteConfirmationModal}> <Modal bind:this={inviteConfirmationModal}>
<ModalContent <InvitedModal {inviteUsersResponse} />
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>
</Modal> </Modal>
<Modal bind:this={onboardingTypeModal}> <Modal bind:this={onboardingTypeModal}>