From: Peter Amstutz Date: Mon, 23 May 2022 15:00:15 +0000 (-0400) Subject: Merge branch 'main' into 19069-workflow-launching X-Git-Tag: 2.4.1~1^2~1^2~3^2~2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/d416c9aa7b70da4f8998792a42616b991d882f26?hp=0e3d1681d9ed60bae0b91b368efb1325f5aee239 Merge branch 'main' into 19069-workflow-launching Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/cypress/integration/create-workflow.spec.js b/cypress/integration/create-workflow.spec.js index b1ea5dbf..709db76e 100644 --- a/cypress/integration/create-workflow.spec.js +++ b/cypress/integration/create-workflow.spec.js @@ -148,14 +148,14 @@ describe('Multi-file deletion tests', function () { cy.get('[data-cy=side-panel-button]').click(); - cy.get('#aside-menu-list').contains('Run a process').click(); + cy.get('#aside-menu-list').contains('Run a workflow').click(); cy.get('@testWorkflow') .then((testWorkflow) => { cy.get('main').contains(testWorkflow.name).click(); cy.get('[data-cy=run-process-next-button]').click(); - cy.get('label').contains('#main/foo').parent('div').find('input').click(); + cy.get('label').contains('foo').parent('div').find('input').click(); cy.get('div[role=dialog]') .within(() => { cy.get('p').contains('Projects').closest('div[role=button]') @@ -174,7 +174,7 @@ describe('Multi-file deletion tests', function () { cy.get('[data-cy=ok-button]').click(); }); - cy.get('label').contains('#main/bar').parent('div').find('input').click(); + cy.get('label').contains('bar').parent('div').find('input').click(); cy.get('div[role=dialog]') .within(() => { cy.get('p').contains('Projects').closest('div[role=button]') @@ -193,13 +193,13 @@ describe('Multi-file deletion tests', function () { }); }); - cy.get('label').contains('#main/foo').parent('div') + cy.get('label').contains('foo').parent('div') .within(() => { cy.contains('baz'); cy.contains('bar'); }); - cy.get('label').contains('#main/bar').parent('div') + cy.get('label').contains('bar').parent('div') .within(() => { cy.contains(testCollection.name); cy.contains(testCollection2.name); diff --git a/cypress/integration/favorites.spec.js b/cypress/integration/favorites.spec.js index 9bc90ebd..7b0a4392 100644 --- a/cypress/integration/favorites.spec.js +++ b/cypress/integration/favorites.spec.js @@ -219,7 +219,7 @@ describe('Favorites tests', function () { cy.get('[data-cy=side-panel-button]').click(); - cy.get('#aside-menu-list').contains('Run a process').click(); + cy.get('#aside-menu-list').contains('Run a workflow').click(); cy.get('@testWorkflow') .then((testWorkflow) => { diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js index 4c824d32..fc2052cc 100644 --- a/cypress/integration/side-panel.spec.js +++ b/cypress/integration/side-panel.spec.js @@ -62,7 +62,7 @@ describe('Side panel tests', function() { {url: '/shared-with-me', label: 'Shared with me'}, {url: '/public-favorites', label: 'Public Favorites'}, {url: '/favorites', label: 'My Favorites'}, - {url: '/workflows', label: 'Workflows'}, + // {url: '/workflows', label: 'Workflows'}, {url: '/all_processes', label: 'All Processes'}, {url: '/trash', label: 'Trash'}, ].map(function(section) { diff --git a/src/models/workflow.ts b/src/models/workflow.ts index ad84bd9e..6d21dbc7 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; @@ -153,7 +153,7 @@ export const getWorkflowInputs = (workflowDefinition: WorkflowResourceDefinition }; export const getInputLabel = (input: CommandInputParameter) => { - return `${input.label || input.id}`; + return `${input.label || input.id.split('/').pop()}`; }; export const isRequiredInput = ({ type }: CommandInputParameter) => { 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..3137583e 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 @@ -116,13 +116,13 @@ describe("run-process-panel-actions", () => { description: "basicFormTestDescription", mounts: undefined, name: "basicFormTestName", - outputName: undefined, + outputName: "Output from basicFormTestName", outputPath: "/var/spool/cwl", ownerUuid: "ce8i5-tpzed-yid70bw31f51234", 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-components/side-panel-button/side-panel-button.tsx b/src/views-components/side-panel-button/side-panel-button.tsx index a219e55a..c813efb0 100644 --- a/src/views-components/side-panel-button/side-panel-button.tsx +++ b/src/views-components/side-panel-button/side-panel-button.tsx @@ -107,7 +107,7 @@ export const SidePanelButton = withStyles(styles)( New collection - Run a process + Run a workflow New project 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-panel-root.tsx b/src/views/run-process-panel/run-process-panel-root.tsx index 3c42437a..9dd5aa3f 100644 --- a/src/views/run-process-panel/run-process-panel-root.tsx +++ b/src/views/run-process-panel/run-process-panel-root.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import React from 'react'; -import { Stepper, Step, StepLabel, StepContent } from '@material-ui/core'; +import { Stepper, Step, StepLabel, StepContent, StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core'; import { RunProcessFirstStepDataProps, RunProcessFirstStepActionProps, RunProcessFirstStep } from 'views/run-process-panel/run-process-first-step'; import { RunProcessSecondStepForm } from './run-process-second-step'; @@ -17,25 +17,34 @@ export type RunProcessPanelRootActionProps = RunProcessFirstStepActionProps & { type RunProcessPanelRootProps = RunProcessPanelRootDataProps & RunProcessPanelRootActionProps; -export const RunProcessPanelRoot = ({ runProcess, currentStep, onSearch, onSetStep, onSetWorkflow, workflows, selectedWorkflow }: RunProcessPanelRootProps) => - - - Choose a workflow - - - - - - Select inputs - - onSetStep(0)} - runProcess={runProcess} /> - - - ; \ No newline at end of file +type CssRules = 'stepper'; + +const styles: StyleRulesCallback = theme => ({ + stepper: { + overflow: "scroll", + } +}); + +export const RunProcessPanelRoot = withStyles(styles)( + ({ runProcess, currentStep, onSearch, onSetStep, onSetWorkflow, workflows, selectedWorkflow, classes }: WithStyles & RunProcessPanelRootProps) => + + + Choose a workflow + + + + + + Select inputs + + onSetStep(0)} + runProcess={runProcess} /> + + + ); 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 }} /> + } - + */} diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx index 9c1d81c3..b9e89c76 100644 --- a/src/views/workflow-panel/workflow-description-card.tsx +++ b/src/views/workflow-panel/workflow-description-card.tsx @@ -14,13 +14,17 @@ import { TableHead, TableCell, TableBody, - TableRow + TableRow, + Grid, } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; import { WorkflowIcon } from 'components/icon/icon'; import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view'; import { WorkflowResource, parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow'; -import { WorkflowGraph } from "views/workflow-panel/workflow-graph"; +// import { WorkflowGraph } from "views/workflow-panel/workflow-graph"; +import { DetailsAttribute } from 'components/details-attribute/details-attribute'; +import { ResourceOwnerWithName } from 'views-components/data-explorer/renderers'; +import { formatDate } from "common/formatters"; export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable'; @@ -77,16 +81,17 @@ export const WorkflowDetailsCard = withStyles(styles)( - + + {/* */} {value === 0 && {workflow ?
{workflow.description}
: ( - - )} + + )}
} {value === 1 && {workflow @@ -96,12 +101,20 @@ export const WorkflowDetailsCard = withStyles(styles)( messages={['Please select a workflow to see its inputs.']} /> } } - {value === 2 && + {/* {value === 2 && + {workflow + ? + : + } + } */} + {value === 2 && {workflow - ? + ? : + messages={['Please select a workflow to see its details.']} /> } } ; @@ -137,3 +150,29 @@ export const WorkflowDetailsCard = withStyles(styles)( ; } }); + +export const WorkflowDetailsAttributes = ({ workflow }: WorkflowDetailsCardDataProps) => { + return + + + + + } /> + + + + + + + + + } /> + + ; +};