Skip to content

Commit 429c5c8

Browse files
committed
Include preparing tasks in submitted task state badge total
1 parent bd46b82 commit 429c5c8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/components/cylc/TaskStateBadge.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
location="top"
2626
:open-delay="400"
2727
>
28-
{{ value }} {{ state }} task{{ value > 1 ? 's': '' }}.
28+
{{ value }} {{ displayName }} task{{ value > 1 ? 's': '' }}.
2929
<template v-if="latestTasks?.length">
3030
Latest:
3131
<span
@@ -41,7 +41,9 @@
4141
</template>
4242

4343
<script setup>
44-
defineProps({
44+
import { computed } from 'vue'
45+
46+
const props = defineProps({
4547
state: {
4648
type: String,
4749
required: true
@@ -56,4 +58,8 @@ defineProps({
5658
required: false,
5759
},
5860
})
61+
62+
const displayName = computed(
63+
() => props.state === 'submitted' ? 'preparing/submitted' : props.state
64+
)
5965
</script>

src/components/cylc/tree/GScanTreeItem.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ function getStateTotals (node, stateTotals = {}) {
117117
118118
// the non-zero state totals from this node with all the others from the tree
119119
for (const state of taskStatesOrdered) {
120-
const nodeTotal = node.node.stateTotals[state]
120+
let nodeTotal = node.node.stateTotals[state]
121+
if (state === TaskState.SUBMITTED.name) { // include preparing tasks
122+
nodeTotal += node.node.stateTotals.preparing
123+
}
121124
if (nodeTotal) {
122125
stateTotals[state] = (stateTotals[state] ?? 0) + nodeTotal
123126
}

0 commit comments

Comments
 (0)