@@ -214,7 +214,7 @@ import {
214
214
import { startCase } from ' lodash'
215
215
import { until } from ' @/utils'
216
216
import { useToolbar , toolbarHeight } from ' @/utils/toolbar'
217
- import WorkflowState from ' @/model/WorkflowState.model'
217
+ import { WorkflowState } from ' @/model/WorkflowState.model'
218
218
import graphql from ' @/mixins/graphql'
219
219
import {
220
220
mutationStatus
@@ -321,25 +321,21 @@ export default {
321
321
return this .cylcTree .$index [this .workflowId ]
322
322
},
323
323
isRunning () {
324
- return (
325
- this .currentWorkflow &&
326
- (
327
- this .currentWorkflow .node .status === WorkflowState .RUNNING .name ||
328
- this .currentWorkflow .node .status === WorkflowState .PAUSED .name ||
329
- this .currentWorkflow .node .status === WorkflowState .STOPPING .name
330
- )
331
- )
324
+ return [
325
+ WorkflowState .RUNNING ,
326
+ WorkflowState .PAUSED ,
327
+ WorkflowState .STOPPING
328
+ ].includes (this .currentWorkflow ? .node .status )
332
329
},
333
330
isPaused () {
334
331
return (
335
- this .currentWorkflow &&
336
- this .currentWorkflow .node .status === WorkflowState .PAUSED .name
332
+ this .currentWorkflow ? .node .status === WorkflowState .PAUSED
337
333
)
338
334
},
339
335
isStopped () {
340
336
return (
341
337
! this .currentWorkflow ||
342
- this .currentWorkflow .node .status === WorkflowState .STOPPED . name
338
+ this .currentWorkflow .node .status === WorkflowState .STOPPED
343
339
)
344
340
},
345
341
statusMsg () {
@@ -362,7 +358,7 @@ export default {
362
358
// the play/pause button
363
359
! this .isStopped &&
364
360
! this .expecting .stop &&
365
- this .currentWorkflow .node .status !== WorkflowState .STOPPING . name &&
361
+ this .currentWorkflow .node .status !== WorkflowState .STOPPING &&
366
362
(
367
363
this .expecting .paused === null ||
368
364
this .expecting .paused === this .isPaused
@@ -434,7 +430,7 @@ export default {
434
430
this .currentWorkflow .id
435
431
).then (response => {
436
432
if (response .status === mutationStatus .SUCCEEDED ) {
437
- this .expecting .stop = WorkflowState .STOPPING
433
+ this .expecting .stop = WorkflowState .STOPPING // Huh?
438
434
}
439
435
})
440
436
},
0 commit comments