@@ -19,7 +19,7 @@ export const supportedBulkActions = {
1919 download : { icon : "download" , confirmation : false , tooltipText : "Download" } ,
2020 toggleAlarm : { icon : "alarm_off" , confirmation : false , tooltipText : "Turn of Alarms" } ,
2121 userSettings : { icon : "user" , confirmation : false , tooltipText : "User Settings" } ,
22- addEntry : { icon : "plus" , alwaysEnabled : true , flavour : "default" } ,
22+ addEntry : { icon : "plus" , alwaysEnabled : true , flavour : "default" , iconColor : "white" } ,
2323 remove : { icon : "removeNode" , confirmation : true , confirmLabel : "Yes" , declineLabel : "No" } ,
2424 columnVisibillity : { icon : "gear" , alwaysEnabled : true } ,
2525}
@@ -35,7 +35,7 @@ const renderActionWithDropdown = ({
3535} ) => {
3636 if ( ! actions || ! actions . length ) return < Box aria-hidden as = "span" />
3737 return actions . map (
38- ( { id, icon, handleAction, tooltipText, alwaysEnabled, isDisabled, isVisible } ) => {
38+ ( { id, icon, handleAction, tooltipText, alwaysEnabled, isDisabled, isVisible, ... rest } ) => {
3939 return (
4040 < ActionWithDropdown
4141 key = { id }
@@ -50,6 +50,7 @@ const renderActionWithDropdown = ({
5050 selectedRows = { selectedRows }
5151 isOpen = { isOpen }
5252 onClose = { onClose }
53+ { ...rest }
5354 />
5455 )
5556 }
@@ -58,7 +59,7 @@ const renderActionWithDropdown = ({
5859
5960const makeColumnVisibillityAction = ( { handleAction, visible } ) => {
6061 const prepareColumnVisibilityAction = {
61- id : "columnVisibility " ,
62+ id : "columnVisibillity " ,
6263 handleAction,
6364 visible,
6465 icon : "gear" ,
@@ -75,54 +76,51 @@ const makeBulkActions = ({
7576 selectedRows,
7677 columnVisibilityOptions,
7778} ) => {
78- const columnVisibility = makeColumnVisibillityAction ( { ...columnVisibilityOptions } )
79+ const columnVisibillity = makeColumnVisibillityAction ( { ...columnVisibilityOptions } )
7980 const actionsWithDropdown = renderActionWithDropdown ( {
80- actions : [ columnVisibility ] ,
81+ actions : [ columnVisibillity ] ,
8182 ...columnVisibilityOptions ,
8283 testPrefix,
8384 table,
8485 selectedRows,
8586 } )
8687
87- const availableBulkActions = Object . keys ( { ...bulkActions , columnVisibility } ) . reduce (
88- ( acc , currentActionKey ) => {
89- const isBulkActionSupported = supportedBulkActions [ currentActionKey ]
90- if ( ! isBulkActionSupported ) return acc
91- const {
92- icon,
93- confirmation,
94- tooltipText,
95- confirmationTitle,
96- confirmationMessage,
97- confirmLabel,
98- declineLabel,
99- handleDecline,
100- actionButtonDirection,
101- alwaysEnabled,
102- iconColor,
103- flavour,
104- } = supportedBulkActions [ currentActionKey ]
105- const currentAction = bulkActions [ currentActionKey ]
106- acc . push ( {
107- confirmation,
108- tooltipText,
109- icon,
110- id : currentActionKey ,
111- confirmationTitle,
112- confirmationMessage,
113- confirmLabel,
114- declineLabel,
115- handleDecline,
116- actionButtonDirection,
117- alwaysEnabled,
118- iconColor,
119- flavour,
120- ...currentAction ,
121- } )
122- return acc
123- } ,
124- [ ]
125- )
88+ const availableBulkActions = Object . keys ( { ...bulkActions } ) . reduce ( ( acc , currentActionKey ) => {
89+ const isBulkActionSupported = supportedBulkActions [ currentActionKey ]
90+ if ( ! isBulkActionSupported ) return acc
91+ const {
92+ icon,
93+ confirmation,
94+ tooltipText,
95+ confirmationTitle,
96+ confirmationMessage,
97+ confirmLabel,
98+ declineLabel,
99+ handleDecline,
100+ actionButtonDirection,
101+ alwaysEnabled,
102+ iconColor,
103+ flavour,
104+ } = supportedBulkActions [ currentActionKey ]
105+ const currentAction = bulkActions [ currentActionKey ]
106+ acc . push ( {
107+ confirmation,
108+ tooltipText,
109+ icon,
110+ id : currentActionKey ,
111+ confirmationTitle,
112+ confirmationMessage,
113+ confirmLabel,
114+ declineLabel,
115+ handleDecline,
116+ actionButtonDirection,
117+ alwaysEnabled,
118+ iconColor,
119+ flavour,
120+ ...currentAction ,
121+ } )
122+ return acc
123+ } , [ ] )
126124
127125 if ( ! availableBulkActions || ! availableBulkActions . length ) return [ ]
128126 const actions = availableBulkActions . map (
0 commit comments