Skip to content

Commit b4c5622

Browse files
committed
feat: display table cell on robot meta id
1 parent eb4881a commit b4c5622

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/components/run/ColapsibleRow.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ interface CollapsibleRowProps {
3535
currentLog: string;
3636
abortRunHandler: () => void;
3737
runningRecordingName: string;
38+
urlRunId: string | null;
3839
}
39-
export const CollapsibleRow = ({ row, handleDelete, isOpen, currentLog, abortRunHandler, runningRecordingName }: CollapsibleRowProps) => {
40+
export const CollapsibleRow = ({ row, handleDelete, isOpen, currentLog, abortRunHandler, runningRecordingName, urlRunId }: CollapsibleRowProps) => {
4041
const { t } = useTranslation();
4142
const navigate = useNavigate();
4243
const [open, setOpen] = useState(isOpen);
@@ -62,14 +63,18 @@ export const CollapsibleRow = ({ row, handleDelete, isOpen, currentLog, abortRun
6263
abortRunHandler();
6364
}
6465

66+
useEffect(() => {
67+
setOpen(urlRunId === row.runId || isOpen);
68+
}, [urlRunId, row.runId, isOpen]);
69+
6570
const handleRowExpand = () => {
6671
const newOpen = !open;
6772
setOpen(newOpen);
68-
if (newOpen) {
69-
navigate(`/runs/${row.robotMetaId}/run/${row.runId}`);
70-
} else {
71-
navigate(`/runs/${row.robotMetaId}`);
72-
}
73+
navigate(
74+
newOpen
75+
? `/runs/${row.robotMetaId}/run/${row.runId}`
76+
: `/runs/${row.robotMetaId}`
77+
);
7378
//scrollToLogBottom();
7479
};
7580

0 commit comments

Comments
 (0)