@@ -30,7 +30,7 @@ import useInfiniteScroll from "./hooks/useInfiniteScroll"
30
30
const noop = ( ) => { }
31
31
32
32
const NetdataTable = ( {
33
- bulkActions = { } ,
33
+ bulkActions,
34
34
columnPinningOptions = { } ,
35
35
columnVisibility : initialColumnVisibility ,
36
36
data,
@@ -62,6 +62,7 @@ const NetdataTable = ({
62
62
testPrefix = "" ,
63
63
testPrefixCallback,
64
64
virtualizeOptions = { } ,
65
+ ...rest
65
66
} ) => {
66
67
const [ isColumnDropdownVisible , setIsColumnDropdownVisible ] = useState ( false )
67
68
const [ columnVisibility , setColumnVisibility ] = useState ( initialColumnVisibility )
@@ -102,22 +103,25 @@ const NetdataTable = ({
102
103
103
104
const makeActionsColumn = useMemo ( ( ) => makeRowActions ( { rowActions, testPrefix } ) , [ rowActions ] )
104
105
105
- const renderBulkActions = ( ) => [
106
- makeBulkActions ( {
107
- bulkActions,
108
- columnPinning,
109
- columnVisibilityOptions : {
110
- handleAction : ( ) => setIsColumnDropdownVisible ( true ) ,
111
- isOpen : isColumnDropdownVisible ,
112
- onClose : ( ) => setIsColumnDropdownVisible ( false ) ,
113
- visible : enableColumnVisibility ,
114
- } ,
115
- enableColumnPinning,
116
- selectedRows : originalSelectedRows ,
117
- table,
118
- testPrefix,
119
- } ) ,
120
- ]
106
+ const renderBulkActions = ( ) =>
107
+ bulkActions
108
+ ? [
109
+ makeBulkActions ( {
110
+ bulkActions,
111
+ columnPinning,
112
+ columnVisibilityOptions : {
113
+ handleAction : ( ) => setIsColumnDropdownVisible ( true ) ,
114
+ isOpen : isColumnDropdownVisible ,
115
+ onClose : ( ) => setIsColumnDropdownVisible ( false ) ,
116
+ visible : enableColumnVisibility ,
117
+ } ,
118
+ enableColumnPinning,
119
+ selectedRows : originalSelectedRows ,
120
+ table,
121
+ testPrefix,
122
+ } ) ,
123
+ ]
124
+ : null
121
125
122
126
const makeSelectionColumn = enableSelection ? [ makeRowSelection ( { testPrefix } ) ] : [ ]
123
127
@@ -220,12 +224,14 @@ const NetdataTable = ({
220
224
return (
221
225
< SharedTableProvider >
222
226
< Flex height = "100%" overflow = "hidden" width = "100%" column >
223
- < GlobalControls
224
- bulkActions = { renderBulkActions }
225
- dataGa = { dataGa }
226
- handleSearch = { onGlobalSearchChange ? handleGlobalSearch : null }
227
- searchValue = { globalFilter }
228
- />
227
+ { onGlobalSearchChange || bulkActions ? (
228
+ < GlobalControls
229
+ bulkActions = { renderBulkActions }
230
+ dataGa = { dataGa }
231
+ handleSearch = { onGlobalSearchChange ? handleGlobalSearch : null }
232
+ searchValue = { globalFilter }
233
+ />
234
+ ) : null }
229
235
< Flex
230
236
ref = { scrollParentRef }
231
237
overflow = { { vertical : "auto" , horizontal : "auto" } }
@@ -264,6 +270,7 @@ const NetdataTable = ({
264
270
flexRender = { flexRender }
265
271
onHoverRow = { onHoverRow }
266
272
virtualizeOptions = { virtualizeOptions }
273
+ { ...rest }
267
274
/>
268
275
</ Flex >
269
276
{ enablePagination && makePagination ( { table } ) }
0 commit comments