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