Skip to content

Commit 9dff09d

Browse files
committed
Update task modifiers
* Xtrigger modifier * Retry modifier * Wallclock modifier * Refactor exisiting icons to use fewer DOM elements where possible * Add component test * Added logic ordering things in task view. * Added new modifiers to the guide page Responses to review * Suggestions from @MetRonnie Co-authored-by: Ronnie Dutta <[email protected]> fix spelling error update lock file after rebase fill in dot of xtriggers
1 parent ea2e606 commit 9dff09d

File tree

12 files changed

+300
-80
lines changed

12 files changed

+300
-80
lines changed

changes.d/2190.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added icon modifiers for tasks waiting on failure-retry, xtriggers or wallclock.

src/components/cylc/SVGTask.vue

Lines changed: 137 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2424
<template>
2525
<g
2626
class="c8-task"
27-
:class="{
28-
[task.state]: true,
29-
held: task.isHeld,
30-
queued: task.isQueued && !task.isHeld,
31-
runahead: task.isRunahead && !(task.isHeld || task.isQueued),
32-
}"
27+
:class="[task.state, modifier]"
3328
>
3429
<!-- status
3530
@@ -122,6 +117,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
122117
</g>
123118
<!-- expired
124119
120+
A clock face, at about 5pm.
125121
-->
126122
<g
127123
class="expired"
@@ -175,26 +171,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
175171
/>
176172
<!-- held
177173
178-
Paused icon representing isHeld.
174+
Paused icon representing isHeld. Shown inside the outline
175+
circle.
179176
-->
180177
<g
181178
class="held"
182179
>
183-
<rect
184-
x="30"
185-
y="25"
186-
width="16"
187-
height="50"
188-
rx="10"
189-
ry="10"
190-
/>
191-
<rect
192-
x="54"
193-
y="25"
194-
width="16"
195-
height="50"
196-
rx="10"
197-
ry="10"
180+
<path
181+
d="
182+
m37,33
183+
l0 34
184+
m25,0
185+
l0, -34
186+
"
198187
/>
199188
</g>
200189
<!-- queued
@@ -204,29 +193,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
204193
<g
205194
class="queued"
206195
>
207-
<rect
208-
x="20"
209-
y="20"
210-
width="60"
211-
height="16"
212-
rx="10"
213-
ry="10"
214-
/>
215-
<rect
216-
x="20"
217-
y="41"
218-
width="60"
219-
height="16"
220-
rx="10"
221-
ry="10"
222-
/>
223-
<rect
224-
x="20"
225-
y="62"
226-
width="60"
227-
height="16"
228-
rx="10"
229-
ry="10"
196+
<path
197+
d="
198+
m28,28
199+
l43 0
200+
m-43,21
201+
l43, 0
202+
m-43,21
203+
l43 0
204+
"
230205
/>
231206
</g>
232207
<!-- runahead
@@ -242,6 +217,56 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
242217
r="20"
243218
/>
244219
</g>
220+
221+
<!-- xtriggered
222+
223+
Radio signal (similar to RSS logo) representing waiting on xtrigger(s).
224+
-->
225+
<g class="xtriggered">
226+
<path
227+
d="
228+
m10,70
229+
a60, 60, 0, 0, 1, 60, -60
230+
m-40, 60
231+
a40, 40 0, 0, 1, 40, -40
232+
m-6, 27
233+
a9,9, 0, 1, 0, .1, 0
234+
m0, 4
235+
a6,6, 0, 1, 0, .1, 0
236+
"
237+
/>
238+
</g>
239+
240+
<!-- Retry
241+
242+
Circular arrow representing a retry.
243+
-->
244+
<g class="retry">
245+
<!-- An arc describing the arrow -->
246+
<path d="m25, 50 a30 30 1 1 1 25 30 "/>
247+
<!-- The arrowhead -->
248+
<polygon points="0,40 26,75 52,40, 25,46"/>
249+
</g>
250+
251+
<!-- Wallclock
252+
253+
A clock face representing an unsatisfied wallclock trigger.
254+
255+
The path is just the hands of the clock. The icon is created in
256+
combination with the outline circle.
257+
-->
258+
<g class="wallclock">
259+
<path
260+
d="
261+
m50, 18
262+
l0, 36
263+
l14, 14
264+
l3,3
265+
l3,-3
266+
l-18, -18
267+
"
268+
/>
269+
</g>
245270
</g>
246271
</g>
247272
</template>
@@ -275,6 +300,17 @@ const props = defineProps({
275300
*/
276301
const animResetTime = inject('animResetTime', () => ref(0), true)
277302
303+
// Get modifier (if any) for the task state.
304+
const modifier = computed(() => {
305+
if (props.task.isHeld) return 'held'
306+
if (props.task.isQueued) return 'queued'
307+
if (props.task.isRunahead) return 'runahead'
308+
if (props.task.isRetry) return 'retry'
309+
if (props.task.isWallclock) return 'wallclock'
310+
if (props.task.isXtriggered) return 'xtriggered'
311+
return ''
312+
})
313+
278314
const runningStyle = computed(() => {
279315
if (
280316
props.task.state === TaskState.RUNNING.name &&
@@ -381,6 +417,18 @@ const modifierTransform = _getModifierTransform()
381417
fill: none;
382418
stroke: none;
383419
}
420+
.wallclock {
421+
fill: none;
422+
stroke: none;
423+
}
424+
.xtriggered {
425+
fill: none;
426+
stroke: none;
427+
}
428+
.retry {
429+
fill: none;
430+
stroke: none;
431+
}
384432
}
385433
386434
&.preparing .status .dot {
@@ -436,14 +484,18 @@ const modifierTransform = _getModifierTransform()
436484
.outline {
437485
stroke: $foreground;
438486
}
439-
.held rect {
440-
fill: $foreground;
487+
.held path {
488+
stroke: $foreground;
489+
stroke-linecap: round;
490+
stroke-width: 16px;
441491
}
442492
}
443493
444494
&.queued .modifier {
445-
.queued rect {
446-
fill: $foreground;
495+
.queued path {
496+
stroke: $foreground;
497+
stroke-linecap: round;
498+
stroke-width: 16px;
447499
}
448500
}
449501
@@ -456,6 +508,42 @@ const modifierTransform = _getModifierTransform()
456508
}
457509
}
458510
511+
&.xtriggered .modifier {
512+
.xtriggered {
513+
stroke: $foreground;
514+
stroke-width: 12px;
515+
stroke-linecap: round;
516+
fill: none;
517+
}
518+
}
519+
520+
&.wallclock .modifier {
521+
.outline {
522+
fill: $background;
523+
stroke: $foreground;
524+
stroke-width: 7px;
525+
}
526+
.wallclock {
527+
stroke: $foreground;
528+
stroke-width: 8px;
529+
fill: none;
530+
stroke-linecap: round;
531+
stroke-linejoin: round;
532+
}
533+
}
534+
535+
&.retry .modifier {
536+
.retry path {
537+
stroke: $foreground;
538+
stroke-width: 12px;
539+
stroke-linecap: round;
540+
}
541+
.retry polygon {
542+
stroke: none;
543+
fill: $foreground;
544+
}
545+
}
546+
459547
&.running .progress {
460548
animation-name: c8-task-progress-animation;
461549
animation-timing-function: steps(50);

src/components/cylc/Task.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ export default {
4848
// Scale the size of the task state modifier
4949
type: Number,
5050
default: 0.7
51-
}
51+
},
5252
},
5353
components: {
5454
SVGTask
55-
}
55+
},
5656
}
5757
</script>
5858

src/services/mock/json/infoView.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,27 @@
7676
],
7777

7878
"runtime": {
79-
"completion": "succeeded"
80-
}
79+
"completion": "succeeded",
80+
"runMode": "Live"
81+
},
82+
83+
"xtriggers": [
84+
{
85+
"label": "xtrigger",
86+
"id": "myxt(foo=42)",
87+
"satisfied": true
88+
},
89+
{
90+
"label": "another xtrigger",
91+
"id": "myxt(foo=41)",
92+
"satisfied": false
93+
},
94+
{
95+
"label": "clock xtrigger",
96+
"id": "wall_clock(trigger_time=440121600)",
97+
"satisfied": true
98+
}
99+
]
81100
}
82101
]
83102
}

src/views/Graph.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ fragment TaskProxyData on TaskProxy {
167167
isHeld
168168
isRunahead
169169
isQueued
170+
isRetry
171+
isWallclock
172+
isXtriggered
170173
name
171174
task {
172175
meanElapsedTime

src/views/Guide.vue

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
113113
</v-list-item-title>
114114
<v-list-item-subtitle>
115115
The task is not ready to run yet - it is still waiting on
116-
upstream <b>dependencies</b> or <b>xtriggers</b>.
116+
upstream <b>dependencies</b> (or old style
117+
external triggers).
117118
</v-list-item-subtitle>
118119
</v-list-item>
119120
<v-list-item>
@@ -165,16 +166,59 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
165166
which restricts the number of active cycle points.
166167
</v-list-item-subtitle>
167168
</v-list-item>
169+
<v-list-item>
170+
<template v-slot:prepend>
171+
<task
172+
style="font-size: 2em;"
173+
:task="{state: 'waiting', isRetry: true}"
174+
class="mr-4"
175+
/>
176+
</template>
177+
<v-list-item-title>
178+
Retry
179+
</v-list-item-title>
180+
<v-list-item-subtitle>
181+
The task is waiting to retry running after
182+
a configured <b>submission or execution retry delay</b>.
183+
It will then attempt to run the job again.
184+
</v-list-item-subtitle>
185+
</v-list-item>
186+
<v-list-item>
187+
<template v-slot:prepend>
188+
<task
189+
style="font-size: 2em;"
190+
:task="{state: 'waiting', isWallclock: true}"
191+
class="mr-4"
192+
/>
193+
</template>
194+
<v-list-item-title>
195+
Wallclock
196+
</v-list-item-title>
197+
<v-list-item-subtitle>
198+
This task is waiting for a wallclock trigger.
199+
</v-list-item-subtitle>
200+
</v-list-item>
201+
<v-list-item>
202+
<template v-slot:prepend>
203+
<task
204+
style="font-size: 2em;"
205+
:task="{state: 'waiting', isXtriggered: true}"
206+
class="mr-4"
207+
/>
208+
</template>
209+
<v-list-item-title>
210+
Xtriggered
211+
</v-list-item-title>
212+
<v-list-item-subtitle>
213+
This task is waiting for an <b>xtrigger</b>.
214+
</v-list-item-subtitle>
215+
</v-list-item>
168216
</v-list>
169217
<p>
170218
<em>Note: tasks downstream of queued (or runahead limited) tasks
171219
are not themselves shown as queued (or runahead limited)
172220
because they are not otherwise ready to run yet.</em>
173221
</p>
174-
<p>
175-
<em>Note: external triggers (e.g. clock triggers) are not yet
176-
exposed in the UI.</em>
177-
</p>
178222
</v-card-text>
179223
</v-card>
180224
</v-col>

src/views/Info.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ fragment TaskProxyData on TaskProxy {
7070
isHeld
7171
isQueued
7272
isRunahead
73+
isRetry
74+
isWallclock
75+
isXtriggered
7376
7477
task {
7578
...TaskDefinitionData

0 commit comments

Comments
 (0)