From: Lucas Di Pentima Date: Tue, 19 Oct 2021 19:20:32 +0000 (-0300) Subject: 18128: Separate process details into their own component. X-Git-Tag: 2.4.0~25^2~9 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/0f433d72c1af64a6359478da2edb8c9f589d579b 18128: Separate process details into their own component. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/src/views-components/details-panel/process-details.tsx b/src/views-components/details-panel/process-details.tsx index c4b374b9..d9c991f5 100644 --- a/src/views-components/details-panel/process-details.tsx +++ b/src/views-components/details-panel/process-details.tsx @@ -5,12 +5,8 @@ import React from 'react'; import { ProcessIcon } from 'components/icon/icon'; import { ProcessResource } from 'models/process'; -import { formatDate } from 'common/formatters'; -import { ResourceKind } from 'models/resource'; -import { resourceLabel } from 'common/labels'; import { DetailsData } from "./details-data"; -import { DetailsAttribute } from "components/details-attribute/details-attribute"; -import { ResourceOwnerWithName } from '../data-explorer/renderers'; +import { ProcessDetailsAttributes } from 'views/process-panel/process-details-attributes'; export class ProcessDetails extends DetailsData { @@ -19,25 +15,6 @@ export class ProcessDetails extends DetailsData { } getDetails() { - return
- - } /> - - - - - - - - - - - - - - - -
; + return ; } } diff --git a/src/views/process-panel/process-details-attributes.tsx b/src/views/process-panel/process-details-attributes.tsx new file mode 100644 index 00000000..4f26a71f --- /dev/null +++ b/src/views/process-panel/process-details-attributes.tsx @@ -0,0 +1,65 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import React from "react"; +import { Grid } from "@material-ui/core"; +import { formatDate } from "common/formatters"; +import { resourceLabel } from "common/labels"; +import { DetailsAttribute } from "components/details-attribute/details-attribute"; +import { ProcessResource } from "models/process"; +import { ResourceKind } from "models/resource"; +import { ResourceOwnerWithName } from "views-components/data-explorer/renderers"; + +type CssRules = 'label' | 'value'; + +export const ProcessDetailsAttributes = (props: { item: ProcessResource, twoCol?: boolean, classes?: Record }) => { + const item = props.item; + const classes = props.classes || { label: '', value: '', button: '' }; + const mdSize = props.twoCol ? 6 : 12; + return + + + + + } /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ; +}; diff --git a/src/views/process-panel/process-details-card.tsx b/src/views/process-panel/process-details-card.tsx new file mode 100644 index 00000000..18610781 --- /dev/null +++ b/src/views/process-panel/process-details-card.tsx @@ -0,0 +1,63 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + +import React from 'react'; +import { + StyleRulesCallback, + WithStyles, + withStyles, + Card, + CardHeader, + IconButton, + CardContent, + Tooltip, +} from '@material-ui/core'; +import { ArvadosTheme } from 'common/custom-theme'; +import { CloseIcon } from 'components/icon/icon'; +import { Process } from 'store/processes/process'; +import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; +import { ProcessDetailsAttributes } from './process-details-attributes'; + +type CssRules = 'card' | 'content' | 'title'; + +const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ + card: { + height: '100%' + }, + content: { + '&:last-child': { + paddingBottom: theme.spacing.unit * 2, + } + }, + title: { + overflow: 'hidden', + paddingTop: theme.spacing.unit * 0.5 + }, +}); + +export interface ProcessDetailsCardDataProps { + process: Process; +} + +type ProcessDetailsCardProps = ProcessDetailsCardDataProps & WithStyles & MPVPanelProps; + +export const ProcessDetailsCard = withStyles(styles)( + ({ classes, process, doHidePanel, panelName }: ProcessDetailsCardProps) => { + return + + + } /> + + + + ; + } +); +