-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add re-run button to runs table #1026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,7 @@ export const columns: readonly Column[] = [ | |
| { id: 'startedAt', label: 'Started At', minWidth: 80 }, | ||
| { id: 'finishedAt', label: 'Finished At', minWidth: 80 }, | ||
| { id: 'settings', label: 'Settings', minWidth: 80 }, | ||
| { id: 'rerun', label: 'Re-run', minWidth: 80 }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix i18n namespace mismatch for the new Re-run column header. The column is translated via 🔧 Proposed fix export const columns: readonly Column[] = [
{ id: 'runStatus', label: 'Status', minWidth: 80 },
{ id: 'name', label: 'Name', minWidth: 80 },
{ id: 'startedAt', label: 'Started At', minWidth: 80 },
{ id: 'finishedAt', label: 'Finished At', minWidth: 80 },
{ id: 'settings', label: 'Settings', minWidth: 80 },
{ id: 'rerun', label: 'Re-run', minWidth: 80 },
{ id: 'delete', label: 'Delete', minWidth: 80 },
];
const translatedColumns = useMemo(() =>
columns.map(column => ({
...column,
- label: t(`runstable.${column.id}`, column.label)
+ label: t(
+ column.id === 'rerun' ? 'runs_table.rerun' : `runstable.${column.id}`,
+ column.label
+ )
})),
[t]
);Also applies to: 132-136 🤖 Prompt for AI Agents |
||
| { id: 'delete', label: 'Delete', minWidth: 80 }, | ||
| ]; | ||
|
|
||
|
|
@@ -39,7 +40,7 @@ interface AccordionSortConfig { | |
| } | ||
|
|
||
| interface Column { | ||
| id: 'runStatus' | 'name' | 'startedAt' | 'finishedAt' | 'delete' | 'settings'; | ||
| id: 'runStatus' | 'name' | 'startedAt' | 'finishedAt' | 'delete' | 'settings' | 'rerun'; | ||
| label: string; | ||
| minWidth?: number; | ||
| align?: 'right'; | ||
|
|
@@ -71,6 +72,7 @@ export interface Data { | |
| interface RunsTableProps { | ||
| currentInterpretationLog: string; | ||
| abortRunHandler: (runId: string, robotName: string, browserId: string) => void; | ||
| rerunHandler: (robotMetaId: string, robotName: string, interpreterSettings: any) => void; | ||
| runId: string; | ||
| runningRecordingName: string; | ||
| } | ||
|
|
@@ -85,6 +87,7 @@ interface PaginationState { | |
| export const RunsTable: React.FC<RunsTableProps> = ({ | ||
| currentInterpretationLog, | ||
| abortRunHandler, | ||
| rerunHandler, | ||
| runId, | ||
| runningRecordingName | ||
| }) => { | ||
|
|
@@ -472,11 +475,12 @@ export const RunsTable: React.FC<RunsTableProps> = ({ | |
| onToggleExpanded={(shouldExpand) => handleRowExpand(row.runId, row.robotMetaId, shouldExpand)} | ||
| currentLog={currentInterpretationLog} | ||
| abortRunHandler={abortRunHandler} | ||
| rerunHandler={rerunHandler} | ||
| runningRecordingName={runningRecordingName} | ||
| urlRunId={urlRunId} | ||
| /> | ||
| )); | ||
| }, [paginationStates, runId, runningRecordingName, currentInterpretationLog, abortRunHandler, handleDelete, accordionSortConfigs]); | ||
| }, [paginationStates, runId, runningRecordingName, currentInterpretationLog, abortRunHandler, rerunHandler, handleDelete, accordionSortConfigs, expandedRows, handleRowExpand, getPaginationState, urlRunId]); | ||
|
|
||
| const renderSortIcon = useCallback((column: Column, robotMetaId: string) => { | ||
| const sortConfig = accordionSortConfigs[robotMetaId]; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -246,6 +246,62 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const handleReRunRecording = useCallback((robotMetaId: string, robotName: string, interpreterSettings: RunSettings) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| createAndRunRecording(robotMetaId, interpreterSettings).then((response: CreateRunResponseWithQueue) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invalidateRuns(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { browserId, runId, queued } = response; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!runId) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('error', t('main_page.notifications.run_start_failed', { name: robotName })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| navigate(`/runs/${robotMetaId}/run/${runId}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (queued) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setQueuedRuns(prev => new Set([...prev, runId])); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('info', `Run queued: ${robotName}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+261
to
+263
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Localize the queued rerun toast. This branch still emits a hardcoded English notification, so the rerun flow is only partially translated even though this PR adds locale coverage for the feature. Please move this behind an i18n key and add the matching locale entries. Suggested change- notify('info', `Run queued: ${robotName}`);
+ notify('info', t('main_page.notifications.run_queued', { name: robotName }));📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!browserId) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('error', t('main_page.notifications.run_start_failed', { name: robotName })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+264
to
+267
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Handle successful reruns that do not allocate a browser.
Suggested change- } else {
- if (!browserId) {
- notify('error', t('main_page.notifications.run_start_failed', { name: robotName }));
- return;
- }
-
+ } else if (browserId) {
const socket = io(`${apiUrl}/${browserId}`, {
transports: ["websocket", "polling"],
rejectUnauthorized: false
});
setSockets(sockets => [...sockets, socket]);
@@
notify('info', t('main_page.notifications.run_started', { name: robotName }));
+ } else {
+ notify('info', t('main_page.notifications.run_started', { name: robotName }));
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const socket = io(`${apiUrl}/${browserId}`, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| transports: ["websocket", "polling"], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rejectUnauthorized: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setSockets(sockets => [...sockets, socket]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| socket.on('run-completed', (data) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setRerenderRuns(true); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| invalidateRuns(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (data.status === 'success') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('success', t('main_page.notifications.interpretation_success', { name: robotName })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('error', t('main_page.notifications.interpretation_failed', { name: robotName })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| socket.on('connect_error', (error) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('error', `Failed to connect to browser ${browserId}: ${error}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| socket.on('disconnect', (reason) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log('warn', `Disconnected from browser ${browserId}: ${reason}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('info', t('main_page.notifications.run_started', { name: robotName })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setContent('runs'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }).catch((error: any) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| notify('error', t('main_page.notifications.run_start_failed', { name: robotName })); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.error('Error in rerun:', error); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, [navigate, notify, t, invalidateRuns, setRerenderRuns, setQueuedRuns, setSockets, setContent]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const handleScheduleRecording = async (settings: ScheduleSettings) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const { message, runId }: ScheduleRunResponse = await scheduleStoredRecording(runningRecordingId, settings); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (message === 'success') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -330,6 +386,7 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return <Runs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| currentInterpretationLog={currentInterpretationLog} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| abortRunHandler={abortRunHandler} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rerunHandler={handleReRunRecording} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runId={ids.runId} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runningRecordingName={runningRecordingName} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| />; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.