mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(editor): Fix execution retry button (#10275)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
parent
57d1c9a99e
commit
55f2ffe256
|
@ -51,7 +51,7 @@ describe('WorkflowExecutionsCard', () => {
|
||||||
retryOf: '2',
|
retryOf: '2',
|
||||||
retrySuccessId: null,
|
retrySuccessId: null,
|
||||||
},
|
},
|
||||||
false,
|
true,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,4 +47,25 @@ describe('useExecutionHelpers()', () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('isExecutionRetriable', () => {
|
||||||
|
const { isExecutionRetriable } = useExecutionHelpers();
|
||||||
|
|
||||||
|
it.each(['crashed', 'error'])('returns true when execution status is %s', (status) => {
|
||||||
|
expect(isExecutionRetriable({ status } as ExecutionSummary)).toEqual(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(['canceled', 'new', 'running', 'success', 'unknown', 'waiting'])(
|
||||||
|
'returns false when execution status is %s',
|
||||||
|
(status) => {
|
||||||
|
expect(isExecutionRetriable({ status } as ExecutionSummary)).toEqual(false);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
it('should return false if retrySuccessId is set', () => {
|
||||||
|
expect(
|
||||||
|
isExecutionRetriable({ status: 'crashed', retrySuccessId: '123' } as ExecutionSummary),
|
||||||
|
).toEqual(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,11 +62,7 @@ export function useExecutionHelpers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isExecutionRetriable(execution: ExecutionSummary): boolean {
|
function isExecutionRetriable(execution: ExecutionSummary): boolean {
|
||||||
return (
|
return ['crashed', 'error'].includes(execution.status) && !execution.retrySuccessId;
|
||||||
['crashed', 'error'].includes(execution.status) &&
|
|
||||||
!execution.retryOf &&
|
|
||||||
!execution.retrySuccessId
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue