Revert changes to builder files for testing

This commit is contained in:
Andrew Kingston 2023-01-20 08:58:47 +00:00
parent 881c3307c6
commit af29aba779
2 changed files with 78 additions and 82 deletions

View File

@ -1,5 +1,5 @@
<script> <script>
import { FancyButton } from "@budibase/bbui" import { ActionButton } from "@budibase/bbui"
import GoogleLogo from "assets/google-logo.png" import GoogleLogo from "assets/google-logo.png"
import { auth, organisation } from "stores/portal" import { auth, organisation } from "stores/portal"
@ -10,12 +10,31 @@
</script> </script>
{#if show} {#if show}
<FancyButton <ActionButton
on:click={() => { on:click={() =>
window.open(`/api/global/auth/${tenantId}/google`, "_blank") window.open(`/api/global/auth/${tenantId}/google`, "_blank")}
}}
icon={GoogleLogo}
> >
Log in with Google <div class="inner">
</FancyButton> <img src={GoogleLogo} alt="google icon" />
<p>Sign in with Google</p>
</div>
</ActionButton>
{/if} {/if}
<style>
.inner {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding-top: var(--spacing-xs);
padding-bottom: var(--spacing-xs);
}
.inner img {
width: 18px;
margin: 3px 10px 3px 3px;
}
.inner p {
margin: 0;
}
</style>

View File

@ -5,12 +5,11 @@
Button, Button,
Divider, Divider,
Heading, Heading,
Input,
Layout, Layout,
notifications, notifications,
Link, Link,
} from "@budibase/bbui" } from "@budibase/bbui"
import { FancyInput, FancyForm } from "@budibase/bbui"
import { TestimonialPage } from "@budibase/frontend-core"
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
import { auth, organisation, oidc, admin } from "stores/portal" import { auth, organisation, oidc, admin } from "stores/portal"
import GoogleButton from "./_components/GoogleButton.svelte" import GoogleButton from "./_components/GoogleButton.svelte"
@ -21,16 +20,12 @@
let username = "" let username = ""
let password = "" let password = ""
let loaded = false let loaded = false
let form
$: company = $organisation.company || "Budibase" $: company = $organisation.company || "Budibase"
$: multiTenancyEnabled = $admin.multiTenancy $: multiTenancyEnabled = $admin.multiTenancy
$: cloud = $admin.cloud $: cloud = $admin.cloud
async function login() { async function login() {
if (!form.validate()) {
return
}
try { try {
await auth.login({ await auth.login({
username: username.trim(), username: username.trim(),
@ -62,51 +57,32 @@
</script> </script>
<svelte:window on:keydown={handleKeydown} /> <svelte:window on:keydown={handleKeydown} />
<div class="login">
<TestimonialPage> <div class="main">
<Layout noPadding> <Layout>
<Layout noPadding justifyItems="center"> <Layout noPadding justifyItems="center">
<img alt="logo" src={$organisation.logoUrl || Logo} /> <img alt="logo" src={$organisation.logoUrl || Logo} />
<Heading textAlign="center">Log in to {company}</Heading> <Heading textAlign="center">Sign in to {company}</Heading>
</Layout> </Layout>
{#if loaded} {#if loaded}
<GoogleButton /> <GoogleButton />
<OIDCButton oidcIcon={$oidc.logo} oidcName={$oidc.name} /> <OIDCButton oidcIcon={$oidc.logo} oidcName={$oidc.name} />
{/if} {/if}
<Divider /> <Divider noGrid />
<FancyForm bind:this={form}> <Layout gap="XS" noPadding>
<FancyInput <Body size="S" textAlign="center">Sign in with email</Body>
validate={x => !x && "Please enter your work email"} <Input label="Email" bind:value={username} />
label="Your work email" <Input
value={username}
on:change={e => (username = e.detail)}
/>
<FancyInput
disabled
label="Work email"
value={username}
on:change={e => (username = e.detail)}
/>
<FancyInput
label="Work email"
value={username}
on:change={e => (username = e.detail)}
/>
<FancyInput
validate={x => !x && "Please enter your password"}
label="Password" label="Password"
type="password" type="password"
value={password} on:change
on:change={e => (password = e.detail)} bind:value={password}
/> />
</FancyForm> </Layout>
<Layout gap="XS" noPadding justifyItems="center"> <Layout gap="XS" noPadding>
<div> <Button cta disabled={!username && !password} on:click={login}
<Button cta on:click={login}> >Sign in to {company}</Button
Log in to {company} >
</Button>
</div>
<ActionButton quiet on:click={() => $goto("./forgot")}> <ActionButton quiet on:click={() => $goto("./forgot")}>
Forgot password? Forgot password?
</ActionButton> </ActionButton>
@ -127,13 +103,14 @@
By using Budibase Cloud By using Budibase Cloud
<br /> <br />
you are agreeing to our you are agreeing to our
<Link href="https://budibase.com/eula" target="_blank"> <Link href="https://budibase.com/eula" target="_blank"
License Agreement >License Agreement</Link
</Link> >
</Body> </Body>
{/if} {/if}
</Layout> </Layout>
</TestimonialPage> </div>
</div>
<style> <style>
.login { .login {