From 61d810edfe88bcab4830f3c6c4c8b973077c2171 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 21 Jun 2021 18:01:25 +0100 Subject: [PATCH] Implementing feature #1700 and making it possible to remove logo. --- .../src/pages/builder/auth/forgot.svelte | 5 +++++ .../src/pages/builder/auth/login.svelte | 15 +++++++++++---- .../src/pages/builder/auth/reset.svelte | 9 +++++++-- .../portal/settings/organisation.svelte | 18 ++++++++++++++---- .../builder/src/stores/portal/organisation.js | 2 +- .../src/api/controllers/admin/configs.js | 12 ++++++++++++ packages/worker/src/api/index.js | 4 ++++ .../worker/src/api/routes/admin/configs.js | 3 ++- 8 files changed, 56 insertions(+), 12 deletions(-) diff --git a/packages/builder/src/pages/builder/auth/forgot.svelte b/packages/builder/src/pages/builder/auth/forgot.svelte index c4452a0f68..85301b3f02 100644 --- a/packages/builder/src/pages/builder/auth/forgot.svelte +++ b/packages/builder/src/pages/builder/auth/forgot.svelte @@ -9,6 +9,7 @@ } from "@budibase/bbui" import { organisation, auth } from "stores/portal" import Logo from "assets/bb-emblem.svg" + import { onMount } from "svelte" let email = "" @@ -20,6 +21,10 @@ notifications.error("Unable to send reset password link") } } + + onMount(async () => { + await organisation.init() + })
diff --git a/packages/builder/src/pages/builder/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte index 1669a5577b..9fb984c73e 100644 --- a/packages/builder/src/pages/builder/auth/login.svelte +++ b/packages/builder/src/pages/builder/auth/login.svelte @@ -10,13 +10,16 @@ notifications, } from "@budibase/bbui" import { goto, params } from "@roxi/routify" - import { auth } from "stores/portal" + import { auth, organisation } from "stores/portal" import GoogleButton from "./_components/GoogleButton.svelte" import Logo from "assets/bb-emblem.svg" + import { onMount } from "svelte" let username = "" let password = "" + $: company = $organisation.company || "Budibase" + async function login() { try { await auth.login({ @@ -43,6 +46,10 @@ function handleKeydown(evt) { if (evt.key === "Enter") login() } + + onMount(async () => { + await organisation.init() + }) @@ -50,8 +57,8 @@
- logo - Sign in to Budibase + logo + Sign in to {company} @@ -66,7 +73,7 @@ /> - + $goto("./forgot")}> Forgot password? diff --git a/packages/builder/src/pages/builder/auth/reset.svelte b/packages/builder/src/pages/builder/auth/reset.svelte index aed2034aff..e38a5d8b24 100644 --- a/packages/builder/src/pages/builder/auth/reset.svelte +++ b/packages/builder/src/pages/builder/auth/reset.svelte @@ -2,8 +2,9 @@ import { Body, Button, Heading, Layout, notifications } from "@budibase/bbui" import { goto, params } from "@roxi/routify" import PasswordRepeatInput from "components/common/users/PasswordRepeatInput.svelte" - import { auth } from "stores/portal" + import { auth, organisation } from "stores/portal" import Logo from "assets/bb-emblem.svg" + import { onMount } from "svelte" const resetCode = $params["?code"] let password, error @@ -28,13 +29,17 @@ notifications.error("Unable to reset password") } } + + onMount(async () => { + await organisation.init() + })