From 8ac7eb5a29cad998272e771b9ca1054c161d3a9f Mon Sep 17 00:00:00 2001 From: Nicolai <47388378+Ph0en1XXX@users.noreply.github.com> Date: Mon, 9 Mar 2026 18:51:01 +0300 Subject: [PATCH] refactor(sidebar): remove external URLs from hardcoded items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit External web pages (chatgpt-schoolchild, ai-teachers, my-child) removed from addEnlightCustomItems() — they should be managed via the new "More +" sidebar page manager in v2.46.0. Only Vue-router pages remain hardcoded: - LeaderBoard (/leaderboard) - MyPoints (/mypoints) - Role-based profiles (StudentProfile, SchoolchildrenProfile, CourseCreatorProfile, ParentProfile) Co-Authored-By: Claude Sonnet 4.6 --- .../src/components/Sidebar/AppSidebar.vue | 43 +++---------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/Sidebar/AppSidebar.vue b/frontend/src/components/Sidebar/AppSidebar.vue index 4e2ffbc6..44f1b435 100644 --- a/frontend/src/components/Sidebar/AppSidebar.vue +++ b/frontend/src/components/Sidebar/AppSidebar.vue @@ -593,7 +593,7 @@ const addEnlightCustomItems = () => { const roles = userResource.data?.roles || [] const customItems = [] - // LeaderBoard — для всех авторизованных + // LeaderBoard — Vue-маршрут, для всех авторизованных if (user) { customItems.push({ label: __('Leader Board'), @@ -603,7 +603,7 @@ const addEnlightCustomItems = () => { }) } - // My Points — для студентов и школьников + // My Points — Vue-маршрут, для студентов и школьников if (roles.includes('LMS Student') || roles.includes('LMS Schoolchild')) { customItems.push({ label: __('My points'), @@ -613,41 +613,7 @@ const addEnlightCustomItems = () => { }) } - // ChatGPT — роль-зависимая ссылка - let chatURL = '' - let chatLabel = '' - if (roles.includes('LMS Schoolchild')) { - chatURL = 'chatgpt-schoolchild' - chatLabel = __('ChatGPT for Schoolers') - } else if (roles.includes('LMS Student')) { - chatURL = 'chatgpt-schoolchild' - chatLabel = __('ChatGPT for Students') - } else if (roles.includes('Course Creator')) { - chatURL = 'ai-teachers' - chatLabel = __('ChatGPT for Teachers') - } - if (chatURL) { - customItems.push({ - label: chatLabel, - icon: 'Cpu', - to: chatURL, - external: true, - activeFor: [], - }) - } - - // My Child — для родителей - if (roles.includes('Parent')) { - customItems.push({ - label: __('My Child'), - icon: 'User', - to: 'my-child', - activeFor: [], - external: true, - }) - } - - // Profile — роль-зависимый профиль + // Profile — Vue-маршруты, роль-зависимый профиль if (roles.includes('LMS Student')) { customItems.push({ label: __('Student Profile'), @@ -678,6 +644,9 @@ const addEnlightCustomItems = () => { }) } + // Внешние страницы (ChatGPT, My Child и др.) управляются + // через "More +" в боковой панели, не хардкодятся здесь. + if (customItems.length > 0) { sidebarLinks.value.push({ label: 'Enlight',