Skip to content

Commit

Permalink
CM-1012: Add an option to load all advisories (#1298)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayumi-oxd authored May 2, 2024
1 parent c1fe799 commit 7ea82ec
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
13 changes: 0 additions & 13 deletions src/admin/src/components/composite/dataTable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,6 @@ const tableIcons = {
};

export default function DataTable(props) {
props.options.pageSize =
props.data.length > props.options.pageSize
? props.options.pageSize
: props.data.length;

let newPageSizeOptions = [];

props.options.pageSizeOptions.forEach((row) => {
if (props.data.length > row) newPageSizeOptions.push(row);
});

props.options.pageSizeOptions = newPageSizeOptions;

return (
<TableContainer component={Paper} className="data-table">
<MaterialTable icons={tableIcons} {...props} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,15 +625,14 @@ export default function AdvisoryDashboard({
data-testid="AdvisoryDashboard"
>
<br />

<div className="container-fluid">
<DataTable
key={publicAdvisories.length}
options={{
filtering: true,
search: false,
pageSize: 50,
pageSizeOptions: [25, 50, 100],
pageSizeOptions: [25, 50, publicAdvisories.length],
}}
onFilterChange={(filters) => {
const advisoryFilters = JSON.parse(localStorage.getItem('advisoryFilters'));
Expand Down

0 comments on commit 7ea82ec

Please sign in to comment.