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:
szymonsztuka
2018-05-18 16:39:55 +01:00
committed by GitHub
parent a38250c100
commit 013eb33d7c
5 changed files with 53 additions and 3 deletions

View File

@ -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} "