Customize signup flow BB changes (#11706)

* wip

* wip

* wip

* wip
This commit is contained in:
Gerard Burns 2023-09-12 12:16:13 +01:00 committed by GitHub
parent 8ecc9c2d53
commit 4560510069
6 changed files with 44 additions and 3 deletions

View File

@ -66,6 +66,10 @@
pointer-events: all;
width: 100%;
}
.spectrum-Toast--neutral {
background-color: var(--grey-2);
}
.spectrum-Button {
border: 1px solid rgba(255, 255, 255, 0.2);
}

View File

@ -27,7 +27,11 @@
<div class="spectrum-Toast-body" class:actionBody={!!action}>
<div class="wrap spectrum-Toast-content">{message || ""}</div>
{#if action}
<ActionButton quiet emphasized on:click={action}>
<ActionButton
quiet
emphasized
on:click={() => action(() => dispatch("dismiss"))}
>
<div style="color: white; font-weight: 600;">{actionMessage}</div>
</ActionButton>
{/if}

View File

@ -8,7 +8,7 @@
<Portal target=".modal-container">
<div class="notifications">
{#each $notifications as { type, icon, message, id, dismissable, action, wide } (id)}
{#each $notifications as { type, icon, message, id, dismissable, action, actionMessage, wide } (id)}
<div transition:fly={{ y: 30 }}>
<Notification
{type}
@ -16,6 +16,7 @@
{message}
{dismissable}
{action}
{actionMessage}
{wide}
on:dismiss={() => notifications.dismiss(id)}
/>

View File

@ -1,6 +1,7 @@
import { writable } from "svelte/store"
export const BANNER_TYPES = {
NEUTRAL: "neutral",
INFO: "info",
NEGATIVE: "negative",
WARNING: "warning",

View File

@ -27,7 +27,9 @@ export const createNotificationStore = () => {
icon = "",
autoDismiss = true,
action = null,
actionMessage = null,
wide = false,
dismissTimeout = NOTIFICATION_TIMEOUT,
}
) => {
if (block) {
@ -44,14 +46,16 @@ export const createNotificationStore = () => {
icon,
dismissable: !autoDismiss,
action,
actionMessage,
wide,
dismissTimeout,
},
]
})
if (autoDismiss) {
const timeoutId = setTimeout(() => {
dismissNotification(_id)
}, NOTIFICATION_TIMEOUT)
}, dismissTimeout)
timeoutIds.add(timeoutId)
}
}

View File

@ -3,6 +3,7 @@
import { admin, auth, licensing } from "stores/portal"
import { onMount } from "svelte"
import { CookieUtils, Constants } from "@budibase/frontend-core"
import { banner, BANNER_TYPES } from "@budibase/bbui"
import { API } from "api"
import Branding from "./Branding.svelte"
@ -16,6 +17,32 @@
$: user = $auth.user
$: useAccountPortal = cloud && !$admin.disableAccountPortal
let showVerificationPrompt = false
const checkVerification = user => {
if (!showVerificationPrompt && user?.account?.verified === false) {
showVerificationPrompt = true
banner.queue([
{
message: `Please verify your account. We've sent the verification link to ${user.email}`,
type: BANNER_TYPES.NEUTRAL,
showCloseButton: false,
extraButtonAction: () => {
fetch(`${$admin.accountPortalUrl}/api/auth/reset`, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email: user.email }),
})
},
extraButtonText: "Resend email",
},
])
}
}
$: checkVerification(user)
const validateTenantId = async () => {
const host = window.location.host