From 74c87fb72a0e619ca341d42de16e88b144329487 Mon Sep 17 00:00:00 2001
From: Rotimi Best
Date: Wed, 11 Mar 2026 11:21:41 +0100
Subject: [PATCH] feat: centralize baseURL and app experience for cloud and
self hosted
---
.../src/lib/components/Navigation/app.svelte | 4 +-
.../lib/components/Navigation/index.svelte | 10 ++---
.../src/lib/features/app/init.svelte.ts | 18 +++-----
.../src/lib/features/app/layout-setup.ts | 5 ++-
.../community/api/community.svelte.ts | 42 ++++++++-----------
.../components/ask-community-button.svelte | 7 ++--
.../community/pages/ask-community.svelte | 18 ++------
.../community/pages/community-question.svelte | 15 +++----
.../features/community/pages/community.svelte | 8 ++--
.../sidebar/course-sidebar-navigation.svelte | 4 +-
.../features/ui/sidebar/footer/menu.svelte | 9 +---
.../ui/sidebar/org-sidebar/org-logo.svelte | 8 ++--
apps/dashboard/src/lib/utils/store/app.ts | 21 +++++++++-
.../src/routes/lms/community/+page.svelte | 4 +-
.../routes/lms/community/[slug]/+page.svelte | 2 +-
.../src/routes/lms/community/ask/+page.svelte | 2 +-
.../org/[slug]/community/[cslug]/+page.svelte | 2 +-
.../org/[slug]/community/ask/+page.svelte | 2 +-
18 files changed, 81 insertions(+), 100 deletions(-)
diff --git a/apps/dashboard/src/lib/components/Navigation/app.svelte b/apps/dashboard/src/lib/components/Navigation/app.svelte
index e9f451e3..51d9e736 100644
--- a/apps/dashboard/src/lib/components/Navigation/app.svelte
+++ b/apps/dashboard/src/lib/components/Navigation/app.svelte
@@ -5,7 +5,7 @@
import ArrowLeftIcon from '@lucide/svelte/icons/arrow-left';
import { IconButton } from '@cio/ui/custom/icon-button';
- import { globalStore } from '$lib/utils/store/app';
+ import { isStudentExperience } from '$lib/utils/store/app';
import { currentOrgPath } from '$lib/utils/store/org';
import { t } from '$lib/utils/functions/translations';
@@ -18,7 +18,7 @@
let { title = $bindable(''), navClass = '', isCoursePage = false }: Props = $props();
let coursesPath = $derived(
- $globalStore.isStudent ? '/lms/mylearning' : isCoursePage ? `${$currentOrgPath}/courses` : $currentOrgPath
+ $isStudentExperience ? '/lms/mylearning' : isCoursePage ? `${$currentOrgPath}/courses` : $currentOrgPath
);
diff --git a/apps/dashboard/src/lib/components/Navigation/index.svelte b/apps/dashboard/src/lib/components/Navigation/index.svelte
index 7704f4c9..268427e5 100644
--- a/apps/dashboard/src/lib/components/Navigation/index.svelte
+++ b/apps/dashboard/src/lib/components/Navigation/index.svelte
@@ -1,9 +1,8 @@
diff --git a/apps/dashboard/src/lib/features/community/pages/ask-community.svelte b/apps/dashboard/src/lib/features/community/pages/ask-community.svelte
index 5a210e02..4abe0945 100644
--- a/apps/dashboard/src/lib/features/community/pages/ask-community.svelte
+++ b/apps/dashboard/src/lib/features/community/pages/ask-community.svelte
@@ -9,12 +9,6 @@
import { currentOrg } from '$lib/utils/store/org';
import { communityApi } from '$features/community/api/community.svelte';
- interface Props {
- isLMS?: boolean;
- }
-
- let { isLMS = false }: Props = $props();
-
let fields = $state({
title: '',
body: '',
@@ -45,10 +39,8 @@
- {#each communityApi.courses as course}
- {#if course.id}
- {course.title}
- {/if}
+ {#each communityApi.courses as course (course.id)}
+ {course.title}
{/each}
@@ -68,11 +60,7 @@
-
diff --git a/apps/dashboard/src/lib/features/community/pages/community-question.svelte b/apps/dashboard/src/lib/features/community/pages/community-question.svelte
index 98d48d6c..190964b3 100644
--- a/apps/dashboard/src/lib/features/community/pages/community-question.svelte
+++ b/apps/dashboard/src/lib/features/community/pages/community-question.svelte
@@ -26,11 +26,10 @@
interface Props {
slug: string;
- isLMS?: boolean;
question?: CommunityQuestionSuccess['data'] | null;
}
- let { isLMS = false, question }: Props = $props();
+ let { question }: Props = $props();
let commentEditor: TiptapEditor | undefined = $state();
let isValidAnswer = false; // V2 allow admin mark an answer as accepted
@@ -86,7 +85,7 @@
}}
onDelete={() => {
if (communityApi.question) {
- communityApi.deleteQuestion(String(communityApi.question.id), isLMS);
+ communityApi.deleteQuestion(String(communityApi.question.id));
}
}}
/>
@@ -119,10 +118,8 @@
- {#each communityApi.courses as course}
- {#if course.id}
- {course.title}
- {/if}
+ {#each communityApi.courses as course (course.id)}
+ {course.title}
{/each}
@@ -224,7 +221,7 @@