@@ -20,7 +20,7 @@ import { TASK_OUTPUT_NAMES } from '@/model/TaskOutput.model'
20
20
21
21
/**
22
22
* States used when the parent is stopped.
23
- * @type {Array< TaskState> }
23
+ * @type {TaskState[] }
24
24
*/
25
25
const isStoppedOrderedStates = [
26
26
TaskState . SUBMIT_FAILED ,
@@ -35,9 +35,9 @@ const isStoppedOrderedStates = [
35
35
36
36
/**
37
37
* Gives a single state, based on a list of states of children nodes.
38
- * @param childStates {Array< TaskState>} children nodes
39
- * @param isStopped {boolean} whether the parent node is stopped or not
40
- * @returns {string } a valid Task State name, or null if not found
38
+ * @param { TaskState[] } childStates children nodes
39
+ * @param {boolean } isStopped whether the parent node is stopped or not
40
+ * @returns {string } a valid Task State name, or empty string if not found
41
41
* @link @see https://github.com/cylc/cylc-flow/blob/d66ae5c3ce8c749c8178d1cd53cb8c81d1560346/lib/cylc/task_state_prop.py
42
42
*/
43
43
function extractGroupState ( childStates , isStopped = false ) {
@@ -51,10 +51,7 @@ function extractGroupState (childStates, isStopped = false) {
51
51
}
52
52
53
53
function latestJob ( taskProxy ) {
54
- if ( taskProxy && taskProxy . children && taskProxy . children . length > 0 ) {
55
- return taskProxy . children [ 0 ] . node
56
- }
57
- return null
54
+ return taskProxy ?. children ?. [ 0 ] ?. node
58
55
}
59
56
60
57
/** Returns an array of task messages and custom outputs for a job node.
0 commit comments