mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(editor): Fix execution retry button (#10275)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user