@@ -11,6 +11,8 @@ export function useRelaunchOptions(): IPageAction<UnifiedJob>[] {
11
11
const relaunchJob = useRelaunchJob ( ) ;
12
12
const relaunchAllHosts = useRelaunchJob ( { hosts : 'all' } ) ;
13
13
const relaunchFailedHosts = useRelaunchJob ( { hosts : 'failed' } ) ;
14
+ const relaunchRunJobType = useRelaunchJob ( { job_type : 'run' } ) ;
15
+ const relaunchCheckJobType = useRelaunchJob ( { job_type : 'check' } ) ;
14
16
return useMemo (
15
17
( ) => [
16
18
{
@@ -22,9 +24,31 @@ export function useRelaunchOptions(): IPageAction<UnifiedJob>[] {
22
24
label : t ( `Relaunch job` ) ,
23
25
isHidden : ( job : UnifiedJob ) =>
24
26
! ( job . type !== 'system_job' && job . summary_fields ?. user_capabilities ?. start ) ||
25
- ( job . status === 'failed' && job . type === 'job' ) ,
27
+ job . type === 'job' ,
26
28
onClick : ( job : UnifiedJob ) => void relaunchJob ( job ) ,
27
29
} ,
30
+ {
31
+ type : PageActionType . Dropdown ,
32
+ selection : PageActionSelection . Single ,
33
+ isPinned : true ,
34
+ icon : RocketIcon ,
35
+ label : t ( `Relaunch job with` ) ,
36
+ isHidden : ( job : UnifiedJob ) => job . type !== 'job' || job . status === 'failed' ,
37
+ actions : [
38
+ {
39
+ type : PageActionType . Button ,
40
+ selection : PageActionSelection . Single ,
41
+ label : t ( `Job type run` ) ,
42
+ onClick : ( job : UnifiedJob ) => void relaunchRunJobType ( job ) ,
43
+ } ,
44
+ {
45
+ type : PageActionType . Button ,
46
+ selection : PageActionSelection . Single ,
47
+ label : t ( `Job type check` ) ,
48
+ onClick : ( job : UnifiedJob ) => void relaunchCheckJobType ( job ) ,
49
+ } ,
50
+ ] ,
51
+ } ,
28
52
{
29
53
type : PageActionType . Dropdown ,
30
54
selection : PageActionSelection . Single ,
@@ -50,6 +74,13 @@ export function useRelaunchOptions(): IPageAction<UnifiedJob>[] {
50
74
] ,
51
75
} ,
52
76
] ,
53
- [ t , relaunchAllHosts , relaunchFailedHosts , relaunchJob ]
77
+ [
78
+ t ,
79
+ relaunchRunJobType ,
80
+ relaunchCheckJobType ,
81
+ relaunchAllHosts ,
82
+ relaunchFailedHosts ,
83
+ relaunchJob ,
84
+ ]
54
85
) ;
55
86
}
0 commit comments