File tree 5 files changed +94
-12
lines changed 5 files changed +94
-12
lines changed Original file line number Diff line number Diff line change @@ -894,15 +894,6 @@ export default defineComponent({
894
894
this .showError (error , this .i18n .baseText (' executionsList.showError.stopExecution.title' ));
895
895
}
896
896
},
897
- isExecutionRetriable(execution : ExecutionSummary ): boolean {
898
- return (
899
- execution .stoppedAt !== undefined &&
900
- ! execution .finished &&
901
- execution .retryOf === undefined &&
902
- execution .retrySuccessId === undefined &&
903
- ! execution .waitTill
904
- );
905
- },
906
897
async deleteExecution(execution : ExecutionSummary ) {
907
898
this .isDataLoading = true ;
908
899
try {
@@ -1160,6 +1151,7 @@ export default defineComponent({
1160
1151
background : var (--execution-card-border-waiting );
1161
1152
}
1162
1153
1154
+ & .canceled td :first-child ::before ,
1163
1155
& .unknown td :first-child ::before {
1164
1156
background : var (--execution-card-border-unknown );
1165
1157
}
Original file line number Diff line number Diff line change 59
59
</div >
60
60
<div :class =" $style.icons" >
61
61
<n8n-action-dropdown
62
- v-if =" executionUIDetails.name === 'error' "
62
+ v-if =" isRetriable "
63
63
:class =" [$style.icon, $style.retry]"
64
64
:items =" retryExecutionActions"
65
65
activator-icon =" redo"
83
83
84
84
<script lang="ts">
85
85
import { defineComponent } from ' vue' ;
86
- import type { ExecutionSummary } from ' @/Interface ' ;
86
+ import type { ExecutionSummary } from ' n8n-workflow ' ;
87
87
import type { IExecutionUIData } from ' @/mixins/executionsHelpers' ;
88
88
import { executionHelpers } from ' @/mixins/executionsHelpers' ;
89
89
import { VIEWS } from ' @/constants' ;
@@ -133,6 +133,9 @@ export default defineComponent({
133
133
isActive(): boolean {
134
134
return this .execution .id === this .$route .params .executionId ;
135
135
},
136
+ isRetriable(): boolean {
137
+ return this .isExecutionRetriable (this .execution );
138
+ },
136
139
},
137
140
methods: {
138
141
onRetryMenuItemSelect(action : string ): void {
Original file line number Diff line number Diff line change 96
96
</n8n-button >
97
97
98
98
<ElDropdown
99
- v-if =" executionUIDetails?.name === 'error' "
99
+ v-if =" isRetriable "
100
100
ref =" retryDropdown"
101
101
trigger =" click"
102
102
class =" mr-xs"
@@ -190,6 +190,9 @@ export default defineComponent({
190
190
type: ' primary' ,
191
191
};
192
192
},
193
+ isRetriable(): boolean {
194
+ return !! this .activeExecution && this .isExecutionRetriable (this .activeExecution );
195
+ },
193
196
},
194
197
methods: {
195
198
async onDeleteExecution(): Promise <void > {
Original file line number Diff line number Diff line change
1
+ import { createComponentRenderer } from '@/__tests__/render' ;
2
+ import ExecutionCard from '@/components/ExecutionsView/ExecutionCard.vue' ;
3
+ import { createPinia , setActivePinia } from 'pinia' ;
4
+
5
+ const renderComponent = createComponentRenderer ( ExecutionCard , {
6
+ global : {
7
+ stubs : {
8
+ 'router-link' : {
9
+ template : '<div><slot /></div>' ,
10
+ } ,
11
+ } ,
12
+ mocks : {
13
+ $route : {
14
+ params : { } ,
15
+ } ,
16
+ } ,
17
+ } ,
18
+ } ) ;
19
+
20
+ describe ( 'ExecutionCard' , ( ) => {
21
+ beforeEach ( ( ) => {
22
+ setActivePinia ( createPinia ( ) ) ;
23
+ } ) ;
24
+
25
+ test . each ( [
26
+ [
27
+ {
28
+ id : '1' ,
29
+ mode : 'manual' ,
30
+ status : 'success' ,
31
+ retryOf : null ,
32
+ retrySuccessId : null ,
33
+ } ,
34
+ false ,
35
+ ] ,
36
+ [
37
+ {
38
+ id : '2' ,
39
+ mode : 'manual' ,
40
+ status : 'error' ,
41
+ retryOf : null ,
42
+ retrySuccessId : null ,
43
+ } ,
44
+ true ,
45
+ ] ,
46
+ [
47
+ {
48
+ id : '3' ,
49
+ mode : 'manual' ,
50
+ status : 'error' ,
51
+ retryOf : '2' ,
52
+ retrySuccessId : null ,
53
+ } ,
54
+ false ,
55
+ ] ,
56
+ [
57
+ {
58
+ id : '4' ,
59
+ mode : 'manual' ,
60
+ status : 'error' ,
61
+ retryOf : null ,
62
+ retrySuccessId : '3' ,
63
+ } ,
64
+ false ,
65
+ ] ,
66
+ ] ) ( 'with execution %j retry button visibility is %s' , ( execution , shouldRenderRetryBtn ) => {
67
+ const { queryByTestId } = renderComponent ( {
68
+ props : {
69
+ execution,
70
+ } ,
71
+ } ) ;
72
+
73
+ expect ( ! ! queryByTestId ( 'retry-execution-button' ) && shouldRenderRetryBtn ) . toBe (
74
+ shouldRenderRetryBtn ,
75
+ ) ;
76
+ } ) ;
77
+ } ) ;
Original file line number Diff line number Diff line change @@ -74,5 +74,12 @@ export const executionHelpers = defineComponent({
74
74
const { date, time } = convertToDisplayDate ( fullDate ) ;
75
75
return locale . baseText ( 'executionsList.started' , { interpolate : { time, date } } ) ;
76
76
} ,
77
+ isExecutionRetriable ( execution : ExecutionSummary ) : boolean {
78
+ return (
79
+ [ 'crashed' , 'error' ] . includes ( execution . status ?? '' ) &&
80
+ ! execution . retryOf &&
81
+ ! execution . retrySuccessId
82
+ ) ;
83
+ } ,
77
84
} ,
78
85
} ) ;
You can’t perform that action at this time.
0 commit comments