@@ -124,6 +124,7 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
124
124
endTime : Date | undefined ,
125
125
previousStatus : string ,
126
126
isFirstStep : boolean ,
127
+ isLastStep : boolean ,
127
128
stepProgress : StepProgress ,
128
129
stepId : number ,
129
130
isCurrentlyProcessing : boolean
@@ -136,10 +137,11 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
136
137
second : '2-digit' ,
137
138
} )
138
139
const stepDuration = convertToTimeString ( endTime . getTime ( ) - startTime . getTime ( ) )
140
+ const isAllStepsComplete = isLastStep && ( stepProgress === StepProgress . Succeeded || StepProgress . Failed )
139
141
return `
140
- <p class="step" id="step-${ stepId } ">
141
- ${ this . getProgressIconMarkup ( stepProgress ) } ${ name } [finished on ${ stepTime } ]
142
- <span> ${ stepDuration } </span>
142
+ <p class="step ${ isAllStepsComplete ? 'active' : '' } " id="step-${ stepId } ">
143
+ ${ this . getProgressIconMarkup ( stepProgress ) } ${ name }
144
+ <span id="step-duration">[finished on ${ stepTime } ] ${ stepDuration } </span>
143
145
</p>`
144
146
} else if ( previousStatus !== 'CREATED' && isCurrentlyProcessing ) {
145
147
return `
@@ -170,14 +172,14 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
170
172
// In case transform is cancelled by user, the state transitions to not started after some time.
171
173
// This may contradict the last result from the API, so need to be handled here.
172
174
if ( transformByQState . isNotStarted ( ) ) {
173
- return '<p><span class="status-FAILED"> ⓧ </span></p>'
175
+ return '<p><span class="status-FAILED"> 𐔧 </span></p>'
174
176
}
175
177
return '<p><span class="spinner status-PENDING"> ↻ </span></p>'
176
178
case 'COMPLETED' :
177
179
return '<p><span class="status-COMPLETED"> ✓ </span></p>'
178
180
case 'FAILED' :
179
181
default :
180
- return '<p><span class="status-FAILED"> ⓧ </span></p>'
182
+ return '<p><span class="status-FAILED"> 𐔧 </span></p>'
181
183
}
182
184
}
183
185
@@ -189,7 +191,7 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
189
191
<div class="substep-icon">${ this . selectSubstepIcon ( subStep . status ) } </div>
190
192
<div>
191
193
<p>${ subStep . name } </p>
192
- ${ subStep . description ? `<p class="status-${ subStep . status } ">- ${ subStep . description } </p>` : '' }
194
+ ${ subStep . description ? `<p class="status-${ subStep . status } "> ${ subStep . description } </p>` : '' }
193
195
</div>
194
196
</div>
195
197
` )
@@ -229,6 +231,7 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
229
231
step . endTime ,
230
232
stepStatuses [ i - 1 ] ,
231
233
i === 0 ,
234
+ i === planSteps . length - 1 ,
232
235
stepProgress ,
233
236
i ,
234
237
lastPendingStep === i
@@ -297,20 +300,19 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
297
300
transformByQState . setPlanSteps ( planSteps )
298
301
}
299
302
let progressHtml
300
- if ( planProgress [ 'transformCode' ] !== StepProgress . NotStarted ) {
301
- const isTransformFailed = planProgress [ 'transformCode' ] === StepProgress . Failed
303
+ // for each step that has succeeded, increment activeStepId by 1
304
+ let activeStepId = [
305
+ planProgress . startJob ,
306
+ planProgress . buildCode ,
307
+ planProgress . generatePlan ,
308
+ planProgress . transformCode ,
309
+ ]
310
+ . map ( it => ( it === StepProgress . Succeeded ? 1 : 0 ) as number )
311
+ . reduce ( ( prev , current ) => prev + current )
312
+ // When we receive plan step details, we want those to be active -> increment activeStepId
313
+ activeStepId += planSteps === undefined || planSteps . length === 0 ? 0 : 1
302
314
303
- // for each step that has succeeded, increment activeStepId by 1
304
- let activeStepId = [
305
- planProgress . startJob ,
306
- planProgress . buildCode ,
307
- planProgress . generatePlan ,
308
- planProgress . transformCode ,
309
- ]
310
- . map ( it => ( it === StepProgress . Succeeded ? 1 : 0 ) as number )
311
- . reduce ( ( prev , current ) => prev + current )
312
- // When we receive plan step details, we want those to be active -> increment activeStepId
313
- activeStepId += planSteps === undefined || planSteps . length === 0 ? 0 : 1
315
+ if ( planProgress [ 'transformCode' ] !== StepProgress . NotStarted ) {
314
316
const waitingMarkup = simpleStep (
315
317
this . getProgressIconMarkup ( planProgress [ 'startJob' ] ) ,
316
318
'Waiting for job to start' ,
@@ -341,12 +343,12 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
341
343
)
342
344
: ''
343
345
346
+ const isTransformFailed = planProgress [ 'transformCode' ] === StepProgress . Failed
344
347
const progress = this . getTransformationStepProgressMarkup ( planSteps , isTransformFailed )
345
348
const latestGenericStepDetails = this . getLatestGenericStepDetails ( transformByQState . getPolledJobStatus ( ) )
346
349
progressHtml = `
347
- <div class="column">
348
- <div id="runningTime" style="flex:1; overflow: auto;"></div>
349
- <p><b>Transformation Progress</b></p>
350
+ <div id="progress" class="column">
351
+ <p><b>Transformation Progress</b> <span id="runningTime"></span></p>
350
352
${ waitingMarkup }
351
353
${ buildMarkup }
352
354
${ planMarkup }
@@ -367,7 +369,7 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
367
369
`
368
370
} else {
369
371
progressHtml = `
370
- <div class="column">
372
+ <div id="progress" class="column">
371
373
<p><b>Transformation Progress</b></p>
372
374
<p>No job ongoing</p>
373
375
</div>`
@@ -430,10 +432,15 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
430
432
}
431
433
432
434
#stepdetails {
433
- padding-left: 20px;
434
- border-left: solid lightgray;
435
+ width: 40%;
436
+ padding: 0 20px;
437
+ border-left: solid rgba(229,229,229, .5);
435
438
min-height: 100vh;
436
- ${ transformByQState . isRunning ( ) || ! transformByQState . isNotStarted ( ) ? '' : 'display: none;' }
439
+ display: block;
440
+ }
441
+
442
+ #progress {
443
+ width: 60%;
437
444
}
438
445
439
446
.status-PENDING {
@@ -471,6 +478,10 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
471
478
align-items: center;
472
479
justify-content: center;
473
480
}
481
+
482
+ #step-duration {
483
+ color: rgba(59, 59, 59, .75);
484
+ }
474
485
</style>
475
486
</head>
476
487
<body>
@@ -520,23 +531,13 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
520
531
function showStepDetails(item) {
521
532
const visibleSubSteps = document.querySelectorAll(".visible");
522
533
const substep = document.getElementById(item.id.replace("step-", "substep-"))
523
- document.getElementById("stepdetails").style.display = "none"
524
- let substepWasAlreadyVisible = false
525
534
clearActiveSteps()
526
535
for(const visibleSubStep of visibleSubSteps){
527
536
visibleSubStep.classList.remove("visible")
528
537
document.getElementById(visibleSubStep.id.replace("substep-", "step-")).classList.remove("active")
529
- if(visibleSubStep === substep){
530
- substepWasAlreadyVisible = true
531
- }
532
- }
533
-
534
- if(substepWasAlreadyVisible){
535
- return
536
538
}
537
539
538
540
substep.classList.add("visible")
539
- document.getElementById("stepdetails").style.display = "block"
540
541
item.classList.add("active")
541
542
document.getElementById("generic-step-details").classList.add("blocked")
542
543
}
@@ -547,7 +548,6 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
547
548
if(document.getElementById("generic-step-details").classList.contains("blocked")){
548
549
return
549
550
}
550
- document.getElementById("stepdetails").style.display = "block"
551
551
document.getElementById("generic-step-details").classList.add("visible")
552
552
}
553
553
@@ -583,6 +583,7 @@ export class TransformationHubViewProvider implements vscode.WebviewViewProvider
583
583
addShowSubstepEventListeners();
584
584
addHighlightStepWithoutSubstepListeners();
585
585
showCurrentActiveSubstep();
586
+ updateTimer()
586
587
</script>
587
588
</body>
588
589
</html>`
0 commit comments