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