updated the diff history and responsive table to allow hidden on the columns and to put the history data in the gutter on the mobile/drawer view

This commit is contained in:
csawatzky 2025-03-17 11:58:59 -06:00
parent c397b86524
commit b7c2354b83
2 changed files with 17 additions and 3 deletions

View file

@ -444,7 +444,7 @@ export default function DiffHistory(props: Props) {
{
title: "Summary",
cellStyle: cellStyle,
// hidden: isMobile || drawer,
hidden: isMobile || drawer,
render: row => (
<Summary
variant="inline"
@ -473,6 +473,19 @@ export default function DiffHistory(props: Props) {
<ResponsiveTable<RowData>
title={showTitle ? name + " History" : undefined}
rows={data}
renderGutter={((row) => (
<Summary
variant="inline"
kind={kind}
changes={row.changes}
before={row.before}
after={row.after}
diff={row.diff}
translateKey={translateKey}
translateValue={translateValue}
type={row.type}
/>
))}
columns={columns()}
total={0}
pageSize={0}

View file

@ -64,6 +64,7 @@ const useStyles = makeStyles((theme: Theme) => {
export interface Column<T> {
title: string;
cellStyle?: SxProps<Theme>;
hidden?: boolean;
render: (row: T) => JSX.Element;
}
@ -401,7 +402,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
{ renderGutter && <TableCell></TableCell>}
{ columns ?
columns.map((column, index) => {
if (filterList.includes(column.title)) return null
if (filterList.includes(column.title) || column.hidden) return null
return (
<TableCell key={"header-cell-"+index}>
{column.title}
@ -449,7 +450,7 @@ export default function ResponsiveTable<T extends Object>(props: Props<T>) {
}
{columns ?
columns.map((column, j) => {
if (filterList.includes(column.title)) return null
if (filterList.includes(column.title) || column.hidden) return null
if (column.render) return (
<TableCell key={"row-"+index+"cell-"+j} sx={column.cellStyle ? column.cellStyle : {padding: 0}}>
{column.render(row)}