style: right-align created date in fetch-request and report rows

- created_at pinned right before row actions in both lists; remaining cells wrap inside a shrinking area so the date never wraps to a left-aligned line
This commit is contained in:
2026-08-24 19:46:59 +05:30
parent a3a87cc1ed
commit 0b8673de52
2 changed files with 33 additions and 17 deletions

View File

@@ -130,22 +130,38 @@ function FetchRequestList() {
})} })}
onClick={() => navigate(`/fetch-requests/${row.id}`)} onClick={() => navigate(`/fetch-requests/${row.id}`)}
> >
<Box sx={{ display: "flex", gap: 2, flexWrap: "wrap", alignItems: "center" }}> <Box sx={{ display: "flex", gap: 2, alignItems: "center" }}>
{columns.map((col) => ( <Box sx={{ display: "flex", gap: 2, flexWrap: "wrap", alignItems: "center", flex: 1, minWidth: 0 }}>
<Box key={col.name} sx={{ minWidth: 120 }}> {columns
<Typography variant="caption" color="text.secondary" sx={{ display: "block" }}> .filter((col) => col.name !== "created_at")
{col.label} .map((col) => (
</Typography> <Box key={col.name} sx={{ minWidth: 120 }}>
<ListCellRenderer <Typography variant="caption" color="text.secondary" sx={{ display: "block" }}>
field={col} {col.label}
value={row[col.name]} </Typography>
displayFormat={col.fk <ListCellRenderer
? (allResources.find((r) => r.name === col.fk!.resource)?.displayFormat ?? displayFormat) field={col}
: displayFormat} value={row[col.name]}
/> displayFormat={col.fk
</Box> ? (allResources.find((r) => r.name === col.fk!.resource)?.displayFormat ?? displayFormat)
))} : displayFormat}
<Box sx={{ ml: "auto", flexShrink: 0 }}> />
</Box>
))}
</Box>
{(() => {
const dateCol = columns.find((col) => col.name === "created_at");
if (!dateCol) return null;
return (
<Box sx={{ flexShrink: 0, textAlign: "right" }}>
<Typography variant="caption" color="text.secondary" sx={{ display: "block" }}>
{dateCol.label}
</Typography>
<ListCellRenderer field={dateCol} value={row.created_at} displayFormat={displayFormat} />
</Box>
);
})()}
<Box sx={{ flexShrink: 0 }}>
<Tooltip title="Delete fetch request"> <Tooltip title="Delete fetch request">
<IconButton <IconButton
size="small" size="small"

View File

@@ -51,7 +51,7 @@ export function ReportList({ reports, loading, fields, selectedId, onView, onReg
"&:hover": { borderColor: "primary.light" }, "&:hover": { borderColor: "primary.light" },
}} }}
> >
<Box sx={{ display: "flex", alignItems: "center", gap: 2, flexWrap: "wrap" }}> <Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>
<Box sx={{ flex: "1 1 260px", minWidth: 0 }}> <Box sx={{ flex: "1 1 260px", minWidth: 0 }}>
<Typography variant="body1" fontWeight={600} noWrap sx={{ fontSize: "0.9375rem" }}> <Typography variant="body1" fontWeight={600} noWrap sx={{ fontSize: "0.9375rem" }}>
{report.name || report.id} {report.name || report.id}