X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/837e79c83399108aa0492f163205edb952f0ab71..3c7e3cdc547ad5468421e1c049daa94b0d4b8bc0:/src/views/process-log-panel/process-log-main-card.tsx diff --git a/src/views/process-log-panel/process-log-main-card.tsx b/src/views/process-log-panel/process-log-main-card.tsx index 66811f47..e6d4091d 100644 --- a/src/views/process-log-panel/process-log-main-card.tsx +++ b/src/views/process-log-panel/process-log-main-card.tsx @@ -2,26 +2,26 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import { Link } from 'react-router-dom'; import { StyleRulesCallback, WithStyles, withStyles, Card, CardHeader, IconButton, CardContent, Grid, Typography, Tooltip } from '@material-ui/core'; -import { Process } from '~/store/processes/process'; -import { ProcessLogCodeSnippet } from '~/views/process-log-panel/process-log-code-snippet'; -import { ProcessLogForm, ProcessLogFormDataProps, ProcessLogFormActionProps } from '~/views/process-log-panel/process-log-form'; -import { MoreOptionsIcon, ProcessIcon } from '~/components/icon/icon'; -import { ArvadosTheme } from '~/common/custom-theme'; -import { CodeSnippetDataProps } from '~/components/code-snippet/code-snippet'; -import { BackIcon } from '~/components/icon/icon'; -import { DefaultView } from '~/components/default-view/default-view'; +import { Process } from 'store/processes/process'; +import { ProcessLogCodeSnippet } from 'views/process-log-panel/process-log-code-snippet'; +import { ProcessLogForm, ProcessLogFormDataProps, ProcessLogFormActionProps } from 'views/process-log-panel/process-log-form'; +import { MoreOptionsIcon, ProcessIcon } from 'components/icon/icon'; +import { ArvadosTheme } from 'common/custom-theme'; +import { CodeSnippetDataProps } from 'components/code-snippet/code-snippet'; +import { BackIcon } from 'components/icon/icon'; +import { DefaultView } from 'components/default-view/default-view'; type CssRules = 'backLink' | 'backIcon' | 'card' | 'title' | 'iconHeader' | 'link'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ backLink: { - fontSize: '1rem', + fontSize: '14px', fontWeight: 600, display: 'flex', alignItems: 'center', @@ -43,8 +43,12 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ color: theme.customs.colors.green700 }, link: { - alignSelf: 'flex-end', - textAlign: 'right' + fontSize: '0.875rem', + color: theme.palette.primary.main, + textAlign: 'right', + '&:hover': { + cursor: 'pointer' + } } }); @@ -53,46 +57,56 @@ interface ProcessLogMainCardDataProps { process: Process; } -export type ProcessLogMainCardProps = ProcessLogMainCardDataProps & CodeSnippetDataProps & ProcessLogFormDataProps & ProcessLogFormActionProps; +export interface ProcessLogMainCardActionProps { + onContextMenu: (event: React.MouseEvent, process: Process) => void; + navigateToLogCollection: (uuid: string) => void; +} + +export type ProcessLogMainCardProps = ProcessLogMainCardDataProps + & ProcessLogMainCardActionProps + & CodeSnippetDataProps + & ProcessLogFormDataProps + & ProcessLogFormActionProps; export const ProcessLogMainCard = withStyles(styles)( - ({ classes, process, selectedFilter, filters, onChange, lines }: ProcessLogMainCardProps & WithStyles) => + ({ classes, process, selectedFilter, filters, onChange, lines, onContextMenu, navigateToLogCollection }: ProcessLogMainCardProps & WithStyles) => - Back + BACK } action={ -
- - - - + + onContextMenu(event, process)} aria-label="More options"> + -
- } + } title={ - + {process.containerRequest.name} - - } + } subheader={process.containerRequest.description} /> {lines.length > 0 - ? < Grid container spacing={24} alignItems='center'> - - - - - - Go to Log collection - + ? < Grid + container + spacing={24} + direction='column'> + + + + + + navigateToLogCollection(process.containerRequest.logUuid!)}> + Go to Log collection + + - +