From a8219611cbebbd27501d9f30c804979048b98107 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Tue, 13 Dec 2022 14:48:11 +0100 Subject: feat: A whole slew of things - Use a md5 hash of the session cookie value as key for session validity check - Introduce global state - Introduce a common interface for form logic, and implement it on the sign-in form - Introduce static resolve() on all services instead of new-upping all over. - Implement /portal on the frontend to support giving the frontend a inital context from server or anywhere. - Show a notification when users sign in for the first time after validating their email --- code/app/src/routes/(main)/(app)/+layout.svelte | 27 +++- .../src/routes/(main)/(app)/projects/+page.svelte | 171 +++++++++------------ 2 files changed, 97 insertions(+), 101 deletions(-) (limited to 'code/app/src/routes/(main)/(app)') diff --git a/code/app/src/routes/(main)/(app)/+layout.svelte b/code/app/src/routes/(main)/(app)/+layout.svelte index e57bc3b..936e0a7 100644 --- a/code/app/src/routes/(main)/(app)/+layout.svelte +++ b/code/app/src/routes/(main)/(app)/+layout.svelte @@ -22,12 +22,13 @@ TransitionRoot, } from "@rgossiaux/svelte-headlessui"; import { DialogPanel } from "@developermuch/dev-svelte-headlessui"; - import { Input } from "$components"; + import { Input, Notification } from "$components"; import { goto } from "$app/navigation"; import { page } from "$app/stores"; + import { onMount } from "svelte"; + import { fgs, sgs } from "$help/global-state"; - const accountService = new AccountService(); - + const accountService = AccountService.resolve(); const session = { profile: { username: "Brukernavn", @@ -37,6 +38,12 @@ let sidebarOpen = false; let sidebarSearchValue: string | undefined; + let showEmailValidatedNotif = false; + + onMount(() => { + showEmailValidatedNotif = fgs("showEmailValidatedAlertWhenLoggedIn") === "true"; + if (showEmailValidatedNotif) sgs("showEmailValidatedAlertWhenLoggedIn", false); + }); function sign_out() { accountService.end_session(() => goto("/sign-in")); @@ -71,6 +78,20 @@ ]; +{#if showEmailValidatedNotif} + + + +{/if} +
diff --git a/code/app/src/routes/(main)/(app)/projects/+page.svelte b/code/app/src/routes/(main)/(app)/projects/+page.svelte index 1508118..2585331 100644 --- a/code/app/src/routes/(main)/(app)/projects/+page.svelte +++ b/code/app/src/routes/(main)/(app)/projects/+page.svelte @@ -1,41 +1,14 @@
@@ -66,78 +39,80 @@

A list of all the projects in your organsation.

- -
- {#each $headerRows as headerRow (headerRow.id)} - - - {#each headerRow.cells as cell (cell.id)} - - + {#each headerRow.cells as cell (cell.id)} + + - - {/each} - - - {/each} + > + {#if props.sort.order === "asc"} + + {:else if props.sort.order === "desc"} + + {:else if !props.sort.disabled} + + {/if} + + {#if cell.id === "status"} + + {/if} + + + + {/each} + + + {/each} - {#each $rows as row (row.id)} - - - {#each row.cells as cell (cell.id)} - {@const materialisedCell = cell.render()} - - - - {/each} - - - {/each} + {#each $rows as row (row.id)} + + + {#each row.cells as cell (cell.id)} + {@const materialisedCell = cell.render()} + + + + {/each} + + + {/each}
+
-
- - +
+ + - {#if props.sort.order === "asc"} - - {:else if props.sort.order === "desc"} - - {:else if !props.sort.disabled} - - {/if} - - {#if cell.id === "status"} - - {/if} -
-
- {#if cell.id === "name"} - - - - {:else if cell.id === "status"} - - {:else} - - {/if} -
+ {#if cell.id === "name"} + + + + {:else if cell.id === "status"} + + {:else} + + {/if} +
-- cgit v1.3