From 6e858d2bbd3c9caa215340ec343fbbadcc4dd611 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 18 May 2021 15:08:57 +0100 Subject: [PATCH] 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;