fix(admin): map Winter icon-* names onto lucide for plugin navigation

Ported plugins send Winter icon-* class names on nav and settings; the SPA
never loads Font Awesome, so unknown names rendered as empty squares. Map
BM Studies, Quizzes, icon-pencil, and a closed Winter backend alias table
onto named @lucide/vue 1.17.0 exports, keep Square for unknown names, and
rebuild the embedded boardwalk dist.
This commit is contained in:
Jakub Zych
2026-10-05 19:28:06 +02:00
parent f453b80dc7
commit a00dafaf65
5 changed files with 261 additions and 15 deletions

View File

@@ -1,5 +1,28 @@
import { describe, expect, it } from 'vitest'
import { Archive, Disc3, Settings, Square, Tags } from '@lucide/vue'
import {
Archive,
Book,
Bookmark,
Calendar,
CircleQuestionMark,
Clock,
Copy,
Disc3,
FileText,
Flag,
GraduationCap,
House,
Leaf,
LifeBuoy,
List,
Mail,
Network,
Pencil,
Settings,
Square,
Tags,
WandSparkles,
} from '@lucide/vue'
import { fallbackIcon, iconFor, icons, winterIcons } from '../../src/app/icons'
describe('iconFor', () => {
@@ -7,11 +30,33 @@ describe('iconFor', () => {
expect(iconFor('disc-3')).toBe(Disc3)
expect(iconFor('tags')).toBe(Tags)
expect(iconFor(' tags ')).toBe(Tags)
expect(iconFor('book')).toBe(Book)
expect(iconFor(' graduation-cap ')).toBe(GraduationCap)
})
it('resolves Winter icon aliases', () => {
expect(iconFor('icon-archive')).toBe(Archive)
expect(iconFor('icon-cog')).toBe(Settings)
expect(iconFor('icon-graduation-cap')).toBe(GraduationCap)
expect(iconFor('icon-book')).toBe(Book)
expect(iconFor('icon-bookmark')).toBe(Bookmark)
expect(iconFor('icon-calendar')).toBe(Calendar)
expect(iconFor('icon-clock-o')).toBe(Clock)
expect(iconFor('icon-flag')).toBe(Flag)
expect(iconFor('icon-file-text-o')).toBe(FileText)
expect(iconFor('icon-tags')).toBe(Tags)
expect(iconFor('icon-pencil')).toBe(Pencil)
expect(iconFor('icon-question-circle')).toBe(CircleQuestionMark)
expect(iconFor('icon-list')).toBe(List)
expect(iconFor('icon-home')).toBe(House)
expect(iconFor('icon-magic')).toBe(WandSparkles)
expect(iconFor('icon-life-ring')).toBe(LifeBuoy)
expect(iconFor('icon-sitemap')).toBe(Network)
expect(iconFor('icon-envelope-o')).toBe(Mail)
expect(iconFor('icon-copy')).toBe(Copy)
expect(iconFor('icon-leaf')).toBe(Leaf)
expect(iconFor('icon-cogs')).toBe(Settings)
expect(iconFor('icon-edit')).toBe(Pencil)
})
it('falls back to the neutral square for unknown, empty or missing names', () => {