From: Peter Amstutz Date: Thu, 16 Feb 2023 19:41:17 +0000 (-0500) Subject: 19482: Fix styling, add git metadata properties X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/add4900230288067297949de35957adca86c4647?ds=inline 19482: Fix styling, add git metadata properties Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/src/views/workflow-panel/registered-workflow-panel.tsx b/src/views/workflow-panel/registered-workflow-panel.tsx index be9a037cf9..554ae42631 100644 --- a/src/views/workflow-panel/registered-workflow-panel.tsx +++ b/src/views/workflow-panel/registered-workflow-panel.tsx @@ -7,20 +7,20 @@ import { StyleRulesCallback, WithStyles, withStyles, - IconButton, Grid, Tooltip, Typography, - Card + Card, + CardHeader } from '@material-ui/core'; import { connect, DispatchProp } from "react-redux"; import { RouteComponentProps } from 'react-router'; import { ArvadosTheme } from 'common/custom-theme'; import { RootState } from 'store/store'; -import { MoreOptionsIcon, WorkflowIcon } from 'components/icon/icon'; +import { WorkflowIcon } from 'components/icon/icon'; import { WorkflowResource, parseWorkflowDefinition, getWorkflowInputs, - getWorkflowOutputs, getWorkflow, getIOParamId + getWorkflowOutputs, getWorkflow } from 'models/workflow'; import { ProcessOutputCollectionFiles } from 'views/process-panel/process-output-collection-files'; import { WorkflowDetailsAttributes } from 'views-components/details-panel/workflow-details'; @@ -29,6 +29,8 @@ import { openContextMenu, resourceUuidToContextMenuKind } from 'store/context-me import { MPVContainer, MPVPanelContent, MPVPanelState } from 'components/multi-panel-view/multi-panel-view'; import { ProcessIOCard, ProcessIOCardType, ProcessIOParameter } from 'views/process-panel/process-io-card'; import { formatInputData, formatOutputData } from 'store/process-panel/process-panel-actions'; +import { DetailsAttribute } from 'components/details-attribute/details-attribute'; +import { getPropertyChip } from "views-components/resource-properties-form/property-chip"; type CssRules = 'root' | 'button' @@ -43,7 +45,11 @@ type CssRules = 'root' | 'centeredLabel' | 'warningLabel' | 'collectionName' - | 'readOnlyIcon'; + | 'readOnlyIcon' + | 'header' + | 'title' + | 'avatar' + | 'propertyTag'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -98,7 +104,24 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ readOnlyIcon: { marginLeft: theme.spacing.unit, fontSize: 'small', - } + }, + header: { + paddingTop: theme.spacing.unit, + paddingBottom: theme.spacing.unit, + }, + title: { + overflow: 'hidden', + paddingTop: theme.spacing.unit * 0.5, + color: theme.customs.colors.green700, + }, + avatar: { + alignSelf: 'flex-start', + paddingTop: theme.spacing.unit * 0.5 + }, + propertyTag: { + marginRight: theme.spacing.unit / 2, + marginBottom: theme.spacing.unit / 2 + }, }); interface RegisteredWorkflowPanelDataProps { @@ -106,6 +129,7 @@ interface RegisteredWorkflowPanelDataProps { workflowCollection: string; inputParams: ProcessIOParameter[]; outputParams: ProcessIOParameter[]; + gitprops: { [key: string]: string; }; } type RegisteredWorkflowPanelProps = RegisteredWorkflowPanelDataProps & DispatchProp & WithStyles @@ -116,6 +140,7 @@ export const RegisteredWorkflowPanel = withStyles(styles)(connect( let inputParams: ProcessIOParameter[] = []; let outputParams: ProcessIOParameter[] = []; let workflowCollection = ""; + const gitprops: { [key: string]: string; } = {}; if (item) { // parse definition const wfdef = parseWorkflowDefinition(item); @@ -123,7 +148,9 @@ export const RegisteredWorkflowPanel = withStyles(styles)(connect( const inputs = getWorkflowInputs(wfdef); if (inputs) { inputs.forEach(elm => { - elm.value = elm.default; + if (elm.default !== undefined && elm.default !== null) { + elm.value = elm.default; + } }); inputParams = formatInputData(inputs, state.auth); } @@ -141,13 +168,18 @@ export const RegisteredWorkflowPanel = withStyles(styles)(connect( } } - // get the properties from the collection + for (const elm in wfdef) { + if (elm.startsWith("http://arvados.org/cwl#git")) { + gitprops[elm.substr(23)] = wfdef[elm] + } + } + } - return { item, inputParams, outputParams, workflowCollection }; + return { item, inputParams, outputParams, workflowCollection, gitprops }; })( class extends React.Component { render() { - const { classes, item, inputParams, outputParams, workflowCollection, dispatch } = this.props; + const { classes, item, inputParams, outputParams, workflowCollection, gitprops, dispatch } = this.props; const panelsData: MPVPanelState[] = [ { name: "Details" }, { name: "Inputs" }, @@ -158,35 +190,42 @@ export const RegisteredWorkflowPanel = withStyles(styles)(connect( ? - - - - - {item.name} - - - - - - - + } + title={ + + + {item.name} + - - + } + subheader={ + + + {item.description || '(no-description)'} + + } + /> + - - {item.description} - + + + + {Object.keys(gitprops).map(k => + getPropertyChip(k, gitprops[k], undefined, classes.propertyTag))} + - + - +