X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7c6d47d766b7b37463281387d8badbfe18522d09..daa412a179a8d7fec006ae21991a1daaffb9fa3d:/src/views/process-panel/process-details-attributes.tsx diff --git a/src/views/process-panel/process-details-attributes.tsx b/src/views/process-panel/process-details-attributes.tsx index 6ddeab7a..4af2c9cd 100644 --- a/src/views/process-panel/process-details-attributes.tsx +++ b/src/views/process-panel/process-details-attributes.tsx @@ -9,8 +9,8 @@ import { formatDate } from "common/formatters"; import { resourceLabel } from "common/labels"; import { DetailsAttribute } from "components/details-attribute/details-attribute"; import { ResourceKind } from "models/resource"; -import { ResourceOwnerWithName } from "views-components/data-explorer/renderers"; -import { getProcess } from "store/processes/process"; +import { ContainerRunTime, ResourceWithName } from "views-components/data-explorer/renderers"; +import { getProcess, getProcessStatus } from "store/processes/process"; import { RootState } from "store/store"; import { connect } from "react-redux"; import { ProcessResource } from "models/process"; @@ -18,8 +18,10 @@ import { ContainerResource } from "models/container"; import { openProcessInputDialog } from "store/processes/process-input-actions"; import { navigateToOutput, openWorkflow } from "store/process-panel/process-panel-actions"; import { ArvadosTheme } from "common/custom-theme"; +import { ProcessRuntimeStatus } from "views-components/process-runtime-status/process-runtime-status"; +import { getPropertyChip } from "views-components/resource-properties-form/property-chip"; -type CssRules = 'link'; +type CssRules = 'link' | 'propertyTag'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ link: { @@ -29,6 +31,10 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ cursor: 'pointer' } }, + propertyTag: { + marginRight: theme.spacing.unit / 2, + marginBottom: theme.spacing.unit / 2 + }, }); const mapStateToProps = (state: RootState, props: { request: ProcessResource }) => { @@ -51,46 +57,52 @@ const mapDispatchToProps = (dispatch: Dispatch): ProcessDetailsAttributesActionP export const ProcessDetailsAttributes = withStyles(styles, { withTheme: true })( connect(mapStateToProps, mapDispatchToProps)( - (props: { request: ProcessResource, container?: ContainerResource, twoCol?: boolean, classes?: Record } & ProcessDetailsAttributesActionProps) => { + (props: { request: ProcessResource, container?: ContainerResource, twoCol?: boolean, hideProcessPanelRedundantFields?: boolean, classes: Record } & ProcessDetailsAttributesActionProps) => { const containerRequest = props.request; const container = props.container; - const classes = props.classes || { label: '', value: '', button: '', link: '' }; + const classes = props.classes; const mdSize = props.twoCol ? 6 : 12; return - - + + + {!props.hideProcessPanelRedundantFields && + + } - } /> - - - + - + - + } /> - + + {!props.hideProcessPanelRedundantFields && + + } - + - + - + - + + + - + props.navigateToOutput(containerRequest.outputUuid!)}> @@ -100,23 +112,29 @@ 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)}> + + + } - - - - - + {/* + NOTE: The property list should be kept at the bottom, because it spans + the entire available width, without regards of the twoCol prop. + */} + + + {Object.keys(containerRequest.properties).length > 0 + ? Object.keys(containerRequest.properties).map(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
}
; }