From d89c7507611365b11944c31804d06dd9376ca2c1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 24 May 2021 18:45:43 +0100 Subject: [PATCH] Updating system to allow setting builder/admin as a toggle during the invitation phase of a user. --- .../users/_components/AddUserModal.svelte | 25 +++++++++++-- .../_components/BasicOnboardingModal.svelte | 32 +++++++++++++++-- packages/builder/src/stores/portal/users.js | 35 ++++++++++++++----- .../worker/src/api/controllers/admin/users.js | 7 ++-- packages/worker/src/api/routes/admin/users.js | 1 + packages/worker/src/index.js | 9 ++++- packages/worker/src/utilities/email.js | 9 ++--- packages/worker/src/utilities/redis.js | 33 +++++++++++++---- 8 files changed, 124 insertions(+), 27 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte index b60f15d976..9504f73b68 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/AddUserModal.svelte @@ -5,6 +5,8 @@ Select, ModalContent, notifications, + Toggle, + Label, } from "@budibase/bbui" import { createValidationStore, emailValidator } from "helpers/validation" import { users } from "stores/portal" @@ -13,12 +15,12 @@ const options = ["Email onboarding", "Basic onboarding"] let selected = options[0] + let builder, admin const [email, error, touched] = createValidationStore("", emailValidator) async function createUserFlow() { - const res = await users.invite($email) - console.log(res) + const res = await users.invite({ email: $email, builder, admin }) if (res.status) { notifications.error(res.message) } else { @@ -56,4 +58,23 @@ placeholder="john@doe.com" label="Email" /> +
+
+ + +
+
+ + +
+
+ + diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/BasicOnboardingModal.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/BasicOnboardingModal.svelte index 74a696191a..8ecb274585 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/BasicOnboardingModal.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/BasicOnboardingModal.svelte @@ -1,13 +1,22 @@