refactor(sidebar): remove external URLs from hardcoded items
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user