@@ -12,6 +12,7 @@ import { TaskLaunchParams } from '../components/tasks.interface';
12
12
import { TaskLaunchValidator } from './task-launch.validator' ;
13
13
import { KvRichTextValidator } from '../../shared/components/kv-rich-text/kv-rich-text.validator' ;
14
14
import { BlockerService } from '../../shared/components/blocker/blocker.service' ;
15
+ import { OrderParams } from '../../shared/components/shared.interface' ;
15
16
16
17
/**
17
18
* Component that provides a launcher of task.
@@ -67,6 +68,7 @@ export class TaskLaunchComponent implements OnInit, OnDestroy {
67
68
* @param {TasksService } tasksService
68
69
* @param {NotificationService } notificationService
69
70
* @param {RoutingStateService } routingStateService
71
+ * @param {BlockerService } blockerService
70
72
* @param {ActivatedRoute } route
71
73
* @param {Router } router
72
74
*/
@@ -86,27 +88,54 @@ export class TaskLaunchComponent implements OnInit, OnDestroy {
86
88
this . task$ = this . route . params
87
89
. pipe (
88
90
mergeMap ( val => this . tasksService . getDefinition ( val . id ) ) ,
91
+ mergeMap ( val => this . tasksService . getTaskExecutions ( {
92
+ sort : 'TASK_EXECUTION_ID' ,
93
+ order : OrderParams . DESC ,
94
+ page : 0 ,
95
+ size : 1 ,
96
+ q : val . name
97
+ } ) . pipe (
98
+ map ( val2 => {
99
+ let parameters = '' ;
100
+ if ( val2 . items . length === 1 ) {
101
+ if ( val2 . items [ 0 ] . deploymentProperties ) {
102
+ parameters = Object . keys ( val2 . items [ 0 ] . deploymentProperties ) . map ( key => {
103
+ if ( val2 . items [ 0 ] . deploymentProperties [ key ] === '******' ) {
104
+ return '' ;
105
+ }
106
+ return `${ key } =${ val2 . items [ 0 ] . deploymentProperties [ key ] } ` ;
107
+ } )
108
+ . filter ( param => ! ! param )
109
+ . join ( '\n' ) ;
110
+ }
111
+ }
112
+ return {
113
+ taskDefinition : val ,
114
+ parameters
115
+ } ;
116
+ } )
117
+ ) ) ,
89
118
mergeMap (
90
119
val => this . tasksService . getPlatforms ( )
91
120
. pipe ( map ( val2 => {
92
121
if ( val2 . length === 0 ) {
93
122
this . form = new FormGroup ( {
94
123
args : new FormControl ( '' , KvRichTextValidator . validateKvRichText ( this . kvValidators . args ) ) ,
95
- props : new FormControl ( '' , KvRichTextValidator . validateKvRichText ( this . kvValidators . props ) ) ,
124
+ props : new FormControl ( val . parameters , KvRichTextValidator . validateKvRichText ( this . kvValidators . props ) ) ,
96
125
platform : new FormControl ( '' )
97
126
} ) ;
98
127
} else {
99
128
this . form = new FormGroup ( {
100
129
args : new FormControl ( '' , KvRichTextValidator . validateKvRichText ( this . kvValidators . args ) ) ,
101
- props : new FormControl ( '' , KvRichTextValidator . validateKvRichText ( this . kvValidators . props ) ) ,
130
+ props : new FormControl ( val . parameters , KvRichTextValidator . validateKvRichText ( this . kvValidators . props ) ) ,
102
131
platform : new FormControl ( '' , Validators . required )
103
132
} ) ;
104
133
}
105
134
if ( val2 . length === 1 ) {
106
135
this . form . get ( 'platform' ) . setValue ( val2 [ 0 ] . name ) ;
107
136
}
108
137
return {
109
- taskDefinition : val ,
138
+ taskDefinition : val . taskDefinition ,
110
139
platforms : val2
111
140
} ;
112
141
} ) )
0 commit comments