mirror of
https://github.com/corda/corda.git
synced 2025-06-12 20:28:18 +00:00
ENT-1574 Progress tracker distinguishes steps which were not processed (#3173)
* Progress Tracker doesn't mark as "green tick" a step which hasn't been set in the flow. Steps behind the current step, which were not processed ('an optional step') are now marked distingishly as green crossed sign for shell and as minus sign for ssh. * Finality Flow sets the current step to NOTARISING only if the actual notarization is performed.
This commit is contained in:
@ -23,6 +23,7 @@ abstract class ANSIProgressRenderer {
|
||||
protected var checkEmoji = false
|
||||
|
||||
protected var treeIndex: Int = 0
|
||||
protected var treeIndexProcessed: MutableSet<Int> = mutableSetOf()
|
||||
protected var tree: List<Pair<Int,String>> = listOf()
|
||||
|
||||
private var installedYet = false
|
||||
@ -55,6 +56,7 @@ abstract class ANSIProgressRenderer {
|
||||
subscriptionIndex?.unsubscribe()
|
||||
subscriptionTree?.unsubscribe()
|
||||
treeIndex = 0
|
||||
treeIndexProcessed.clear()
|
||||
tree = listOf()
|
||||
|
||||
if (!installedYet) {
|
||||
@ -70,8 +72,10 @@ abstract class ANSIProgressRenderer {
|
||||
flowProgressHandle?.apply {
|
||||
stepsTreeIndexFeed?.apply {
|
||||
treeIndex = snapshot
|
||||
treeIndexProcessed.add(snapshot)
|
||||
subscriptionIndex = updates.subscribe({
|
||||
treeIndex = it
|
||||
treeIndexProcessed.add(it)
|
||||
draw(true)
|
||||
}, { done(it) }, { done(null) })
|
||||
}
|
||||
@ -144,7 +148,8 @@ abstract class ANSIProgressRenderer {
|
||||
for ((index, step) in tree.withIndex()) {
|
||||
|
||||
val marker = when {
|
||||
index < treeIndex -> "${Emoji.greenTick} "
|
||||
treeIndexProcessed.contains(index) -> " ${Emoji.greenTick} "
|
||||
index < treeIndex -> " ${Emoji.notRun} "
|
||||
treeIndex == tree.lastIndex -> "${Emoji.greenTick} "
|
||||
index == treeIndex -> "${Emoji.rightArrow} "
|
||||
error -> "${Emoji.noEntry} "
|
||||
|
Reference in New Issue
Block a user