Skip to content

Commit f5b8158

Browse files
committed
Added table title.
1 parent e1feb84 commit f5b8158

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/components/tableV2/features/globalControls.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { memo } from "react"
22
import Flex from "src/components/templates/flex"
33
import SearchInput from "src/components/search"
44
import { Icon } from "src/components/icon"
5+
import { H4 } from "@netdata/netdata-ui/lib/components/typography"
56
import { debounce } from "throttle-debounce"
67

78
const GlobalControls = ({
@@ -11,6 +12,7 @@ const GlobalControls = ({
1112
searchPlaceholder = "Search",
1213
searchValue,
1314
tableMeta,
15+
title,
1416
}) => {
1517
const wordsCount = searchValue?.split(" ").filter(x => !!x).length
1618

@@ -22,8 +24,10 @@ const GlobalControls = ({
2224
zIndex={10}
2325
background="mainBackground"
2426
padding={[0, 0, 4]}
27+
gap={3}
2528
{...tableMeta.bulkActionsStyles}
2629
>
30+
{!!title && <H4>{title}</H4>}
2731
{handleSearch && (
2832
<Flex width={{ max: 100, base: "40%" }} {...tableMeta.searchContainerStyles}>
2933
<SearchInput

src/components/tableV2/netdataTable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import useBulkActions from "./features/useBulkActions"
1717
import ColumnPinning from "./features/columnPinning"
1818
import GlobalControls from "./features/globalControls"
1919
import TableProvider from "./features/provider"
20-
2120
import MainTable from "./features/mainTable"
2221

2322
const noop = () => {}
@@ -66,6 +65,7 @@ const NetdataTable = ({
6665
virtualizeOptions = {},
6766
coloredSortedColumn = true,
6867
meta: tableMeta = {},
68+
title,
6969
...rest
7070
}) => {
7171
const [columnVisibility, setColumnVisibility] = useState(defaultColumnVisibility)
@@ -200,6 +200,7 @@ const NetdataTable = ({
200200
<Flex height="100%" overflow="hidden" width="100%" column>
201201
{onGlobalSearchChange || hasBulkActions ? (
202202
<GlobalControls
203+
title={title}
203204
bulkActions={hasBulkActions ? actions : null}
204205
dataGa={dataGa}
205206
handleSearch={onGlobalSearchChange ? onGlobalFilterChange : null}

0 commit comments

Comments
 (0)