Skip to content

Commit ec0caab

Browse files
author
rb
committed
Fix: drawer: bundle copied icon missing from pre-2.5 checkmk themes
1 parent 8d1ebd5 commit ec0caab

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Loading

frontend/src/cmk-stubs/CmkIcon/utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@
99
*/
1010
import type { IconNames } from 'cmk-shared-typing/typescript/icon'
1111

12+
import copiedIconUrl from './icon_copied.svg'
1213
import { iconSizes, themedIcons, unthemedIcons } from './icons.constants'
1314

15+
// Icons that older Checkmk themes don't ship (icon_copied.svg only exists
16+
// from 2.5 on) are bundled so they render on every supported version.
17+
const bundledIcons: Partial<Record<IconNames, string>> = {
18+
copied: copiedIconUrl
19+
}
20+
1421
type IconSizeNames = keyof typeof iconSizes
1522
type SimpleIcons = IconNames
1623

@@ -38,6 +45,11 @@ function checkmkBase(): string {
3845
}
3946

4047
export function getIconPath(name: SimpleIcons, theme: string): string {
48+
const bundled = bundledIcons[name]
49+
if (bundled) {
50+
return bundled
51+
}
52+
4153
const internalTheme = theme === 'facelift' ? 'light' : 'dark'
4254

4355
const themedPath = themedIcons[internalTheme]?.[name]

0 commit comments

Comments
 (0)