From cc9e1b294ee50dbb25d68e89538ac1a7a3643396 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 20 May 2022 18:24:53 -0400 Subject: [PATCH] 19143: Workflow objects appear in project view, are runnable. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- src/models/details.ts | 3 +- src/store/navigation/navigation-action.ts | 4 ++ .../details-panel/details-panel.tsx | 15 +++++--- .../workflow-description-card.tsx | 38 ++----------------- 4 files changed, 18 insertions(+), 42 deletions(-) diff --git a/src/models/details.ts b/src/models/details.ts index 150b6940..b6eabd70 100644 --- a/src/models/details.ts +++ b/src/models/details.ts @@ -7,5 +7,6 @@ import { CollectionResource } from "./collection"; import { ProcessResource } from "./process"; import { EmptyResource } from "./empty"; import { CollectionFile, CollectionDirectory } from 'models/collection-file'; +import { WorkflowResource } from 'models/workflow'; -export type DetailsResource = ProjectResource | CollectionResource | ProcessResource | EmptyResource | CollectionFile | CollectionDirectory; +export type DetailsResource = ProjectResource | CollectionResource | ProcessResource | EmptyResource | CollectionFile | CollectionDirectory | WorkflowResource; diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts index 1cdb6784..973ba25a 100644 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@ -8,6 +8,7 @@ import { ResourceKind, extractUuidKind } from 'models/resource'; import { SidePanelTreeCategory } from '../side-panel-tree/side-panel-tree-actions'; import { Routes, getGroupUrl, getNavUrl, getUserProfileUrl } from 'routes/routes'; import { RootState } from 'store/store'; +import { openDetailsPanel } from 'store/details-panel/details-panel-action'; import { ServiceRepository } from 'services/services'; import { pluginConfig } from 'plugins'; import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions'; @@ -40,6 +41,9 @@ export const navigateTo = (uuid: string) => case ResourceKind.VIRTUAL_MACHINE: dispatch(navigateToAdminVirtualMachines); return; + case ResourceKind.WORKFLOW: + dispatch(openDetailsPanel(uuid)); + return; } switch (uuid) { diff --git a/src/views-components/details-panel/details-panel.tsx b/src/views-components/details-panel/details-panel.tsx index 399f4ef4..adbbab79 100644 --- a/src/views-components/details-panel/details-panel.tsx +++ b/src/views-components/details-panel/details-panel.tsx @@ -18,6 +18,7 @@ import { ProjectDetails } from "./project-details"; import { CollectionDetails } from "./collection-details"; import { ProcessDetails } from "./process-details"; import { EmptyDetails } from "./empty-details"; +import { WorkflowDetails } from "./workflow-details"; import { DetailsData } from "./details-data"; import { DetailsResource } from "models/details"; import { Config } from 'common/config'; @@ -71,6 +72,8 @@ const getItem = (res: DetailsResource): DetailsData => { return new CollectionDetails(res); case ResourceKind.PROCESS: return new ProcessDetails(res); + case ResourceKind.WORKFLOW: + return new WorkflowDetails(res); default: return new EmptyDetails(res); } @@ -152,9 +155,9 @@ export const DetailsPanel = withStyles(styles)( let shouldShowInlinePreview = false; if (!('kind' in res)) { shouldShowInlinePreview = isInlineFileUrlSafe( - res ? res.url : "", - authConfig.keepWebServiceUrl, - authConfig.keepWebInlineServiceUrl + res ? res.url : "", + authConfig.keepWebServiceUrl, + authConfig.keepWebInlineServiceUrl ) || authConfig.clusterConfig.Collections.TrustAllContent; } @@ -191,14 +194,14 @@ export const DetailsPanel = withStyles(styles)( = tabNr+1) ? tabNr : 0}> - { item.getTabLabels().map((tabLabel, idx) => + value={(item.getTabLabels().length >= tabNr + 1) ? tabNr : 0}> + {item.getTabLabels().map((tabLabel, idx) => ) } - {item.getDetails({tabNr, showPreview: shouldShowInlinePreview})} + {item.getDetails({ tabNr, showPreview: shouldShowInlinePreview })} ; } diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx index b9e89c76..e93caea4 100644 --- a/src/views/workflow-panel/workflow-description-card.tsx +++ b/src/views/workflow-panel/workflow-description-card.tsx @@ -15,16 +15,14 @@ import { TableCell, TableBody, 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 { parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow'; // 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"; + +import { WorkflowDetailsCardDataProps, WorkflowDetailsAttributes } from 'views-components/details-panel/workflow-details'; export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable'; @@ -58,10 +56,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, }); -interface WorkflowDetailsCardDataProps { - workflow?: WorkflowResource; -} - type WorkflowDetailsCardProps = WorkflowDetailsCardDataProps & WithStyles; export const WorkflowDetailsCard = withStyles(styles)( @@ -150,29 +144,3 @@ export const WorkflowDetailsCard = withStyles(styles)( ; } }); - -export const WorkflowDetailsAttributes = ({ workflow }: WorkflowDetailsCardDataProps) => { - return - - - - - } /> - - - - - - - - - } /> - - ; -}; -- 2.30.2