Skip to content

Commit 6c7c2e9

Browse files
authored
Merge pull request #1649 from fedspendingtransparency/FDG-102xx-pivot-issue
Datasets are missing the pagination controls
2 parents 6d7140a + 7130b3a commit 6c7c2e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/dtg-table/dtg-table.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default function DtgTable({
121121
}
122122
return allCols;
123123
};
124-
const isPaginationControlNeeded = () => !apiError && !tableProps.apiError && maxRows > defaultPerPageOptions[0];
124+
const isPaginationControlNeeded = () => currentPage >= 1 || (!apiError && !tableProps.apiError && maxRows > defaultPerPageOptions[0]);
125125

126126
const rowData = Array.isArray(tableData) ? tableData : tableData?.data || [];
127127

src/components/dtg-table/dtg-table.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('DTG table component', () => {
215215
);
216216
});
217217
const instance = newComponent.root;
218-
expect(instance.findAllByType(PaginationControls)).toHaveLength(0);
218+
expect(instance.findAllByType(PaginationControls)).toHaveLength(1);
219219
});
220220

221221
it('does not render pagination Controls even when the table is configured to load page-by-page, so long as there are not more total available rows than the minimum rows-per-page-option and shouldPage is set to true', async () => {
@@ -298,7 +298,7 @@ describe('DtgTable component with shouldPage property and tableData with only on
298298
});
299299

300300
it('does not render pagination controls when fewer rows than the lowest available rows-per-page option in the pagination controls', () => {
301-
expect(instance19.findAllByType(PaginationControls).length).toStrictEqual(0);
301+
expect(instance19.findAllByType(PaginationControls).length).toStrictEqual(1);
302302
});
303303
});
304304

0 commit comments

Comments
 (0)