From 66adcf8ab86e764a8829fbd604e27df53d6f24a1 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 17 May 2022 17:17:41 -0400 Subject: [PATCH] 19069: Workflow launching improvements. * Hide the broken, mostly redundant workflow panel from the left tree (can still launch workflows from "+NEW -> Run a process") * Hide unsupported "presets" element * Don't require #main to be a workflow * Change "workflowUuid" property to "template_uuid" property for consistency with existing usage in workbench 1 and arvados-cwl-runner * Give process a default name * Assign default output collection name "Output of {name}" Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- src/models/workflow.ts | 2 +- .../context-menu/context-menu-actions.ts | 2 +- .../run-process-panel-actions.test.ts | 2 +- .../run-process-panel-actions.ts | 6 +++-- .../side-panel-tree-actions.ts | 2 +- .../process-details-attributes.tsx | 24 +++++++++---------- .../run-process-second-step.tsx | 12 +++++----- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/models/workflow.ts b/src/models/workflow.ts index ad84bd9e..00dfaa10 100644 --- a/src/models/workflow.ts +++ b/src/models/workflow.ts @@ -139,7 +139,7 @@ export const parseWorkflowDefinition = (workflow: WorkflowResource): WorkflowRes export const getWorkflow = (workflowDefinition: WorkflowResourceDefinition) => { if (!workflowDefinition.$graph) { return undefined; } - const mainWorkflow = workflowDefinition.$graph.find(item => item.class === 'Workflow' && item.id === '#main'); + const mainWorkflow = workflowDefinition.$graph.find(item => item.id === '#main'); return mainWorkflow ? mainWorkflow : undefined; diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts index 1116949a..bc7f94b0 100644 --- a/src/store/context-menu/context-menu-actions.ts +++ b/src/store/context-menu/context-menu-actions.ts @@ -189,7 +189,7 @@ export const openProcessContextMenu = (event: React.MouseEvent, pro name: res.name, description: res.description, outputUuid: res.outputUuid || '', - workflowUuid: res.properties.workflowUuid || '', + workflowUuid: res.properties.template_uuid || '', menuKind: ContextMenuKind.PROCESS_RESOURCE })); } diff --git a/src/store/run-process-panel/run-process-panel-actions.test.ts b/src/store/run-process-panel/run-process-panel-actions.test.ts index 745be88f..0bbde9af 100644 --- a/src/store/run-process-panel/run-process-panel-actions.test.ts +++ b/src/store/run-process-panel/run-process-panel-actions.test.ts @@ -122,7 +122,7 @@ describe("run-process-panel-actions", () => { priority: 1, properties: { workflowName: "revsort.cwl", - workflowUuid: "ce8i5-7fd4e-2tlnerdkxnl4fjt", + template_uuid: "ce8i5-7fd4e-2tlnerdkxnl4fjt", }, runtimeConstraints: { API: true, diff --git a/src/store/run-process-panel/run-process-panel-actions.ts b/src/store/run-process-panel/run-process-panel-actions.ts index adb5ade7..61597bb7 100644 --- a/src/store/run-process-panel/run-process-panel-actions.ts +++ b/src/store/run-process-panel/run-process-panel-actions.ts @@ -103,11 +103,13 @@ export const setWorkflow = (workflow: WorkflowResource, isWorkflowChanged = true dispatch(runProcessPanelActions.SET_STEP_CHANGED(false)); dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow)); dispatch(loadPresets(workflow.uuid)); + dispatch(initialize(RUN_PROCESS_BASIC_FORM, { name: workflow.name })); dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, advancedFormValues)); } if (!isWorkflowChanged) { dispatch(runProcessPanelActions.SET_SELECTED_WORKFLOW(workflow)); dispatch(loadPresets(workflow.uuid)); + dispatch(initialize(RUN_PROCESS_BASIC_FORM, { name: workflow.name })); dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, advancedFormValues)); } }; @@ -173,9 +175,9 @@ export const runProcess = async (dispatch: Dispatch, getState: () => RootSt ], outputPath: '/var/spool/cwl', priority: 1, - outputName: advancedForm[OUTPUT_FIELD] ? advancedForm[OUTPUT_FIELD] : undefined, + outputName: advancedForm[OUTPUT_FIELD] ? advancedForm[OUTPUT_FIELD] : `Output from ${basicForm.name}`, properties: { - workflowUuid: selectedWorkflow.uuid, + template_uuid: selectedWorkflow.uuid, workflowName: selectedWorkflow.name }, useExisting: false diff --git a/src/store/side-panel-tree/side-panel-tree-actions.ts b/src/store/side-panel-tree/side-panel-tree-actions.ts index 895fe79c..58f7d82d 100644 --- a/src/store/side-panel-tree/side-panel-tree-actions.ts +++ b/src/store/side-panel-tree/side-panel-tree-actions.ts @@ -52,7 +52,7 @@ let SIDE_PANEL_CATEGORIES: string[] = [ SidePanelTreeCategory.SHARED_WITH_ME, SidePanelTreeCategory.PUBLIC_FAVORITES, SidePanelTreeCategory.FAVORITES, - SidePanelTreeCategory.WORKFLOWS, + // SidePanelTreeCategory.WORKFLOWS, SidePanelTreeCategory.GROUPS, SidePanelTreeCategory.ALL_PROCESSES, SidePanelTreeCategory.TRASH diff --git a/src/views/process-panel/process-details-attributes.tsx b/src/views/process-panel/process-details-attributes.tsx index d0e593d5..99a4404c 100644 --- a/src/views/process-panel/process-details-attributes.tsx +++ b/src/views/process-panel/process-details-attributes.tsx @@ -74,7 +74,7 @@ export const ProcessDetailsAttributes = withStyles(styles, { withTheme: true })( + linkToUuid={containerRequest.containerImage} value={containerRequest.containerImage} /> {!props.hideProcessPanelRedundantFields && - + } @@ -112,13 +112,13 @@ export const ProcessDetailsAttributes = withStyles(styles, { withTheme: true })( - {containerRequest.properties.workflowUuid && - - props.openWorkflow(containerRequest.properties.workflowUuid)}> - - - } + {containerRequest.properties.template_uuid && + + props.openWorkflow(containerRequest.properties.template_uuid)}> + + + } @@ -128,13 +128,13 @@ export const ProcessDetailsAttributes = withStyles(styles, { withTheme: true })( */} - { Object.keys(containerRequest.properties).length > 0 + {Object.keys(containerRequest.properties).length > 0 ? Object.keys(containerRequest.properties).map(k => - Array.isArray(containerRequest.properties[k]) + Array.isArray(containerRequest.properties[k]) ? containerRequest.properties[k].map((v: string) => getPropertyChip(k, v, undefined, classes.propertyTag)) : getPropertyChip(k, containerRequest.properties[k], undefined, classes.propertyTag)) - :
No properties
} + :
No properties
}
; } diff --git a/src/views/run-process-panel/run-process-second-step.tsx b/src/views/run-process-panel/run-process-second-step.tsx index 08cf4e6c..ca30ce5f 100644 --- a/src/views/run-process-panel/run-process-second-step.tsx +++ b/src/views/run-process-panel/run-process-second-step.tsx @@ -58,14 +58,14 @@ export const RunProcessSecondStepForm = connect(mapStateToProps, { onPresetChang ({ inputs, workflow, selectedPreset, presets, onPresetChange, valid, goBack, runProcess }: RunProcessSecondStepFormProps) => - + {/* - {workflow && selectedPreset && presets && - < WorkflowPresetSelect - {...{ workflow, selectedPreset, presets, onChange: onPresetChange }} /> - } + {workflow && selectedPreset && presets && + < WorkflowPresetSelect + {...{ workflow, selectedPreset, presets, onChange: onPresetChange }} /> + } - + */} -- 2.30.2