Skip to content

Commit 6f4724d

Browse files
authored
Merge pull request #2378 from oliver-sanders/ui-2350
workflows: add is_retry and is_held indicators
2 parents 79c337b + 44b76e7 commit 6f4724d

File tree

11 files changed

+72
-23
lines changed

11 files changed

+72
-23
lines changed

changes.d/2378.feat.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added held and retry icons to the workflows sidebar, these will indicate if any n=0 tasks are in these states.

src/components/cylc/TaskStateBadge.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
:class="state"
2222
>
2323
{{ value }}
24-
<v-tooltip
25-
location="top"
26-
:open-delay="400"
27-
>
24+
<v-tooltip>
2825
{{ value }} {{ displayName }} task{{ value > 1 ? 's': '' }}.
2926
<template v-if="latestTasks?.length">
3027
Latest:

src/components/cylc/WarningIcon.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3333
:activator="null"
3434
location="bottom"
3535
:disabled="!workflow.node.logRecords?.length"
36-
:open-delay="400"
3736
>
3837
<template
3938
v-slot:activator="{ props }"

src/components/cylc/gscan/GScan.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
9595
v-else
9696
class="c-gscan-workflows flex-grow-1 pl-2"
9797
>
98-
<Tree
99-
:workflows="workflows"
100-
:node-filter-func="filterNode"
101-
tree-item-component="GScanTreeItem"
102-
class="c-gscan-workflow pa-0"
103-
ref="tree"
104-
v-bind="{ filterState }"
105-
/>
98+
<v-defaults-provider :defaults="{
99+
VTooltip: {
100+
location: 'top',
101+
openDelay: 400,
102+
eager: false,
103+
}
104+
}">
105+
<Tree
106+
:workflows="workflows"
107+
:node-filter-func="filterNode"
108+
tree-item-component="GScanTreeItem"
109+
class="c-gscan-workflow pa-0"
110+
ref="tree"
111+
v-bind="{ filterState }"
112+
/>
113+
</v-defaults-provider>
106114
</div>
107115
<!-- when no workflows are returned in the GraphQL query -->
108116
<div v-if="!workflows.length">

src/components/cylc/tree/GScanTreeItem.vue

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4040
<div class="c-gscan-workflow-name flex-grow-1">
4141
<span>
4242
{{ node.name || node.id }}
43-
<v-tooltip
44-
location="top"
45-
style="overflow-wrap: anywhere;"
46-
>
43+
<v-tooltip style="overflow-wrap: anywhere;">
4744
{{ node.id }}
4845
</v-tooltip>
4946
</span>
5047
</div>
51-
<div class="d-flex c-gscan-workflow-states flex-grow-0">
48+
<div class="d-flex c-gscan-workflow-states flex-grow-0 align-center">
49+
<v-icon
50+
v-for="modifier in statesInfo.modifiers"
51+
:key="modifier"
52+
:icon="modifierIcons[modifier]"
53+
v-tooltip="`Has ${modifier} tasks.`"
54+
size="1em"
55+
class="modifier-badge"
56+
:class="modifier"
57+
/>
5258
<TaskStateBadge
5359
v-for="(value, state) in statesInfo.stateTotals"
5460
:key="state"
@@ -86,6 +92,7 @@ import TreeItem from '@/components/cylc/tree/TreeItem.vue'
8692
import WarningIcon from '@/components/cylc/WarningIcon.vue'
8793
import TaskState from '@/model/TaskState.model'
8894
import { WorkflowState } from '@/model/WorkflowState.model'
95+
import { taskHeld, taskRetry } from '@/utils/icons'
8996
import { useCompactMode, useWorkflowWarnings } from '@/composables/localStorage'
9097
9198
const nodeTypes = ['workflow-part', 'workflow']
@@ -98,27 +105,40 @@ const taskStatesOrdered = [
98105
TaskState.RUNNING.name,
99106
]
100107
108+
const modifierIcons = {
109+
held: taskHeld,
110+
retrying: taskRetry,
111+
}
112+
101113
/**
102114
* Get aggregated task state totals for all descendents of a node.
103115
*
104116
* Also get latest state tasks for workflow nodes.
105117
*
106118
* @param {Object} node
107119
* @param {Record<string, number>} stateTotals - Accumulator for state totals.
120+
* @param {Set<string>} modifiers - Accumulator for modifier states.
108121
*/
109-
function getStatesInfo (node, stateTotals = {}) {
122+
function getStatesInfo (node, stateTotals = {}, modifiers = new Set()) {
110123
const latestTasks = {}
111124
// if we aren't at the end of the node tree, continue recurse until we hit something other then a workflow part
112125
if (node.type === 'workflow-part' && node.children) {
113126
// at every branch, recurse all child nodes except stopped workflows
114127
for (const child of node.children) {
115128
if (child.node.status !== WorkflowState.STOPPED.name) {
116-
getStatesInfo(child, stateTotals, latestTasks)
129+
getStatesInfo(child, stateTotals, modifiers)
117130
}
118131
}
119132
} else if (node.type === 'workflow' && node.node.stateTotals) {
120133
// if we hit a workflow node, stop and merge state
121134
135+
if (node.node.containsHeld) {
136+
modifiers.add('held')
137+
}
138+
if (node.node.containsRetry) {
139+
modifiers.add('retrying')
140+
}
141+
122142
// the non-zero state totals from this node with all the others from the tree
123143
for (const state of taskStatesOrdered) {
124144
let nodeTotal = node.node.stateTotals[state]
@@ -138,7 +158,7 @@ function getStatesInfo (node, stateTotals = {}) {
138158
}
139159
}
140160
}
141-
return { stateTotals, latestTasks }
161+
return { stateTotals, latestTasks, modifiers }
142162
}
143163
144164
const workflowWarnings = useWorkflowWarnings()

src/components/cylc/workspace/Toolbar.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
142142
:icon="$options.icons.info"
143143
id="info-icon"
144144
/>
145-
<v-tooltip v-if="isRunning" activator="#info-icon">
145+
<v-tooltip
146+
v-if="isRunning"
147+
activator="#info-icon"
148+
:eager="false"
149+
>
146150
<dl>
147151
<dt><strong>Owner:</strong> {{ currentWorkflow.node.owner }}</dt>
148152
<dt><strong>Host:</strong> {{ currentWorkflow.node.host }}</dt>

src/services/mock/json/workflows/one.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
"failed": 2,
2323
"succeeded": 2
2424
},
25+
"containsHeld": true,
26+
"containsRetry": true,
2527
"latestStateTasks": {
2628
"submitted": [],
2729
"running": [

src/styles/cylc/_job.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ $cjob: ".c-job .job rect";
3939
min-width: $height;
4040
border-radius: $height;
4141
border: 0.2em solid;
42-
margin: 0 0.1em;
4342
line-height: normal;
43+
margin: 0 1px;
44+
}
45+
.modifier-badge {
46+
margin: 0 2px;
4447
}
4548

4649
$teal: rgb(109,213,194);

src/utils/icons.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@
3030
import { siJupyter } from 'simple-icons'
3131

3232
export const jupyterLogo = siJupyter.svg.replace(/.*d="(.*)".*/, '$1')
33+
export const taskRetry = 'm14.7 2.5c-0.179-0.0044-0.358-0.0037-0.538 0.0021-0.958 0.031-1.92 0.208-2.86 0.539-3.3 1.17-5.65 4.05-6.2 7.44l-5.13-1.23 6.86 9.23 6.86-9.23-5.35 1.19c0.511-2.02 2-3.69 4.02-4.41 2.5-0.886 5.28-0.124 6.98 1.91 1.7 2.04 1.95 4.91 0.625 7.21-1.32 2.3-3.93 3.53-6.54 3.09a1.58 1.58 0 0 0-1.82 1.3 1.58 1.58 0 0 0 1.3 1.82c3.91 0.661 7.84-1.19 9.81-4.63 1.98-3.44 1.6-7.76-0.938-10.8-1.79-2.14-4.39-3.35-7.07-3.41z'
34+
export const taskHeld = 'm12 0.5c-6.34 0-11.5 5.17-11.5 11.5-1.9e-7 6.33 5.16 11.5 11.5 11.5 6.34 0 11.5-5.17 11.5-11.5 0-6.33-5.16-11.5-11.5-11.5zm0 2.74c4.85 0 8.76 3.9 8.76 8.76 0 4.85-3.9 8.76-8.76 8.76-4.85 0-8.76-3.9-8.76-8.76 0-4.85 3.9-8.76 8.76-8.76zm-3.2 2.36a2.05 2.05 0 0 0-2.05 2.05v8.7a2.05 2.05 0 0 0 2.05 2.05 2.05 2.05 0 0 0 2.05-2.05v-8.7a2.05 2.05 0 0 0-2.05-2.05zm6.4 0a2.05 2.05 0 0 0-2.05 2.05v8.7a2.05 2.05 0 0 0 2.05 2.05 2.05 2.05 0 0 0 2.05-2.05v-8.7a2.05 2.05 0 0 0-2.05-2.05z'

src/views/Workflows.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ fragment WorkflowData on Workflow {
6161
status
6262
statusMsg
6363
stateTotals
64+
containsHeld
65+
containsRetry
6466
logRecords {
6567
level
6668
message

0 commit comments

Comments
 (0)