@@ -12,6 +12,7 @@ import {
12
12
} from '../Operations'
13
13
import { DropdownItem } from "../Components/DropdownItem" ;
14
14
import { UncontrolledTooltip } from "../Components/Tooltip" ;
15
+ import { IconProp } from "@fortawesome/fontawesome-svg-core" ;
15
16
16
17
export function getConstructFromManyContextualItems ( ctx : ContextualItemsContext < Entity > ) : Promise < MenuItemBlock | undefined > | undefined {
17
18
if ( ctx . lites . length == 0 )
@@ -195,7 +196,7 @@ export namespace MenuItemConstructor { //To allow monkey patching
195
196
simplifyName ( coc . operationInfo . niceName ) ;
196
197
197
198
const color = coc . settings && coc . settings . color || coc . entityOperationSettings && coc . entityOperationSettings . color || Defaults . getColor ( coc . operationInfo ) ;
198
- const icon = coc . settings && coc . settings . icon || coc . entityOperationSettings && coc . entityOperationSettings . icon ;
199
+ const icon = coalesceIcon ( coc . settings && coc . settings . icon , coc . entityOperationSettings && coc . entityOperationSettings . icon ) ;
199
200
const iconColor = coc . settings && coc . settings . iconColor || coc . entityOperationSettings && coc . entityOperationSettings . iconColor ;
200
201
201
202
const disabled = ! ! coc . canExecute ;
@@ -215,7 +216,7 @@ export namespace MenuItemConstructor { //To allow monkey patching
215
216
data-operation = { coc . operationInfo . key } >
216
217
{ icon ? < FontAwesomeIcon icon = { icon } className = "icon" color = { iconColor } fixedWidth /> :
217
218
color ? < span className = { classes ( "icon" , "empty-icon" , "btn-" + color ) } > </ span > : undefined }
218
- { ( icon || color ) && " " }
219
+ { ( icon != null || color != null ) && " " }
219
220
{ text }
220
221
</ DropdownItem > ,
221
222
coc . canExecute ? < UncontrolledTooltip placement = "right" target = { ( ) => innerRef ! } > { coc . canExecute } </ UncontrolledTooltip > : undefined
@@ -273,5 +274,15 @@ export function defaultContextualClick(coc: ContextualOperationContext<any>, ...
273
274
}
274
275
} ) . done ( ) ;
275
276
277
+
278
+
279
+ }
280
+
281
+
282
+ export function coalesceIcon ( icon : IconProp | undefined , icon2 : IconProp | undefined ) : IconProp | undefined { //Till the error is fixed
283
+ if ( icon != null )
284
+ return icon ;
285
+
286
+ return icon2 ;
276
287
}
277
288
0 commit comments