Skip to content

Commit 0d84c55

Browse files
authored
Merge pull request #114 from oliver-sanders/disable-buttons-for-invalid-states
aotf: don't shortlist state-disabled mutations
2 parents 8ca0008 + 17e08ab commit 0d84c55

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/components/cylc/cylcObject/Menu.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,15 @@ export default {
196196
}
197197
const shortList = this.primaryMutations
198198
if (!this.expanded && shortList.length) {
199-
return this.mutations.filter(
200-
x => shortList.includes(x.mutation.name)
201-
).sort(
202-
(x, y) => shortList.indexOf(x.mutation.name) - shortList.indexOf(y.mutation.name)
203-
)
199+
return this.mutations
200+
// filter for shortlisted mutations
201+
.filter(x => shortList.includes(x.mutation.name))
202+
// filter out mutations which aren't relevant to the workflow state
203+
.filter(x => !this.isDisabled(x.mutation, true))
204+
// sort by definition order
205+
.sort(
206+
(x, y) => shortList.indexOf(x.mutation.name) - shortList.indexOf(y.mutation.name)
207+
)
204208
}
205209
return this.mutations
206210
},

src/utils/aotf.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export const cylcObjects = Object.freeze({
168168
export const primaryMutations = {
169169
[cylcObjects.Workflow]: [
170170
'play',
171+
'resume',
171172
'pause',
172173
'stop',
173174
'reload',

0 commit comments

Comments
 (0)