Skip to content

Commit

Permalink
Keep the behavior of DataGrid table to hide the footer by default (#4955
Browse files Browse the repository at this point in the history
)

#4745 changed the behavior of
the DataGrid table to show the footer and pagination by default and this
breaks exiting table like https://hud.pytorch.org/benchmark/compilers
where the summary table now include pagination.

This change switches the default behavior back to what is was before of
not showing and also allow the user benchmark table from
#4745 to show the footer it
needs

### Testing

The summary table on the dashboard is back without footer
https://torchci-git-fork-huydhn-fix-dashboard-summa-7ec9fd-fbopensource.vercel.app/benchmark/compilers

While the user benchmark table has footer and pagination
https://torchci-git-fork-huydhn-fix-dashboard-summa-7ec9fd-fbopensource.vercel.app/torchbench/userbenchmark
  • Loading branch information
huydhn authored Feb 16, 2024
1 parent f22ebca commit 73ee793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions torchci/components/metrics/panels/TablePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default function TablePanel({
dataGridProps,
// An optional help link to display in the title
helpLink,
// An optional flag to show the table footer
showFooter,
}: {
title: string;
queryCollection?: string;
Expand All @@ -30,6 +32,7 @@ export default function TablePanel({
columns: GridColDef[];
dataGridProps: any;
helpLink?: string;
showFooter?: boolean;
}) {
const url = `/api/query/${queryCollection}/${queryName}?parameters=${encodeURIComponent(
JSON.stringify(queryParams)
Expand All @@ -46,6 +49,7 @@ export default function TablePanel({
columns={columns}
dataGridProps={dataGridProps}
helpLink={helpLink}
showFooter={showFooter}
/>
);
}
Expand All @@ -61,12 +65,15 @@ export function TablePanelWithData({
dataGridProps,
// An optional help link to display in the title
helpLink,
// An optional flag to show the table footer
showFooter,
}: {
title: string;
data: any;
columns: GridColDef[];
dataGridProps: any;
helpLink?: string;
showFooter?: boolean;
}) {
if (data === undefined) {
return <Skeleton variant={"rectangular"} height={"100%"} />;
Expand Down Expand Up @@ -95,6 +102,7 @@ export function TablePanelWithData({
density={"compact"}
rows={data}
columns={columns}
hideFooter={!showFooter}
autoPageSize
components={{
Toolbar: Header,
Expand Down
1 change: 1 addition & 0 deletions torchci/pages/torchbench/userbenchmark.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ function Report({
<TablePanelWithData
title={"Metrics"}
data={metrics}
showFooter={true}
columns={[
{
field: "metadata",
Expand Down

0 comments on commit 73ee793

Please sign in to comment.