[ARVADOS-WORKBENCH2] updated: 1.2.0-436-gfe815aa
Git user
git at public.curoverse.com
Tue Sep 25 11:13:52 EDT 2018
Summary of changes:
src/views-components/data-explorer/renderers.tsx | 40 ++++++++++----
.../workflow-panel/workflow-description-card.tsx | 61 +++++++++++++++-------
src/views/workflow-panel/workflow-panel.tsx | 42 ++++-----------
3 files changed, 80 insertions(+), 63 deletions(-)
via fe815aabd15db10f2f9437db82104c4272bcb38e (commit)
from 20bb2125fddc247d8ff2df960b3d4d316e4a0d13 (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 fe815aabd15db10f2f9437db82104c4272bcb38e
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date: Tue Sep 25 17:13:43 2018 +0200
view
Feature #13857
Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 039ef47..39fc536 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -3,10 +3,10 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { Grid, Typography, withStyles } from '@material-ui/core';
+import { Grid, Typography, withStyles, Tooltip, IconButton } from '@material-ui/core';
import { FavoriteStar } from '../favorite-star/favorite-star';
import { ResourceKind, TrashableResource } from '~/models/resource';
-import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon, WorkflowIcon } from '~/components/icon/icon';
+import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon, WorkflowIcon, ShareIcon } from '~/components/icon/icon';
import { formatDate, formatFileSize } from '~/common/formatters';
import { resourceLabel } from '~/common/labels';
import { connect } from 'react-redux';
@@ -57,7 +57,13 @@ export const renderIcon = (item: { kind: string }) => {
}
};
-export const renderWorkflowName = (item: { name: string; uuid: string, kind: string }) =>
+export const renderDate = (date?: string) => {
+ return <Typography noWrap style={{ minWidth: '100px' }}>{formatDate(date)}</Typography>;
+};
+
+export const PublicUuid = 'qr1hi-tpzed-anonymouspublic';
+
+export const renderWorkflowName = (item: { name: string; uuid: string, kind: string, ownerUuid: string }) =>
<Grid container alignItems="center" wrap="nowrap" spacing={16}>
<Grid item>
{renderIcon(item)}
@@ -71,22 +77,36 @@ export const renderWorkflowName = (item: { name: string; uuid: string, kind: str
export const RosurceWorkflowName = connect(
(state: RootState, props: { uuid: string }) => {
- const resource = getResource<GroupContentsResource>(props.uuid)(state.resources);
- return resource || { name: '', uuid: '', kind: '' };
+ const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
+ return resource || { name: '', uuid: '', kind: '', ownerUuid: '' };
})(renderWorkflowName);
-export const renderDate = (date?: string) => {
- return <Typography noWrap style={{ minWidth: '100px' }}>{formatDate(date)}</Typography>;
+// do share onClick
+export const resourceShare = (props: { ownerUuid: string }) => {
+ return <Tooltip title="Share">
+ <IconButton onClick={() => undefined}>
+ {props.ownerUuid === PublicUuid ? <ShareIcon /> : null}
+ </IconButton>
+ </Tooltip>;
};
+export const ResourceShare = connect(
+ (state: RootState, props: { uuid: string }) => {
+ const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
+ return resource || { ownerUuid: '' };
+ })(resourceShare);
+
export const renderWorkflowStatus = (ownerUuid?: string) => {
- if (ownerUuid === 'qr1hi-j7d0g-2ax8o1pscovq2lg') {
- return <Typography noWrap style={{ width: '60px' }}>{ResourceStatus.PUBLIC}</Typography>;
+ if (ownerUuid === PublicUuid) {
+ return renderStatus(ResourceStatus.PUBLIC);
} else {
- return <Typography noWrap style={{ width: '60px' }}>{ResourceStatus.PRIVATE}</Typography>;
+ return renderStatus(ResourceStatus.PRIVATE);
}
};
+const renderStatus = (status: string) =>
+ <Typography noWrap style={{ width: '60px' }}>{status}</Typography>;
+
export const ResourceWorkflowStatus = connect(
(state: RootState, props: { uuid: string }) => {
const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx
index e2b0f29..60e17b6 100644
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@ -3,35 +3,56 @@
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { StyleRulesCallback, WithStyles, withStyles, Card, CardHeader, Typography, CardContent } from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, withStyles, CardContent, Tab, Tabs, Paper } from '@material-ui/core';
import { ArvadosTheme } from '~/common/custom-theme';
import { WorkflowIcon } from '~/components/icon/icon';
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
+import { WorkflowResource } from '~/models/workflow';
-export type CssRules = 'card';
+export type CssRules = 'root' | 'tab';
const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
- card: {
- height: '100%'
+ root: {
+ height: '100%',
+ },
+ tab: {
+ minWidth: '50%'
}
});
-interface WorkflowDescriptionCardDataProps {
+interface WorkflowDetailsCardDataProps {
+ workflow?: WorkflowResource;
}
-type WorkflowDescriptionCardProps = WorkflowDescriptionCardDataProps & WithStyles<CssRules>;
-
-export const WorkflowDescriptionCard = withStyles(styles)(
- ({ classes }: WorkflowDescriptionCardProps) => {
- return <Card className={classes.card}>
- <CardHeader
- title={<Typography noWrap variant="body2">
- Workflow description:
- </Typography>} />
- <CardContent>
- <DataTableDefaultView
- icon={WorkflowIcon}
- messages={['Please select a workflow to see its description.']} />
- </CardContent>
- </Card>;
+type WorkflowDetailsCardProps = WorkflowDetailsCardDataProps & WithStyles<CssRules>;
+
+export const WorkflowDetailsCard = withStyles(styles)(
+ class extends React.Component<WorkflowDetailsCardProps> {
+ state = {
+ value: 0,
+ };
+
+ handleChange = (event: React.MouseEvent<HTMLElement>, value: number) => {
+ this.setState({ value });
+ }
+
+ render() {
+ const { classes } = this.props;
+ const { value } = this.state;
+ return <Paper className={classes.root}>
+ <Tabs value={value} onChange={this.handleChange} centered={true}>
+ <Tab className={classes.tab} label="Description" />
+ <Tab className={classes.tab} label="Inputs" />
+ </Tabs>
+ {value === 0 && <CardContent>
+ Description
+ <DataTableDefaultView
+ icon={WorkflowIcon}
+ messages={['Please select a workflow to see its description.']} />
+ </CardContent>}
+ {value === 1 && <CardContent>
+ Inputs
+ </CardContent>}
+ </Paper>;
+ }
});
\ No newline at end of file
diff --git a/src/views/workflow-panel/workflow-panel.tsx b/src/views/workflow-panel/workflow-panel.tsx
index 8cbdb1a..3d15d4f 100644
--- a/src/views/workflow-panel/workflow-panel.tsx
+++ b/src/views/workflow-panel/workflow-panel.tsx
@@ -6,25 +6,23 @@ import * as React from 'react';
import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
import { connect, DispatchProp } from 'react-redux';
import { RootState } from '~/store/store';
-import { WorkflowIcon, ShareIcon } from '~/components/icon/icon';
-import { ResourcesState, getResource } from '~/store/resources/resources';
-import { navigateTo } from "~/store/navigation/navigation-action";
-import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
+import { WorkflowIcon } from '~/components/icon/icon';
+import { ResourcesState } from '~/store/resources/resources';
import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
import { WORKFLOW_PANEL_ID } from '~/store/workflow-panel/workflow-panel-actions';
-import { openContextMenu } from '~/store/context-menu/context-menu-actions';
-import { GroupResource } from '~/models/group';
-import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
import {
ResourceLastModifiedDate,
RosurceWorkflowName,
- ResourceWorkflowStatus
+ ResourceWorkflowStatus,
+ ResourceShare
} from "~/views-components/data-explorer/renderers";
import { SortDirection } from '~/components/data-table/data-column';
import { DataColumns } from '~/components/data-table/data-table';
import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
-import { Grid, Tooltip, IconButton } from '@material-ui/core';
-import { WorkflowDescriptionCard } from './workflow-description-card';
+import { Grid } from '@material-ui/core';
+import { WorkflowDetailsCard } from './workflow-description-card';
+import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
+import { navigateTo } from '~/store/navigation/navigation-action';
export enum WorkflowPanelColumnNames {
NAME = "Name",
@@ -60,14 +58,6 @@ const resourceStatus = (type: string) => {
}
};
-const ResourceShare = (props: { uuid: string }) => {
- return <Tooltip title="Share">
- <IconButton onClick={() => undefined}>
- <ShareIcon />
- </IconButton>
- </Tooltip>;
-};
-
export const workflowPanelColumns: DataColumns<string, WorkflowPanelFilter> = [
{
name: WorkflowPanelColumnNames.NAME,
@@ -130,29 +120,15 @@ export const WorkflowPanel = connect((state: RootState) => ({
id={WORKFLOW_PANEL_ID}
onRowClick={this.handleRowClick}
onRowDoubleClick={this.handleRowDoubleClick}
- onContextMenu={this.handleContextMenu}
contextMenuColumn={false}
dataTableDefaultView={<DataTableDefaultView icon={WorkflowIcon} />} />
</Grid>
<Grid item xs={6}>
- <WorkflowDescriptionCard />
+ <WorkflowDetailsCard />
</Grid>
</Grid>;
}
- handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
- const resource = getResource<GroupResource>(resourceUuid)(this.props.resources);
- if (resource) {
- this.props.dispatch<any>(openContextMenu(event, {
- name: '',
- uuid: resource.uuid,
- ownerUuid: resource.ownerUuid,
- isTrashed: resource.isTrashed,
- kind: resource.kind,
- menuKind: ContextMenuKind.PROJECT,
- }));
- }
- }
handleRowDoubleClick = (uuid: string) => {
this.props.dispatch<any>(navigateTo(uuid));
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list