Skip to content

Commit eaf8814

Browse files
susnuxskjnldsv
authored andcommitted
chore!: remove deprecated NewMenuEntry.iconClass
The `iconClass` attribute was deprecated for over 2 years. With v4 it is now removed. Instead use the `iconSvgInline` attribute to pass a svg icon. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 74c7115 commit eaf8814

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

lib/newMenu/NewMenu.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ export interface NewMenuEntry {
5151
*/
5252
iconSvgInline?: string
5353

54-
/**
55-
* Existing icon css class
56-
* @deprecated use iconSvgInline instead
57-
*/
58-
iconClass?: string
59-
6054
/** Order of the entry in the menu */
6155
order?: number
6256

@@ -109,7 +103,7 @@ export class NewMenu {
109103
}
110104

111105
private validateEntry(entry: NewMenuEntry) {
112-
if (!entry.id || !entry.displayName || !(entry.iconSvgInline || entry.iconClass) || !entry.handler) {
106+
if (!entry.id || !entry.displayName || !entry.iconSvgInline || !entry.handler) {
113107
throw new Error('Invalid entry')
114108
}
115109

@@ -118,8 +112,7 @@ export class NewMenu {
118112
throw new Error('Invalid id or displayName property')
119113
}
120114

121-
if ((entry.iconClass && typeof entry.iconClass !== 'string')
122-
|| (entry.iconSvgInline && typeof entry.iconSvgInline !== 'string')) {
115+
if (entry.iconSvgInline && typeof entry.iconSvgInline !== 'string') {
123116
throw new Error('Invalid icon provided')
124117
}
125118

0 commit comments

Comments
 (0)