From 6e858d2bbd3c9caa215340ec343fbbadcc4dd611 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 18 May 2021 15:08:57 +0100 Subject: [PATCH 01/16] Adding repeat password entry component. --- .../common/users/PasswordRepeatInput.svelte | 39 +++++++++++++++++ .../src/pages/builder/invite/index.svelte | 42 ++++--------------- 2 files changed, 46 insertions(+), 35 deletions(-) create mode 100644 packages/builder/src/components/common/users/PasswordRepeatInput.svelte diff --git a/packages/builder/src/components/common/users/PasswordRepeatInput.svelte b/packages/builder/src/components/common/users/PasswordRepeatInput.svelte new file mode 100644 index 0000000000..98128ebd94 --- /dev/null +++ b/packages/builder/src/components/common/users/PasswordRepeatInput.svelte @@ -0,0 +1,39 @@ + + + + + + \ No newline at end of file diff --git a/packages/builder/src/pages/builder/invite/index.svelte b/packages/builder/src/pages/builder/invite/index.svelte index 85316dc008..c6a0f3fa04 100644 --- a/packages/builder/src/pages/builder/invite/index.svelte +++ b/packages/builder/src/pages/builder/invite/index.svelte @@ -3,27 +3,19 @@ Layout, Heading, Body, - Input, Button, notifications, } from "@budibase/bbui" import { goto, params } from "@roxi/routify" - import { createValidationStore, requiredValidator } from "helpers/validation" + import PasswordRepeatInput from "components/common/users/PasswordRepeatInput.svelte" import { users } from "stores/portal" - const [password, passwordError, passwordTouched] = createValidationStore( - "", - requiredValidator - ) - const [repeat, _, repeatTouched] = createValidationStore( - "", - requiredValidator - ) const inviteCode = $params["?code"] + let password, error async function acceptInvite() { try { - const res = await users.acceptInvite(inviteCode, $password) + const res = await users.acceptInvite(inviteCode, password) if (!res) { throw new Error(res.message) } @@ -40,31 +32,14 @@ -
- - Accept Invitation - Please enter a password to setup your user. - -
- - + Accept Invitation + Please enter a password to setup your user. + @@ -87,9 +62,6 @@ justify-content: flex-start; align-items: stretch; } - .center { - text-align: center; - } img { width: 40px; margin: 0 auto; From 46d572a8fcdd4958bc9e6c12d9cb5506040a90fb Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 18 May 2021 15:09:04 +0100 Subject: [PATCH 02/16] Formatting. --- packages/bbui/src/Typography/Heading.svelte | 8 +++-- .../common/users/PasswordRepeatInput.svelte | 36 ++++++++++--------- .../src/components/login/ForgotForm.svelte | 17 ++++----- .../src/components/login/GoogleButton.svelte | 1 - .../src/components/login/LoginForm.svelte | 11 ++++-- .../src/components/login/ResetForm.svelte | 16 +++------ .../src/pages/builder/invite/index.svelte | 17 +++------ 7 files changed, 50 insertions(+), 56 deletions(-) diff --git a/packages/bbui/src/Typography/Heading.svelte b/packages/bbui/src/Typography/Heading.svelte index 4d0814a22d..00951752af 100644 --- a/packages/bbui/src/Typography/Heading.svelte +++ b/packages/bbui/src/Typography/Heading.svelte @@ -7,8 +7,10 @@ export let noPadding = false -

+

diff --git a/packages/builder/src/components/common/users/PasswordRepeatInput.svelte b/packages/builder/src/components/common/users/PasswordRepeatInput.svelte index 98128ebd94..f1cb6bb829 100644 --- a/packages/builder/src/components/common/users/PasswordRepeatInput.svelte +++ b/packages/builder/src/components/common/users/PasswordRepeatInput.svelte @@ -1,9 +1,9 @@ - \ No newline at end of file +
diff --git a/packages/builder/src/components/login/ForgotForm.svelte b/packages/builder/src/components/login/ForgotForm.svelte index e95660bb63..df76f72c2d 100644 --- a/packages/builder/src/components/login/ForgotForm.svelte +++ b/packages/builder/src/components/login/ForgotForm.svelte @@ -1,18 +1,10 @@
@@ -23,7 +15,10 @@ Forgotten your password? - No problem! Just enter your account's email address and we'll send you a link to reset it. + No problem! Just enter your account's email address and we'll send + you a link to reset it. diff --git a/packages/builder/src/components/login/GoogleButton.svelte b/packages/builder/src/components/login/GoogleButton.svelte index 9f154df059..13f3652050 100644 --- a/packages/builder/src/components/login/GoogleButton.svelte +++ b/packages/builder/src/components/login/GoogleButton.svelte @@ -12,7 +12,6 @@
- From 9575020b1e165e04aa40f5e6d6c19bb22dbcf3d3 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 19 May 2021 10:25:23 +0100 Subject: [PATCH 10/16] Add first name and last name to user schema and add modal to update names --- .../_components/UpdateUserInfoModal.svelte | 40 +++++++++++++++++++ .../src/pages/builder/apps/index.svelte | 23 ++++++++--- 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 packages/builder/src/pages/builder/apps/_components/UpdateUserInfoModal.svelte diff --git a/packages/builder/src/pages/builder/apps/_components/UpdateUserInfoModal.svelte b/packages/builder/src/pages/builder/apps/_components/UpdateUserInfoModal.svelte new file mode 100644 index 0000000000..e54c3c719f --- /dev/null +++ b/packages/builder/src/pages/builder/apps/_components/UpdateUserInfoModal.svelte @@ -0,0 +1,40 @@ + + + + + Personalise the platform by adding your first name and last name. + + + + diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte index 3b383bc1ba..7d9c8b93b4 100644 --- a/packages/builder/src/pages/builder/apps/index.svelte +++ b/packages/builder/src/pages/builder/apps/index.svelte @@ -10,6 +10,7 @@ Page, Icon, Body, + Modal, } from "@budibase/bbui" import { onMount } from "svelte" import { apps, organisation } from "stores/portal" @@ -17,8 +18,11 @@ import { goto } from "@roxi/routify" import { AppStatus } from "constants" import { gradient } from "actions" + import UpdateUserInfoModal from "./_components/UpdateUserInfoModal.svelte" let loaded = false + let userInfoModal + let userPasswordModal onMount(async () => { await organisation.init() @@ -35,8 +39,10 @@
- Hey {$auth.user.email} - + + Hey {$auth.user.firstName || $auth.user.email} + + Welcome to the {$organisation.company} portal. Below you'll find the list of apps that you have access to, as well as company news and the employee handbook. @@ -47,7 +53,9 @@
- Update user information + userInfoModal.show()}> + Update user information + Update password
- GROUP + GROUP {#if $auth.user?.builder?.global} {/if} @@ -76,7 +84,7 @@
{app.name} - + Edited {Math.round(Math.random() * 10 + 1)} months ago
@@ -89,6 +97,9 @@
+ + + {/if} From c62b002182c5d7dab67ea1c89388727602772efb Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 19 May 2021 10:36:39 +0100 Subject: [PATCH 11/16] Update Layout to be position relative --- packages/bbui/src/Layout/Layout.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/bbui/src/Layout/Layout.svelte b/packages/bbui/src/Layout/Layout.svelte index 504db41133..86fd844ca1 100644 --- a/packages/bbui/src/Layout/Layout.svelte +++ b/packages/bbui/src/Layout/Layout.svelte @@ -22,6 +22,7 @@ .container { display: grid; grid-template-columns: 1fr; + position: relative; } .paddingX-S { padding-left: var(--spacing-s); From 1e595cb45254990010adf4e03f795698e8a06059 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 19 May 2021 10:39:23 +0100 Subject: [PATCH 12/16] Fix spacing in manage user page and add first name and last name fields --- .../portal/manage/users/[userId].svelte | 84 ++++++++----------- 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte index 0364f28279..a8d9a7c712 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -56,44 +56,50 @@ } - -
- $goto("./")} - quiet - size="S" - icon="BackAndroid" - > - Back to users - -
-
- - User: {$roleFetch?.data?.email} - - Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis porro - ut nesciunt ipsam perspiciatis aliquam et hic minus alias beatae. Odit - veritatis quos quas laborum magnam tenetur perspiciatis ex hic. - - -
+ + +
+ $goto("./")} + quiet + size="S" + icon="BackAndroid" + > + Back to users + +
+ User: {$roleFetch?.data?.email} + + Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis porro ut + nesciunt ipsam perspiciatis aliquam et hic minus alias beatae. Odit + veritatis quos quas laborum magnam tenetur perspiciatis ex hic. + +
-
+ General
+
+ + +
+
+ + +
Regenerate password
-
+
-
+ Configure roles - + -
- - Delete user - Deleting a user completely removes them from your account. -
- -
-
+ + Delete user + Deleting a user completely removes them from your account. + +
+
@@ -143,26 +147,12 @@ .fields { display: grid; grid-gap: var(--spacing-m); - margin-top: var(--spacing-xl); } .field { display: grid; grid-template-columns: 32% 1fr; align-items: center; } - .heading { - margin-bottom: var(--spacing-xl); - } - .general { - position: relative; - margin: var(--spacing-xl) 0; - } - .roles { - margin: var(--spacing-xl) 0; - } - .delete { - margin-top: var(--spacing-xl); - } .regenerate { position: absolute; top: 0; From 10c8c569f836f818f03bfde3c0969ed5c31ee73f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 19 May 2021 10:40:05 +0100 Subject: [PATCH 13/16] Add user first name and last name to backend table UI --- .../src/components/backend/DataTable/Table.svelte | 2 ++ .../backend/DataTable/modals/CreateEditUser.svelte | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 6555197cb2..40a5d1dbac 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -47,6 +47,8 @@ }) schema.email.displayName = "Email" schema.roleId.displayName = "Role" + schema.firstName.displayName = "First Name" + schema.lastName.displayName = "Last Name" if (schema.status) { schema.status.displayName = "Status" } diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte index 11210db49f..bf1030dc2c 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditUser.svelte @@ -32,6 +32,8 @@ delete customSchema["email"] delete customSchema["roleId"] delete customSchema["status"] + delete customSchema["firstName"] + delete customSchema["lastName"] return Object.entries(customSchema) } @@ -87,6 +89,14 @@ meta={{ name: "password", type: "password" }} bind:value={row.password} /> + + -
- {/each} - - - - - {/if} - - - diff --git a/packages/builder/src/pages/builder/portal/oauth/_logos/Google.svelte b/packages/builder/src/pages/builder/portal/oauth/_logos/Google.svelte deleted file mode 100644 index 5686e50abc..0000000000 --- a/packages/builder/src/pages/builder/portal/oauth/_logos/Google.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/builder/src/pages/builder/portal/oauth/index.svelte b/packages/builder/src/pages/builder/portal/oauth/index.svelte deleted file mode 100644 index f8d9b43dec..0000000000 --- a/packages/builder/src/pages/builder/portal/oauth/index.svelte +++ /dev/null @@ -1,114 +0,0 @@ - - - - -
- OAuth - - Every budibase app comes with basic authentication (email/password) - included. You can add additional authentication methods from the options - below. - -
- - {#if google} -
- - - - Google - - - - To allow users to authenticate using their Google accounts, fill out - the fields below. - -
- - {#each ConfigFields.Google as field} -
- - -
- {/each} -
- -
- - {/if} -
-
- - diff --git a/packages/server/src/constants/index.js b/packages/server/src/constants/index.js index e4a65a94f6..7d80f67a1c 100644 --- a/packages/server/src/constants/index.js +++ b/packages/server/src/constants/index.js @@ -50,6 +50,24 @@ exports.USERS_TABLE_SCHEMA = { fieldName: "email", name: "email", }, + firstName: { + name: "firstName", + fieldName: "firstName", + type: exports.FieldTypes.STRING, + constraints: { + type: exports.FieldTypes.STRING, + presence: false, + }, + }, + lastName: { + name: "lastName", + fieldName: "lastName", + type: exports.FieldTypes.STRING, + constraints: { + type: exports.FieldTypes.STRING, + presence: false, + }, + }, roleId: { fieldName: "roleId", name: "roleId", From 664ee94433c38eac0a3e2fcad1c389c588a7b920 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 19 May 2021 11:07:14 +0100 Subject: [PATCH 16/16] Fix spacing and make consistent in all portal pages --- .../src/components/login/LoginForm.svelte | 4 +- .../src/components/start/AppCard.svelte | 2 +- .../src/pages/builder/admin/index.svelte | 2 +- .../src/pages/builder/invite/index.svelte | 2 +- .../builder/portal/manage/auth/index.svelte | 60 +++++----- .../email/_components/TemplateBindings.svelte | 2 +- .../builder/portal/manage/email/index.svelte | 82 ++++++------- .../users/_components/AddUserModal.svelte | 10 +- .../_components/BasicOnboardingModal.svelte | 8 +- .../users/_components/UpdateRolesModal.svelte | 2 +- .../builder/portal/manage/users/index.svelte | 48 ++++---- .../builder/portal/settings/general.svelte | 110 ++++++++---------- 12 files changed, 151 insertions(+), 181 deletions(-) diff --git a/packages/builder/src/components/login/LoginForm.svelte b/packages/builder/src/components/login/LoginForm.svelte index bc32c74689..36b1764241 100644 --- a/packages/builder/src/components/login/LoginForm.svelte +++ b/packages/builder/src/components/login/LoginForm.svelte @@ -40,8 +40,8 @@ Sign in to Budibase + - Sign in with email - + $goto("./forgot")}> Forgot password? diff --git a/packages/builder/src/components/start/AppCard.svelte b/packages/builder/src/components/start/AppCard.svelte index 1d444b2afb..2aa5e6650d 100644 --- a/packages/builder/src/components/start/AppCard.svelte +++ b/packages/builder/src/components/start/AppCard.svelte @@ -48,7 +48,7 @@
- + Edited {Math.floor(1 + Math.random() * 10)} months ago {#if app.lockedBy} diff --git a/packages/builder/src/pages/builder/admin/index.svelte b/packages/builder/src/pages/builder/admin/index.svelte index 1b3be282ab..77a1b43c57 100644 --- a/packages/builder/src/pages/builder/admin/index.svelte +++ b/packages/builder/src/pages/builder/admin/index.svelte @@ -36,7 +36,7 @@ Create an admin user - + The admin user has access to everything in Budibase. diff --git a/packages/builder/src/pages/builder/invite/index.svelte b/packages/builder/src/pages/builder/invite/index.svelte index 8758c669a8..65b20f8a9d 100644 --- a/packages/builder/src/pages/builder/invite/index.svelte +++ b/packages/builder/src/pages/builder/invite/index.svelte @@ -27,7 +27,7 @@ Accept Invitation - + Please enter a password to set up your user. diff --git a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte index af05e0e92c..9718e14681 100644 --- a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte @@ -59,44 +59,42 @@ }) - - -
- OAuth - - Every budibase app comes with basic authentication (email/password) - included. You can add additional authentication methods from the options - below. - -
+ + + OAuth + + Every budibase app comes with basic authentication (email/password) + included. You can add additional authentication methods from the options + below. + + + {#if google} - {#if google} -
- - - - Google - - - - To allow users to authenticate using their Google accounts, fill out - the fields below. - -
- + + + + + Google + + + + To allow users to authenticate using their Google accounts, fill out the + fields below. + + + {#each ConfigFields.Google as field}
{/each} -
- -
- - {/if} -
-
+ +
+ +
+ {/if} + 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 8646da9c06..b60f15d976 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 @@ -30,18 +30,18 @@ - If you have SMTP configured and an email for the new user, you can use the + + If you have SMTP configured and an email for the new user, you can use the automated email onboarding flow. Otherwise, use our basic onboarding process - with autogenerated passwords. + with autogenerated passwords. + - + Update {user.email}'s role for {app.name}.
$goto(`./${detail._id}`)} {schema} @@ -75,31 +74,28 @@ allowSelectRows={false} customRenderers={[{ column: "group", component: TagsRenderer }]} /> - + - + + + diff --git a/packages/builder/src/pages/builder/portal/settings/general.svelte b/packages/builder/src/pages/builder/portal/settings/general.svelte index 8ee249fae5..cd5709d493 100644 --- a/packages/builder/src/pages/builder/portal/settings/general.svelte +++ b/packages/builder/src/pages/builder/portal/settings/general.svelte @@ -57,78 +57,76 @@ } -
- -
- General - - General is the place where you edit your organisation name, logo. You - can also configure your platform URL as well as turn on or off - analytics. - + + + General + + General is the place where you edit your organisation name, logo. You can + also configure your platform URL as well as turn on or off analytics. + + + + + Information + Here you can update your logo and organization name. + +
+
+ +
- -
- Information - Here you can update your logo and organization name. -
-
- - -
- + - -
- Platform - Here you can set up general platform settings. -
-
- - -
-
+
+ + + Platform + Here you can set up general platform settings. + +
+
+ +
- -
+
+ + + Analytics - + If you would like to send analytics that help us make Budibase better, please let us know below. -
-
- - -
+ +
+
+ +
-
- -
-
+
+ +
+