Skip to content

Commit

Permalink
metadata view: introduce a minimal task metadata view
Browse files Browse the repository at this point in the history
* Bare bones task metadata view.
* Display task metadata, prerequisites and outputs.
* Support for viewing task configuration, broadcasts, etc to follow in
  future PRs.
* Support for markup (e.g. markdown & reStructured text) to arrive in
  future PRs (pending a decision on how to configure the markup
  language).
  • Loading branch information
oliver-sanders committed Aug 8, 2024
1 parent a414004 commit 2e5c1b5
Show file tree
Hide file tree
Showing 5 changed files with 499 additions and 12 deletions.
19 changes: 18 additions & 1 deletion src/components/cylc/commandMenu/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default {
methods: {
isEditable (mutation, authorised) {
return mutation.name !== 'log' && !this.isDisabled(mutation, authorised)
return mutation.name !== 'log' && mutation.name !== 'info' && !this.isDisabled(mutation, authorised)
},
isDisabled (mutation, authorised) {
if (!authorised) {
Expand Down Expand Up @@ -269,6 +269,23 @@ export default {
}
)
})
} else if (mutation.name === 'info') {
this.$router.push({

Check warning on line 273 in src/components/cylc/commandMenu/Menu.vue

View check run for this annotation

Codecov / codecov/patch

src/components/cylc/commandMenu/Menu.vue#L273

Added line #L273 was not covered by tests
name: 'Workspace',
params: {
workflowName: this.node.tokens.workflow
}
}).then(() => {
eventBus.emit(

Check warning on line 279 in src/components/cylc/commandMenu/Menu.vue

View check run for this annotation

Codecov / codecov/patch

src/components/cylc/commandMenu/Menu.vue#L279

Added line #L279 was not covered by tests
'add-view',
{
name: 'Info',
initialOptions: {
requestedTokens: this.node.tokens || undefined
}
}
)
})
} else {
mutate(
mutation,
Expand Down
16 changes: 13 additions & 3 deletions src/utils/aotf.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
mdiDelete,
mdiEmail,
mdiFileDocumentOutline,
mdiVectorPolylineEdit,
mdiInformationOutline,
mdiMinusCircleOutline,
mdiPause,
mdiPauseCircleOutline,
Expand All @@ -44,7 +44,8 @@ import {
mdiPlaylistEdit,
mdiRefreshCircle,
mdiReload,
mdiStop
mdiStop,
mdiVectorPolylineEdit,
} from '@mdi/js'

import { Alert } from '@/model/Alert.model'
Expand Down Expand Up @@ -128,6 +129,7 @@ export function getMutationIcon (name) {
case 'clean': return mdiDelete
case 'editRuntime': return mdiPlaylistEdit
case 'hold': return mdiPauseCircleOutline // to distinguish from pause
case 'info': return mdiInformationOutline
case 'kill': return mdiCloseCircle
case 'log': return mdiFileDocumentOutline
case 'message': return mdiEmail
Expand Down Expand Up @@ -188,6 +190,7 @@ export const primaryMutations = {
'trigger',
'kill',
'log',
'info',
'set'
]
}
Expand Down Expand Up @@ -313,6 +316,13 @@ export const dummyMutations = [
_requiresInfo: false,
_validStates: WorkflowStateNames,
},
{
name: 'info',
description: 'View task information.',
args: [],
_appliesTo: [cylcObjects.Namespace],
_requiresInfo: false
},
]

/**
Expand All @@ -322,7 +332,7 @@ export const dummyMutations = [
*/
const dummyMutationsPermissionsMap = Object.freeze({
broadcast: Object.freeze(['editRuntime']),
read: Object.freeze(['log'])
read: Object.freeze(['log', 'info'])
})

/**
Expand Down
Loading

0 comments on commit 2e5c1b5

Please sign in to comment.