diff --git a/project.inlang/messages/de.json b/project.inlang/messages/de.json index a347a43..607d22a 100644 --- a/project.inlang/messages/de.json +++ b/project.inlang/messages/de.json @@ -348,10 +348,18 @@ }, "onboarding": { "title": "Mach' Dich bereit für Termine", + "description": "Für das beste Ergebnis folge dieser Anleitung Schritt für Schritt:", "notification": { - "title": "Einrichtung noch nicht abgeschlossen", - "description": "Nächste Schritte anzeigen", - "action": "Weiter" + "ongoing": { + "title": "Einrichtung noch nicht abgeschlossen", + "description": "Nächste Schritte anzeigen", + "action": "Weiter" + }, + "done": { + "title": "Einrichtung abgeschlossen!", + "description": "Sie können jetzt Termine entgegennehmen", + "action": "Startseite öffnen" + } }, "sections": { "settings": { diff --git a/project.inlang/messages/en.json b/project.inlang/messages/en.json index 9005c0d..1ee42a7 100644 --- a/project.inlang/messages/en.json +++ b/project.inlang/messages/en.json @@ -356,10 +356,18 @@ }, "onboarding": { "title": "Get ready to collect appointments", + "description": "Follow this step-by-step to get the best results:", "notification": { - "title": "Onboarding not complete", - "description": "Review next steps", - "action": "Proceed" + "ongoing": { + "title": "Onboarding not complete", + "description": "Review next steps", + "action": "Proceed" + }, + "done": { + "title": "Onboarding complete!", + "description": "You can now collect appointments", + "action": "Open Homepage" + } }, "sections": { "settings": { diff --git a/src/app.css b/src/app.css index e4cbc5d..0fdda1e 100644 --- a/src/app.css +++ b/src/app.css @@ -36,11 +36,11 @@ --sidebar-ring: oklch(0.704 0.04 256.788); /* custom colors */ - --lighter: oklch(77.983% 0.03673 254.95); - --light: oklch(69.121% 0.03859 257.443); - --medium: oklch(62.379% 0.01913 256.381); - --dark: oklch(43.309% 0.00977 254.027); - --darker: oklch(27.232% 0.00797 264.468); + --lighter: oklch(74.262% 0.05601 254.57); + --light: oklch(65.382% 0.05802 257.123); + --medium: oklch(57.414% 0.04099 256.06); + --dark: oklch(40.615% 0.0213 256.41); + --darker: oklch(26.345% 0.01439 261.705); } .dark { @@ -69,7 +69,7 @@ --chart-5: oklch(0.645 0.246 16.439); --sidebar: oklch(0.208 0.042 265.755); --sidebar-foreground: oklch(0.984 0.003 247.858); - --sidebar-primary: oklch(0.488 0.243 264.376); + --sidebar-primary: oklch(27.237% 0.04051 269.508); --sidebar-primary-foreground: oklch(0.984 0.003 247.858); --sidebar-accent: oklch(0.279 0.041 260.031); --sidebar-accent-foreground: oklch(0.984 0.003 247.858); @@ -77,11 +77,11 @@ --sidebar-ring: oklch(0.551 0.027 264.364); /* custom colors */ - --lighter: oklch(27.232% 0.00797 264.468); - --light: oklch(43.309% 0.00977 254.027); - --medium: oklch(62.379% 0.01913 256.381); - --dark: oklch(69.121% 0.03859 257.443); - --darker: oklch(77.983% 0.03673 254.95); + --lighter: oklch(26.345% 0.01439 261.705); + --light: oklch(40.615% 0.0213 256.41); + --medium: oklch(57.414% 0.04099 256.06); + --dark: oklch(65.382% 0.05802 257.123); + --darker: oklch(74.262% 0.05601 254.57); } @theme { diff --git a/src/lib/components/ui/onboarding-guide/onboarding-guide.svelte b/src/lib/components/ui/onboarding-guide/onboarding-guide.svelte index 9e71f3b..1638391 100644 --- a/src/lib/components/ui/onboarding-guide/onboarding-guide.svelte +++ b/src/lib/components/ui/onboarding-guide/onboarding-guide.svelte @@ -17,14 +17,22 @@ type Props = { title: string; + description?: string; steps: Step[]; }; - let { title, steps }: Props = $props(); + let { title, description, steps }: Props = $props();
- {title} +
+ {title} + {#if description} + + {description} + + {/if} +
{#each steps as step, index (`step-${index}`)}
diff --git a/src/lib/stores/tenants.ts b/src/lib/stores/tenants.ts index 8f39cde..e58acfa 100644 --- a/src/lib/stores/tenants.ts +++ b/src/lib/stores/tenants.ts @@ -2,7 +2,7 @@ import logger from "$lib/logger"; import type { TTenant } from "$lib/types/tenant"; import { changeTenantUsingApi } from "$lib/utils/tenants"; import { toast } from "svelte-sonner"; -import { writable } from "svelte/store"; +import { get, writable } from "svelte/store"; import { auth } from "./auth"; import { m } from "$i18n/messages"; import { goto } from "$app/navigation"; @@ -74,14 +74,26 @@ const createTenantsStore = () => { const newCurrentTenant = tenants.find((t: TTenant) => t.id === newCurrentTenantId) || null; if (newCurrentTenant?.setupState !== "READY") { - toast.info(m["dashboard.onboarding.notification.title"](), { + toast.info(m["dashboard.onboarding.notification.ongoing.title"](), { duration: 4000, - description: m["dashboard.onboarding.notification.description"](), + description: m["dashboard.onboarding.notification.ongoing.description"](), action: { - label: m["dashboard.onboarding.notification.action"](), + label: m["dashboard.onboarding.notification.ongoing.action"](), onClick: () => goto(ROUTES.DASHBOARD.MAIN), }, }); + } else { + const curState = get(store); + if (curState && curState.currentTenant?.setupState !== "READY") { + toast.info(m["dashboard.onboarding.notification.done.title"](), { + duration: 4000, + description: m["dashboard.onboarding.notification.done.description"](), + action: { + label: m["dashboard.onboarding.notification.done.action"](), + onClick: () => goto(ROUTES.MAIN), + }, + }); + } } store.update((state) => { diff --git a/src/routes/(pages)/dashboard/+page.svelte b/src/routes/(pages)/dashboard/+page.svelte index 9a03cb0..0c86543 100644 --- a/src/routes/(pages)/dashboard/+page.svelte +++ b/src/routes/(pages)/dashboard/+page.svelte @@ -94,6 +94,7 @@ {#if $auth.user && ["GLOBAL_ADMIN", "TENANT_ADMIN"].includes($auth.user?.role) && tenant && tenant.setupState !== "READY"} diff --git a/src/routes/(pages)/dashboard/channels/+page.svelte b/src/routes/(pages)/dashboard/channels/+page.svelte index 827e891..9feb04a 100644 --- a/src/routes/(pages)/dashboard/channels/+page.svelte +++ b/src/routes/(pages)/dashboard/channels/+page.svelte @@ -155,6 +155,7 @@ done={() => { closeDialog("delete"); curItem = null; + tenants.reload(); invalidate(ROUTES.DASHBOARD.CHANNELS); }} /> diff --git a/src/routes/(pages)/dashboard/staff/+page.svelte b/src/routes/(pages)/dashboard/staff/+page.svelte index c59bd56..d1c78b8 100644 --- a/src/routes/(pages)/dashboard/staff/+page.svelte +++ b/src/routes/(pages)/dashboard/staff/+page.svelte @@ -146,6 +146,7 @@ done={() => { closeDialog("delete"); curItem = null; + tenants.reload(); invalidate(ROUTES.DASHBOARD.STAFF); }} />