Skip to content

Commit

Permalink
v5.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
novykh committed Jul 10, 2024
1 parent aa3643b commit bcd1d4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netdata/charts",
"version": "5.3.2",
"version": "5.3.3",
"description": "Netdata frontend SDK and chart utilities",
"main": "dist/index.js",
"module": "dist/es6/index.js",
Expand Down
2 changes: 2 additions & 0 deletions src/components/table/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const emptyArray = []

export const labelColumn = (chart, { fallbackExpandKey, partIndex, header = "Name" } = {}) => ({
id: `label${header || ""}${partIndex || ""}`,
name: header,
header: () => <TextSmall strong>{header}</TextSmall>,
sortingFn: (rowA, rowB) => {
return (chart.getDimensionName(rowA.original.ids?.[0], partIndex) || "-").localeCompare(
Expand Down Expand Up @@ -119,6 +120,7 @@ export const valueColumn = (
{ context = "Dimensions", dimension = "Value", dimensionId }
) => ({
id: `value${context}${dimension}`,
name: `${context}: ${dimension}`,
header: () => {
return (
<Flex column>
Expand Down
6 changes: 5 additions & 1 deletion src/components/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const keepoutRegex = ".*"
const keepRegex = "(" + keepoutRegex + ")"

const sortContexts = (contexts, contextScope) =>
isEmpty(difference(contexts, contextScope)) ? contextScope : contexts
isEmpty(contexts)
? contexts // pass empty array to allow the table to rerender when payload comes back with data
: isEmpty(difference(contexts, contextScope))
? contextScope
: contexts

const useColumns = (chart, options = {}) => {
const contextScope = useAttributeValue("contextScope")
Expand Down

0 comments on commit bcd1d4e

Please sign in to comment.