@@ -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
@@ -315,25 +315,21 @@ export default {
315
315
return this .cylcTree .$index [this .workflowId ]
316
316
},
317
317
isRunning () {
318
- return (
319
- this .currentWorkflow &&
320
- (
321
- this .currentWorkflow .node .status === WorkflowState .RUNNING .name ||
322
- this .currentWorkflow .node .status === WorkflowState .PAUSED .name ||
323
- this .currentWorkflow .node .status === WorkflowState .STOPPING .name
324
- )
325
- )
318
+ return [
319
+ WorkflowState .RUNNING ,
320
+ WorkflowState .PAUSED ,
321
+ WorkflowState .STOPPING
322
+ ].includes (this .currentWorkflow ? .node .status )
326
323
},
327
324
isPaused () {
328
325
return (
329
- this .currentWorkflow &&
330
- this .currentWorkflow .node .status === WorkflowState .PAUSED .name
326
+ this .currentWorkflow ? .node .status === WorkflowState .PAUSED
331
327
)
332
328
},
333
329
isStopped () {
334
330
return (
335
331
! this .currentWorkflow ||
336
- this .currentWorkflow .node .status === WorkflowState .STOPPED . name
332
+ this .currentWorkflow .node .status === WorkflowState .STOPPED
337
333
)
338
334
},
339
335
statusMsg () {
@@ -356,7 +352,7 @@ export default {
356
352
// the play/pause button
357
353
! this .isStopped &&
358
354
! this .expecting .stop &&
359
- this .currentWorkflow .node .status !== WorkflowState .STOPPING . name &&
355
+ this .currentWorkflow .node .status !== WorkflowState .STOPPING &&
360
356
(
361
357
this .expecting .paused === null ||
362
358
this .expecting .paused === this .isPaused
@@ -428,7 +424,7 @@ export default {
428
424
this .currentWorkflow .id
429
425
).then (response => {
430
426
if (response .status === mutationStatus .SUCCEEDED ) {
431
- this .expecting .stop = WorkflowState .STOPPING
427
+ this .expecting .stop = WorkflowState .STOPPING // Huh?
432
428
}
433
429
})
434
430
},
0 commit comments