[ARVADOS-WORKBENCH2] updated: 1.4.1-198-g134e0d36
Git user
git at public.arvados.org
Fri Dec 20 23:18:52 UTC 2019
Summary of changes:
.../process-panel/process-subprocesses-card.tsx | 113 ---------------------
src/views/process-panel/process-subprocesses.tsx | 25 -----
.../subprocess-panel/subprocess-panel-root.tsx | 7 +-
src/views/subprocess-panel/subprocess-panel.tsx | 20 ++--
4 files changed, 10 insertions(+), 155 deletions(-)
delete mode 100644 src/views/process-panel/process-subprocesses-card.tsx
delete mode 100644 src/views/process-panel/process-subprocesses.tsx
via 134e0d365b1152e8a753e9798e53bac0eddefab9 (commit)
via b238c5cec390860b3265238e07b41d62349f70ce (commit)
from 59cc1b248e39a17bbf46449add178d957b167b9a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 134e0d365b1152e8a753e9798e53bac0eddefab9
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Fri Dec 20 20:16:40 2019 -0300
15672: Removes unused code.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/views/process-panel/process-subprocesses-card.tsx b/src/views/process-panel/process-subprocesses-card.tsx
deleted file mode 100644
index 9607f49a..00000000
--- a/src/views/process-panel/process-subprocesses-card.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import * as React from 'react';
-import {
- StyleRulesCallback, WithStyles, withStyles, Card,
- CardHeader, IconButton, CardContent, Typography, Tooltip
-} from '@material-ui/core';
-import { ArvadosTheme } from '~/common/custom-theme';
-import { MoreOptionsIcon } from '~/components/icon/icon';
-import { DetailsAttribute } from '~/components/details-attribute/details-attribute';
-import { Process, getProcessStatus, getProcessRuntime } from '~/store/processes/process';
-import { formatTime } from '~/common/formatters';
-import { getProcessStatusColor } from '~/store/processes/process';
-
-export type CssRules = 'label' | 'value' | 'title' | 'content' | 'action' | 'options' | 'status' | 'rightSideHeader' | 'titleHeader' | 'header' | 'moreOptions';
-
-const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
- label: {
- fontSize: '0.875rem',
- },
- value: {
- textTransform: 'none',
- fontSize: '0.875rem',
- },
- title: {
- overflow: 'hidden'
- },
- content: {
- paddingTop: theme.spacing.unit * 0.5,
- '&:last-child': {
- paddingBottom: 0
- }
- },
- action: {
- marginTop: 0
- },
- options: {
- width: theme.spacing.unit * 4,
- height: theme.spacing.unit * 4,
- color: theme.palette.common.white,
- },
- status: {
- paddingTop: theme.spacing.unit * 0.75,
- color: theme.palette.common.white,
- },
- rightSideHeader: {
- display: 'flex'
- },
- titleHeader: {
- color: theme.palette.common.white,
- fontWeight: 600
- },
- header: {
- paddingTop: 0,
- paddingBottom: 0,
- },
- moreOptions: {
- position: 'absolute'
- }
-});
-
-export interface SubprocessItemProps {
- title: string;
- status: string;
- runtime?: string;
-}
-
-export interface ProcessSubprocessesCardDataProps {
- onContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
- subprocess: Process;
-}
-
-type ProcessSubprocessesCardProps = ProcessSubprocessesCardDataProps & WithStyles<CssRules, true>;
-
-export const ProcessSubprocessesCard = withStyles(styles, { withTheme: true })(
- ({ classes, onContextMenu, subprocess, theme }: ProcessSubprocessesCardProps) => {
- return <Card>
- <CardHeader
- className={classes.header}
- style={{ backgroundColor: getProcessStatusColor(getProcessStatus(subprocess), theme as ArvadosTheme) }}
- classes={{ content: classes.title, action: classes.action }}
- action={
- <div className={classes.rightSideHeader}>
- <Typography noWrap variant='body1' className={classes.status}>
- {getProcessStatus(subprocess)}
- </Typography>
- <Tooltip title="More options" disableFocusListener>
- <IconButton
- className={classes.options}
- aria-label="More options"
- onClick={onContextMenu}>
- <MoreOptionsIcon className={classes.moreOptions} />
- </IconButton>
- </Tooltip>
- </div>
- }
- title={
- <Tooltip title={subprocess.containerRequest.name}>
- <Typography noWrap variant='body1' className={classes.titleHeader}>
- {subprocess.containerRequest.name}
- </Typography>
- </Tooltip>
- } />
- <CardContent className={classes.content}>
- <DetailsAttribute classLabel={classes.label} classValue={classes.value}
- label="Runtime" value={subprocess.container && subprocess.container.startedAt && subprocess.container.finishedAt
- ? formatTime(getProcessRuntime(subprocess)) :
- '(none)'} />
- </CardContent>
- </Card>;
- });
diff --git a/src/views/process-panel/process-subprocesses.tsx b/src/views/process-panel/process-subprocesses.tsx
deleted file mode 100644
index d3f87701..00000000
--- a/src/views/process-panel/process-subprocesses.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-import * as React from 'react';
-import { Grid } from '@material-ui/core';
-import { ProcessSubprocessesCard } from '~/views/process-panel/process-subprocesses-card';
-import { Process } from '~/store/processes/process';
-
-export interface ProcessSubprocessesDataProps {
- subprocesses: Array<Process>;
- onContextMenu: (event: React.MouseEvent<HTMLElement>, process: Process) => void;
-}
-
-export const ProcessSubprocesses = ({ onContextMenu, subprocesses }: ProcessSubprocessesDataProps) => {
- return <Grid container spacing={16}>
- {subprocesses.map(subprocess =>
- <Grid item xs={12} sm={6} md={4} lg={2} key={subprocess.containerRequest.uuid}>
- <ProcessSubprocessesCard
- onContextMenu={event => onContextMenu(event, subprocess)}
- subprocess={subprocess} />
- </Grid>
- )}
- </Grid>;
-};
commit b238c5cec390860b3265238e07b41d62349f70ce
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Fri Dec 20 20:14:58 2019 -0300
15672: Uses process context menu on subprocess panel.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/src/views/subprocess-panel/subprocess-panel-root.tsx b/src/views/subprocess-panel/subprocess-panel-root.tsx
index 2d37ccb3..a8ce6075 100644
--- a/src/views/subprocess-panel/subprocess-panel-root.tsx
+++ b/src/views/subprocess-panel/subprocess-panel-root.tsx
@@ -16,6 +16,7 @@ import { SUBPROCESS_PANEL_ID } from '~/store/subprocess-panel/subprocess-panel-a
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
import { createTree } from '~/models/tree';
import { getInitialProcessStatusFilters } from '~/store/resource-type-filters/resource-type-filters';
+import { ResourcesState } from '~/store/resources/resources';
export enum SubprocessPanelColumnNames {
NAME = "Name",
@@ -63,12 +64,12 @@ export const subprocessPanelColumns: DataColumns<string> = [
];
export interface SubprocessPanelDataProps {
- isAdmin: boolean;
+ resources: ResourcesState;
}
export interface SubprocessPanelActionProps {
onItemClick: (item: string) => void;
- onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string, isAdmin: boolean) => void;
+ onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string, resources: ResourcesState) => void;
onItemDoubleClick: (item: string) => void;
}
@@ -84,7 +85,7 @@ export const SubprocessPanelRoot = (props: SubprocessPanelProps) => {
id={SUBPROCESS_PANEL_ID}
onRowClick={props.onItemClick}
onRowDoubleClick={props.onItemDoubleClick}
- onContextMenu={(event, item) => props.onContextMenu(event, item, props.isAdmin)}
+ onContextMenu={(event, item) => props.onContextMenu(event, item, props.resources)}
contextMenuColumn={true}
dataTableDefaultView={
<DataTableDefaultView
diff --git a/src/views/subprocess-panel/subprocess-panel.tsx b/src/views/subprocess-panel/subprocess-panel.tsx
index cf1de9af..81bd54d4 100644
--- a/src/views/subprocess-panel/subprocess-panel.tsx
+++ b/src/views/subprocess-panel/subprocess-panel.tsx
@@ -4,26 +4,18 @@
import { Dispatch } from "redux";
import { connect } from "react-redux";
-import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
+import { openProcessContextMenu } from '~/store/context-menu/context-menu-actions';
import { SubprocessPanelRoot, SubprocessPanelActionProps, SubprocessPanelDataProps } from '~/views/subprocess-panel/subprocess-panel-root';
-import { ResourceKind } from '~/models/resource';
import { RootState } from "~/store/store";
import { navigateTo } from "~/store/navigation/navigation-action";
import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
import { getProcess } from "~/store/processes/process";
const mapDispatchToProps = (dispatch: Dispatch): SubprocessPanelActionProps => ({
- onContextMenu: (event, resourceUuid, isAdmin) => {
- const menuKind = resourceKindToContextMenuKind(resourceUuid, isAdmin);
- const resource = getProcess(resourceUuid);
- if (menuKind && resource) {
- dispatch<any>(openContextMenu(event, {
- name: resource.name,
- uuid: resourceUuid,
- ownerUuid: '',
- kind: ResourceKind.PROCESS,
- menuKind
- }));
+ onContextMenu: (event, resourceUuid, resources) => {
+ const process = getProcess(resourceUuid)(resources);
+ if (process) {
+ dispatch<any>(openProcessContextMenu(event, process));
}
},
onItemClick: (uuid: string) => {
@@ -35,7 +27,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SubprocessPanelActionProps => (
});
const mapStateToProps = (state: RootState): SubprocessPanelDataProps => ({
- isAdmin: state.auth.user ? state.auth.user.isAdmin : false
+ resources: state.resources
});
export const SubprocessPanel = connect(mapStateToProps, mapDispatchToProps)(SubprocessPanelRoot);
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list