diff --git a/lerna.json b/lerna.json index 9efea1029b..b74beefaa1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.207-alpha.5", + "version": "1.0.207-alpha.6", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 015815c30e..7d9348ddd4 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.207-alpha.5", + "version": "1.0.207-alpha.6", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.0.207-alpha.5", + "@budibase/types": "^1.0.207-alpha.6", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6e3886bec2..17592216d7 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.207-alpha.5", + "version": "1.0.207-alpha.6", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.207-alpha.5", + "@budibase/string-templates": "^1.0.207-alpha.6", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 03d6bb969e..89a383d00e 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.207-alpha.5", + "version": "1.0.207-alpha.6", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.207-alpha.5", - "@budibase/client": "^1.0.207-alpha.5", - "@budibase/frontend-core": "^1.0.207-alpha.5", - "@budibase/string-templates": "^1.0.207-alpha.5", + "@budibase/bbui": "^1.0.207-alpha.6", + "@budibase/client": "^1.0.207-alpha.6", + "@budibase/frontend-core": "^1.0.207-alpha.6", + "@budibase/string-templates": "^1.0.207-alpha.6", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", 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 d57603b338..5583a48b7d 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 @@ -2,22 +2,47 @@ import { Body, Input, - Select, + Label, ModalContent, notifications, + Select, Toggle, - Label, } from "@budibase/bbui" import { createValidationStore, emailValidator } from "helpers/validation" import { users } from "stores/portal" - export let disabled - + const password = Math.random().toString(36).substring(2, 22) const options = ["Email onboarding", "Basic onboarding"] - let selected = options[0] - let builder, admin - const [email, error, touched] = createValidationStore("", emailValidator) + let disabled + let builder + let admin + let selected = "Email onboarding" + + $: basic = selected === "Basic onboarding" + + function addUser() { + if (basic) { + createUser() + } else { + createUserFlow() + } + } + + async function createUser() { + try { + await users.create({ + email: $email, + password, + builder, + admin, + forceResetPassword: true, + }) + notifications.success("Successfully created user") + } catch (error) { + notifications.error("Error creating user") + } + } async function createUserFlow() { try { @@ -30,7 +55,7 @@ + + + {#if basic} + + {/if} +
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 deleted file mode 100644 index c9d4798696..0000000000 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/BasicOnboardingModal.svelte +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Below you will find the user’s username and password. The password will not - be accessible from this point. Please save the credentials. - - - -
-
- - -
-
- - -
-
-
- - 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 bfbe520b2f..1d9c245480 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/index.svelte @@ -15,7 +15,6 @@ } from "@budibase/bbui" import TagsRenderer from "./_components/TagsTableRenderer.svelte" import AddUserModal from "./_components/AddUserModal.svelte" - import BasicOnboardingModal from "./_components/BasicOnboardingModal.svelte" import { users } from "stores/portal" import { onMount } from "svelte" @@ -30,7 +29,6 @@ } let search - let email $: filteredUsers = $users .filter(user => user.email.includes(search || "")) .map(user => ({ @@ -41,12 +39,6 @@ })) let createUserModal - let basicOnboardingModal - - function openBasicOnboardingModal() { - createUserModal.hide() - basicOnboardingModal.show() - } onMount(async () => { try { @@ -93,9 +85,8 @@ - + -