diff --git a/src/components/Grid/enumColumn.tsx b/src/components/Grid/enumColumn.tsx index dac0dd027..6a47fe21b 100644 --- a/src/components/Grid/enumColumn.tsx +++ b/src/components/Grid/enumColumn.tsx @@ -15,5 +15,5 @@ export const enumColumn = ( // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition getOptionLabel: (v) => labels[v as T] ?? EmptyEnumFilterValue, valueFormatter: (value: T) => labels[value], - ...(orderByIndex ? { sortBy: (v) => list.indexOf(v) } : {}), + ...(orderByIndex ? { sortBy: (v) => (v ? list.indexOf(v) : null) } : {}), } satisfies Partial>); diff --git a/src/components/Grid/useDataGridSource.tsx b/src/components/Grid/useDataGridSource.tsx index 30d1474cc..011183146 100644 --- a/src/components/Grid/useDataGridSource.tsx +++ b/src/components/Grid/useDataGridSource.tsx @@ -172,7 +172,12 @@ export const useDataGridSource = < (prev) => { const prevList = listFrom(prev); const nextList = listFrom(next); - if (prevList && prevList.items.length === nextList.total) { + if ( + prevList && + prevList.items.length === nextList.total && + updateTotal && + prevList.total === nextList.total + ) { return undefined; // no change } const mergedList = uniqBy( diff --git a/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsExpandedGrid.tsx b/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsExpandedGrid.tsx index ff1f0244f..b1d93e004 100644 --- a/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsExpandedGrid.tsx +++ b/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsExpandedGrid.tsx @@ -47,6 +47,9 @@ const wrapForNonExpansion = (renderCell?: GridColDef['renderCell']) => { display: 'flex', alignItems: 'center', + '.MuiDataGrid-cell--textCenter &': { + justifyContent: 'center', + }, }} > {renderCell ? renderCell(props) : props.formattedValue ?? props.value} diff --git a/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsGrid.tsx b/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsGrid.tsx index 08db2da3b..a72371314 100644 --- a/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsGrid.tsx +++ b/src/scenes/Dashboard/ProgressReportsWidget/ProgressReportsGrid.tsx @@ -1,5 +1,5 @@ import { Link as LinkIcon } from '@mui/icons-material'; -import { Box, IconButton, Tooltip, Typography } from '@mui/material'; +import { Box, IconButton, Stack, Tooltip, Typography } from '@mui/material'; import { DataGridPro, DataGridProProps as DataGridProps, @@ -63,9 +63,10 @@ export const ProgressReportsColumnMap = { hideable: false, }, viewReport: { - headerName: 'View', + headerName: 'Report', field: 'id', - width: 54, + width: 65, + align: 'center', renderCell: ({ row }) => ( ( - - + + {value === undefined ? '—' : `${(value * 100).toFixed(1)}%`} -
{label}
-
+ {label} + );