File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/components/cylc/cylcObject Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ import {
137
137
mdiPencil
138
138
} from ' @mdi/js'
139
139
import { mapGetters , mapState } from ' vuex'
140
+ import WorkflowState from ' @/model/WorkflowState.model'
140
141
141
142
export default {
142
143
name: ' CylcObjectMenu' ,
@@ -246,8 +247,11 @@ export default {
246
247
},
247
248
isDisabled (mutation , authorised ) {
248
249
if (this .node .type !== ' workflow' ) {
249
- this .workflowStatus = this .getNodes (
250
- ' workflow' , [this .node .tokens .workflow_id ])[0 ].node .status
250
+ const nodeReturned = this .getNodes (
251
+ ' workflow' , [this .node .tokens .workflow_id ])
252
+ if (nodeReturned .length ) {
253
+ this .workflowStatus = nodeReturned[0 ].node .status
254
+ } else { this .workflowStatus = WorkflowState .RUNNING .name }
251
255
} else {
252
256
this .workflowStatus = this .node .node .status
253
257
}
Original file line number Diff line number Diff line change 16
16
*/
17
17
18
18
describe ( 'CylcObject Menu component' , ( ) => {
19
- const collapsedWorkflowMenuLength = 6 // (5 mutations + "show more" btn)
19
+ const collapsedWorkflowMenuLength = 7 // (6 mutations + "show more" btn)
20
20
const expandedWorkflowMenuLength = 21
21
21
22
22
it ( 'should not be displayed initially on load' , ( ) => {
You can’t perform that action at this time.
0 commit comments