Skip to content

Commit 51e07d6

Browse files
cleanup
1 parent 1d31473 commit 51e07d6

File tree

7 files changed

+12
-28
lines changed

7 files changed

+12
-28
lines changed

react/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "bwmon",
33
"description": "Bandwidth Monitor",
4-
"version": "3.1.4",
4+
"version": "3.1.5",
55
"homepage": "/bwmon/",
66
"private": true,
77
"scripts": {

react/src/components/table/UsageTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Header from './Header';
55
import Body from './Body';
66
import Footer from './Footer';
77

8-
const UsageTable = ({ prefix, cellInfos, columnCount, paginationProps, headerProps, bodyProps, footerProps, showFooter }) => (
8+
const UsageTable = ({ prefix, cellInfos, paginationProps, headerProps, bodyProps, footerProps, showFooter }) => (
99
<Table stickyHeader size="small">
1010
<TableHead>
1111
<TableRow>

react/src/components/table/UsageTable.test.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ describe('UsageTable', () => {
4343
<UsageTable
4444
prefix="test"
4545
cellInfos={cellInfos}
46-
columnCount={2}
4746
paginationProps={paginationProps}
4847
headerProps={headerProps}
4948
bodyProps={bodyProps}
@@ -63,7 +62,6 @@ describe('UsageTable', () => {
6362
<UsageTable
6463
prefix="test"
6564
cellInfos={cellInfos}
66-
columnCount={2}
6765
paginationProps={paginationProps}
6866
headerProps={headerProps}
6967
bodyProps={bodyProps}

react/src/features/byuser/UsageByUser.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,9 @@ const UsageByUser = () => {
7676
[sortedData, page, rowsPerPage]
7777
);
7878

79-
const columnCount = () => cellInfos.length - 4;
80-
8179
const paginationProps = {
8280
'data-testid': 'user-pagination-id',
8381
id: 'user-pagination-id',
84-
colSpan: columnCount(),
8582
count: data && data.usage ? data.usage.length : 0,
8683
minimum: rowsPerPageMin,
8784
rowsPerPage,
@@ -101,7 +98,6 @@ const UsageByUser = () => {
10198
<UsageTable
10299
prefix="user"
103100
cellInfos={cellInfos}
104-
columnCount={columnCount()}
105101
paginationProps={paginationProps}
106102
headerProps={headerProps}
107103
bodyProps={bodyProps}
@@ -115,7 +111,7 @@ const UsageByUser = () => {
115111
<Loading isLoading={loading} />
116112
{error && <ErrorMessage message={error} />}
117113
<TableContainer>
118-
<div style={{ display: 'flex', gap: '1rem', marginBottom: '1rem' }}>
114+
<div style={{ display: 'flex', gap: '1rem' }}>
119115
<DropDown data-testid="user-year" id="user-year" onChange={handleChangeYear} items={years} value={year} />
120116
<DropDown data-testid="user-month" id="user-month" onChange={handleChangeMonth} items={months} value={month} />
121117
<Search data-testid="user-filter" id="user-filter" onChange={handleChangeFilter} />

react/src/features/byuser/UsageByUser.test.jsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ describe('UsageByUser', () => {
8282
expect(screen.queryByTestId('user-header')).not.toBeInTheDocument();
8383
});
8484

85-
it('Pagination colSpan matches columnCount', () => {
86-
renderComponent();
87-
const pagination = screen.getByTestId('user-pagination-id');
88-
expect(pagination).toHaveAttribute('colspan', '7');
89-
});
90-
9185
it('renders table header', () => {
9286
renderComponent();
9387
expect(screen.queryByText('Loading...')).not.toBeInTheDocument();

react/src/features/byyear/UsageByYear.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ const UsageByYear = () => {
5151
setOrderBy(property);
5252
};
5353

54-
const sortedData = useMemo(
55-
() => (data ? sort(data, comparator(ascending, orderBy)) : []),
56-
[data, ascending, orderBy]
57-
);
54+
const sortedData = useMemo(() => (data ? sort(data, comparator(ascending, orderBy)) : []), [data, ascending, orderBy]);
5855

5956
const paginatedData = useMemo(
6057
() => sortedData.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage),
@@ -83,7 +80,6 @@ const UsageByYear = () => {
8380
<UsageTable
8481
prefix="year"
8582
cellInfos={cellInfos}
86-
columnCount={cellInfos.length}
8783
paginationProps={paginationProps}
8884
headerProps={headerProps}
8985
bodyProps={bodyProps}

0 commit comments

Comments
 (0)