Skip to content

Commit

Permalink
revert changes on table cell
Browse files Browse the repository at this point in the history
  • Loading branch information
vitPinchuk committed Dec 13, 2024
1 parent 311fb07 commit 4ed03db
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,5 @@ export const getStyles = (theme: GrafanaTheme2) => {
}
}
`,
subRowsTotal: css`
margin-left: ${theme.spacing(1)};
font-size: ${theme.spacing(1.25)};
color: ${theme.colors.text.disabled};
`,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -334,50 +334,4 @@ describe('TableCell', () => {
expect.anything()
);
});

it('Should render totalSubRows', async () => {
const data = [
{
device: 'device1',
value: 10,
},
{
device: 'device2',
value: 20,
},
];

const columns = [
{
id: 'device',
accessorFn: createColumnAccessorFn('device'),
enableGrouping: true,
meta: createColumnMeta({
showSubRowsTotal: true,
config: createColumnConfig({
showSubRowsTotal: true,
}),
}),
},
{
id: 'value',
accessorFn: createColumnAccessorFn('value'),
aggregationFn: () => null,
},
];

await act(async () =>
render(
getComponent({
data,
columns,
rowIndex: 0,
grouping: ['device'],
})
)
);

expect(selectors.totalSubRows()).toBeInTheDocument();
expect(selectors.totalSubRows()).toHaveTextContent('(Rows: 1)');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ export const TableCell = <TData,>({ row, cell, rendererProps }: Props<TData>) =>
/>
)}
{renderCell()}
{cell.getIsGrouped() && cell.column.columnDef.meta?.config.showSubRowsTotal && (
<span className={styles.subRowsTotal} {...TEST_IDS.tableCell.totalSubRows.apply()}>
(Rows: {row.subRows.length})
</span>
)}
</>
);
};

0 comments on commit 4ed03db

Please sign in to comment.