From 641828298f63aef718ea3cfa8dc86db258d1b1ef Mon Sep 17 00:00:00 2001 From: Brewhouse Digital <66521220+brewhousedigital@users.noreply.github.com> Date: Fri, 8 Dec 2023 16:54:53 -0600 Subject: [PATCH] Dashboard - Database Refactor + AlertBar Component (#341) * Dashboard - Refactor + AlertBar Addition * Removed unused imports and fixed typos * Linter * Added additional comments for better clarity * Ran linter again...? * Updated ErrorMessage to AlertBar --- frontends/dashboard/README.md | 2 +- frontends/dashboard/src/app.html | 1 + .../dashboard/src/components/AlertBar.svelte | 73 ++++++----- .../dashboard/src/components/Navbar.svelte | 13 +- .../src/components/VerifyAccountBar.svelte | 17 +-- .../login-register/LoginForm.svelte | 15 +-- .../login-register/RegisterForm.svelte | 9 +- .../src/pocketbase-client/PocketbaseClient.ts | 88 +++++++++----- .../app/instances/[instanceId]/+page.svelte | 18 +-- .../[instanceId]/Danger/RenameInstance.svelte | 6 +- .../Danger/VersionChange/VersionChange.svelte | 6 +- .../[instanceId]/Secrets/Form.svelte | 26 ++-- .../dashboard/src/routes/app/new/+page.svelte | 1 - .../src/routes/dashboard/Dashboard.svelte | 2 - .../src/routes/dashboard/InstanceList.svelte | 5 +- .../UsageChartForAllInstances.svelte | 2 +- .../dashboard/src/routes/login/+page.svelte | 6 +- .../routes/login/confirm-account/+page.svelte | 6 +- .../routes/login/password-reset/+page.svelte | 22 ++-- .../login/password-reset/confirm/+page.svelte | 42 ++++--- .../dashboard/src/routes/signup/+page.svelte | 9 +- frontends/dashboard/src/util/database.ts | 114 ++---------------- 22 files changed, 211 insertions(+), 272 deletions(-) diff --git a/frontends/dashboard/README.md b/frontends/dashboard/README.md index 54bda06c..70519ad8 100644 --- a/frontends/dashboard/README.md +++ b/frontends/dashboard/README.md @@ -20,7 +20,7 @@ This app uses [Svelte Stores](https://svelte.dev/docs#run-time-svelte-store) to ### Derived User Values -There are additional derived values that are useful for showing and hiding components across the site. The first one is `isUserLoggedIn`. This one will return a true or false depending on the state of the logged in user. It is dependent on the `email` property in the Pocketbase response. +There are additional derived values that are useful for showing and hiding components across the site. The first one is `isUserLoggedIn`. This one will return a true or false depending on the state of the logged-in user. It is dependent on the `email` property in the Pocketbase response. The second derived value is `isUserVerified`. This will return a true or false boolean depending on if their Pocketbase account has been verified via the email they got when they initially registered. diff --git a/frontends/dashboard/src/app.html b/frontends/dashboard/src/app.html index fde01bc2..f44d6af5 100644 --- a/frontends/dashboard/src/app.html +++ b/frontends/dashboard/src/app.html @@ -1,4 +1,5 @@ +
diff --git a/frontends/dashboard/src/components/AlertBar.svelte b/frontends/dashboard/src/components/AlertBar.svelte index ada2c940..86dad46a 100644 --- a/frontends/dashboard/src/components/AlertBar.svelte +++ b/frontends/dashboard/src/components/AlertBar.svelte @@ -1,36 +1,51 @@ -{title}
{/if} - - {#if text} - {text} - {:else} -