init project

This commit is contained in:
root
2026-04-23 00:21:02 -04:00
parent 23826c5528
commit 9191fd32f0
64 changed files with 10229 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
/** Map legacy CodeIgniter-style paths (as stored on roles / nav items) to this SPA. */
export function spaPathFromCiUrl(url: string | null | undefined): string | null {
if (url == null) return null
const u = url.trim()
if (u === '' || u === '#') return '/app/home'
if (/^https?:\/\//i.test(u)) return null
const path = u.replace(/^\/+/, '').replace(/\/+$/, '')
if (!path) return '/app/home'
const slug = path
.split('/')
.map((s) => s.trim())
.filter(Boolean)
.map((s) => s.toLowerCase())
.join('/')
const shortcuts: Record<string, string> = {
'landing_page/guest_dashboard': '/app/home',
'teacher/dashboard': '/app/teacher/dashboard',
'administrator/dashboard': '/app/administrator/dashboard',
'administrator/administratordashboard': '/app/admin/dashboard',
'parent/parent_dashboard': '/app/parent/home',
parent_dashboard: '/app/parent/home',
'parent/attendance-reports': '/app/parent/attendance-reports',
'parent/authorized-users': '/app/parent/authorized-users',
'parent/update-profile': '/app/parent/update-profile',
'parent/add_second_parent': '/app/parent/add-second-parent',
'parent/add-second-parent': '/app/parent/add-second-parent',
'parent/enroll_classes': '/app/parent/enroll-classes',
'parent/enroll-classes': '/app/parent/enroll-classes',
'parent/enroll_success': '/app/parent/enroll/success',
'parent/enroll_failure': '/app/parent/enroll/failure',
'parent/payment': '/app/parent/payment',
'parent/invoice_payment': '/app/parent/invoice-payment',
'parent/invoice-payment': '/app/parent/invoice-payment',
'parent/calendar': '/app/parent/calendar',
'parent/attendance': '/app/parent/attendance',
'parent/report-attendance': '/app/parent/report-attendance',
'parent/report_cards': '/app/parent/report-cards',
'parent/report-cards': '/app/parent/report-cards',
'parent/progress': '/app/parent/progress',
'parent/events': '/app/parent/events',
'parent/contact': '/app/parent/contact',
'parent/register_student': '/app/parent/register-student',
'parent/register-student': '/app/parent/register-student',
'parent/scores': '/app/parent/scores',
'parent/assignments': '/app/parent/assignments',
'parent/classes': '/app/parent/classes',
'parent/viewsecondparent': '/app/parent/add-second-parent',
'parent/child_register': '/app/parent/register-student',
'parent/edit-emergency-contact': '/app/parent/edit-emergency-contact',
'parent/emergency-contacts': '/app/parent/emergency-contacts',
'parent/edit_all_students': '/app/parent/edit-all-students',
'parent/edit-all-students': '/app/parent/edit-all-students',
}
return shortcuts[slug] ?? `/app/${slug}`
}
export function isExternalNavUrl(url: string | null | undefined): boolean {
if (!url) return false
return /^https?:\/\//i.test(url.trim())
}