From 5a4d8dafb9e9ed4d7390ad0aee1af973e99ca527 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 1 Sep 2022 07:58:05 +0100 Subject: [PATCH 1/3] Apply validation to invite users by email + results modal --- .../builder/portal/manage/users/index.svelte | 18 +++++------------- packages/types/src/api/web/user.ts | 5 +++++ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/index.svelte b/packages/builder/src/pages/builder/portal/manage/users/index.svelte index 24954e025a..c5e0353b10 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/index.svelte @@ -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 @@ - - - Your users should now recieve an email invite to get access to their - Budibase account - - + diff --git a/packages/types/src/api/web/user.ts b/packages/types/src/api/web/user.ts index 0ebe4ccce8..e49e520def 100644 --- a/packages/types/src/api/web/user.ts +++ b/packages/types/src/api/web/user.ts @@ -57,3 +57,8 @@ export interface CreateAdminUserRequest { password: string tenantId: string } + +export interface InviteUserRequest { + email: string + userInfo: any +} From 464c3abe9b3d951e0955a16ada4f98d94d4662d0 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 2 Dec 2022 11:52:09 +0000 Subject: [PATCH 2/3] Remove duplicate interface --- packages/types/src/api/web/user.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/types/src/api/web/user.ts b/packages/types/src/api/web/user.ts index e49e520def..0ebe4ccce8 100644 --- a/packages/types/src/api/web/user.ts +++ b/packages/types/src/api/web/user.ts @@ -57,8 +57,3 @@ export interface CreateAdminUserRequest { password: string tenantId: string } - -export interface InviteUserRequest { - email: string - userInfo: any -} From abf5585666b4c8d83c60cb37c79b5b1e17c81497 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 2 Dec 2022 12:26:20 +0000 Subject: [PATCH 3/3] Set size to match password modal --- .../portal/manage/users/_components/InvitedModal.svelte | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/InvitedModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/InvitedModal.svelte index 9cc66a1385..c9eadd0a5a 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/InvitedModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/InvitedModal.svelte @@ -50,7 +50,7 @@ } - + {#if hasSuccess} Your users should now receive an email invite to get access to their @@ -70,6 +70,3 @@ /> {/if} - -