diff --git a/apps/dashboard/src/app.html b/apps/dashboard/src/app.html
index a1ad400f..62a2b94d 100644
--- a/apps/dashboard/src/app.html
+++ b/apps/dashboard/src/app.html
@@ -9,13 +9,6 @@
-
-
%sveltekit.head%
diff --git a/apps/dashboard/src/lib/components/Navigation/app.svelte b/apps/dashboard/src/lib/components/Navigation/app.svelte
index 1fa5575a..e9f451e3 100644
--- a/apps/dashboard/src/lib/components/Navigation/app.svelte
+++ b/apps/dashboard/src/lib/components/Navigation/app.svelte
@@ -18,7 +18,7 @@
let { title = $bindable(''), navClass = '', isCoursePage = false }: Props = $props();
let coursesPath = $derived(
- $globalStore.isOrgSite ? '/lms/mylearning' : isCoursePage ? `${$currentOrgPath}/courses` : $currentOrgPath
+ $globalStore.isStudent ? '/lms/mylearning' : isCoursePage ? `${$currentOrgPath}/courses` : $currentOrgPath
);
@@ -27,13 +27,13 @@
diff --git a/apps/dashboard/src/lib/features/ui/sidebar/org-sidebar/org-switcher.svelte b/apps/dashboard/src/lib/features/ui/sidebar/org-sidebar/org-switcher.svelte
index 3ca9ebc1..97825714 100644
--- a/apps/dashboard/src/lib/features/ui/sidebar/org-sidebar/org-switcher.svelte
+++ b/apps/dashboard/src/lib/features/ui/sidebar/org-sidebar/org-switcher.svelte
@@ -29,10 +29,10 @@
function onClick(org: AccountOrg) {
if (org.id === $currentOrg.id) return;
- localStorage.setItem('classroomio_org_sitename', org.siteName);
+ localStorage.setItem('classroomio_org_sitename', org.siteName!);
currentOrg.set(org);
- setTheme(org.theme);
+ setTheme(org.theme!);
window.location.href = $currentOrgPath;
}
diff --git a/apps/dashboard/src/lib/utils/functions/appSetup.ts b/apps/dashboard/src/lib/utils/functions/appSetup.ts
index 0a116374..5f6c0d7a 100644
--- a/apps/dashboard/src/lib/utils/functions/appSetup.ts
+++ b/apps/dashboard/src/lib/utils/functions/appSetup.ts
@@ -1,7 +1,7 @@
import { PUBLIC_IS_SELFHOSTED } from '$env/static/public';
-import { dev } from '$app/environment';
import { initPosthog } from '$lib/utils/services/posthog';
import { initSentry } from '$lib/utils/services/sentry';
+import { initUmami } from '$lib/utils/services/umami';
import { licenseApi } from '$features/license/api/license.svelte';
let isInitialized = false;
@@ -11,12 +11,8 @@ export function setupAnalytics() {
isInitialized = true;
initSentry();
-
initPosthog();
-
- if (dev) {
- localStorage.setItem('umami.disabled', '1');
- }
+ initUmami();
}
/** Checks if this is cloud deployment and initializes analytics */
diff --git a/apps/dashboard/src/lib/utils/services/umami/index.ts b/apps/dashboard/src/lib/utils/services/umami/index.ts
new file mode 100644
index 00000000..fd61ec18
--- /dev/null
+++ b/apps/dashboard/src/lib/utils/services/umami/index.ts
@@ -0,0 +1,16 @@
+import { dev } from '$app/environment';
+import { licenseApi } from '$features/license/api/license.svelte';
+
+const UMAMI_WEBSITE_ID = '80a9544a-4dda-4c91-b62f-b6be7a8a3b5c';
+
+export const initUmami = (): void => {
+ if (dev || licenseApi.hasAccess('no-tracking')) return;
+
+ const script = document.createElement('script');
+ script.defer = true;
+ script.src = 'https://umami.hz.oncws.com/script.js';
+ script.dataset.websiteId = UMAMI_WEBSITE_ID;
+ const nonce = document.querySelector('script[nonce]')?.getAttribute('nonce');
+ if (nonce) script.setAttribute('nonce', nonce);
+ document.head.appendChild(script);
+};
diff --git a/apps/dashboard/src/routes/org/[slug]/+page.svelte b/apps/dashboard/src/routes/org/[slug]/+page.svelte
index c0dff9a9..1390ca10 100644
--- a/apps/dashboard/src/routes/org/[slug]/+page.svelte
+++ b/apps/dashboard/src/routes/org/[slug]/+page.svelte
@@ -80,7 +80,7 @@
{#snippet child()}
- {#each cards as card}
+ {#each cards as card, i (i)}
{/each}
@@ -94,11 +94,11 @@
{#if !topCourses}
- {#each Array(5) as _}
+ {#each Array(5) as _, i (i)}
{/each}
{:else}
- {#each topCourses as course}
+ {#each topCourses as course (course.id)}
@@ -140,11 +140,11 @@
{#if !enrollments}
- {#each Array(5) as _}
+ {#each Array(5) as _, i (i)}
{/each}
{:else}
- {#each enrollments as enrollment}
+ {#each enrollments as enrollment (enrollment.id)}
diff --git a/apps/dashboard/svelte.config.js b/apps/dashboard/svelte.config.js
index 2420901d..5d331bd6 100644
--- a/apps/dashboard/svelte.config.js
+++ b/apps/dashboard/svelte.config.js
@@ -34,6 +34,7 @@ const defaultScriptSrcDomains = [
'https://cdnjs.cloudflare.com',
'https://*.posthog.com',
'https://*.senja.io',
+ 'https://umami.hz.oncws.com',
'https://www.youtube.com',
'https://youtube.com',
'https://google.com'