import { ProcessResource } from "./process";
import { EmptyResource } from "./empty";
import { CollectionFile, CollectionDirectory } from 'models/collection-file';
+import { WorkflowResource } from 'models/workflow';
-export type DetailsResource = ProjectResource | CollectionResource | ProcessResource | EmptyResource | CollectionFile | CollectionDirectory;
+export type DetailsResource = ProjectResource | CollectionResource | ProcessResource | EmptyResource | CollectionFile | CollectionDirectory | WorkflowResource;
import { SidePanelTreeCategory } from '../side-panel-tree/side-panel-tree-actions';
import { Routes, getGroupUrl, getNavUrl, getUserProfileUrl } from 'routes/routes';
import { RootState } from 'store/store';
+import { openDetailsPanel } from 'store/details-panel/details-panel-action';
import { ServiceRepository } from 'services/services';
import { pluginConfig } from 'plugins';
import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
case ResourceKind.VIRTUAL_MACHINE:
dispatch<any>(navigateToAdminVirtualMachines);
return;
+ case ResourceKind.WORKFLOW:
+ dispatch<any>(openDetailsPanel(uuid));
+ return;
}
switch (uuid) {
import { CollectionDetails } from "./collection-details";
import { ProcessDetails } from "./process-details";
import { EmptyDetails } from "./empty-details";
+import { WorkflowDetails } from "./workflow-details";
import { DetailsData } from "./details-data";
import { DetailsResource } from "models/details";
import { Config } from 'common/config';
return new CollectionDetails(res);
case ResourceKind.PROCESS:
return new ProcessDetails(res);
+ case ResourceKind.WORKFLOW:
+ return new WorkflowDetails(res);
default:
return new EmptyDetails(res);
}
let shouldShowInlinePreview = false;
if (!('kind' in res)) {
shouldShowInlinePreview = isInlineFileUrlSafe(
- res ? res.url : "",
- authConfig.keepWebServiceUrl,
- authConfig.keepWebInlineServiceUrl
+ res ? res.url : "",
+ authConfig.keepWebServiceUrl,
+ authConfig.keepWebInlineServiceUrl
) || authConfig.clusterConfig.Collections.TrustAllContent;
}
</Grid>
<Grid item>
<Tabs onChange={this.handleChange}
- value={(item.getTabLabels().length >= tabNr+1) ? tabNr : 0}>
- { item.getTabLabels().map((tabLabel, idx) =>
+ value={(item.getTabLabels().length >= tabNr + 1) ? tabNr : 0}>
+ {item.getTabLabels().map((tabLabel, idx) =>
<Tab key={`tab-label-${idx}`} disableRipple label={tabLabel} />)
}
</Tabs>
</Grid>
<Grid item xs className={this.props.classes.tabContainer} >
- {item.getDetails({tabNr, showPreview: shouldShowInlinePreview})}
+ {item.getDetails({ tabNr, showPreview: shouldShowInlinePreview })}
</Grid>
</Grid >;
}
TableCell,
TableBody,
TableRow,
- Grid,
} 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, parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow';
+import { parseWorkflowDefinition, getWorkflowInputs, getInputLabel, stringifyInputType } from 'models/workflow';
// import { WorkflowGraph } from "views/workflow-panel/workflow-graph";
-import { DetailsAttribute } from 'components/details-attribute/details-attribute';
-import { ResourceOwnerWithName } from 'views-components/data-explorer/renderers';
-import { formatDate } from "common/formatters";
+
+import { WorkflowDetailsCardDataProps, WorkflowDetailsAttributes } from 'views-components/details-panel/workflow-details';
export type CssRules = 'root' | 'tab' | 'inputTab' | 'graphTab' | 'graphTabWithChosenWorkflow' | 'descriptionTab' | 'inputsTable';
},
});
-interface WorkflowDetailsCardDataProps {
- workflow?: WorkflowResource;
-}
-
type WorkflowDetailsCardProps = WorkflowDetailsCardDataProps & WithStyles<CssRules>;
export const WorkflowDetailsCard = withStyles(styles)(
</Table>;
}
});
-
-export const WorkflowDetailsAttributes = ({ workflow }: WorkflowDetailsCardDataProps) => {
- return <Grid container>
- <Grid item xs={12} >
- <DetailsAttribute
- label={"Workflow UUID"}
- linkToUuid={workflow?.uuid} />
- </Grid>
- <Grid item xs={12} >
- <DetailsAttribute
- label='Owner' linkToUuid={workflow?.ownerUuid}
- uuidEnhancer={(uuid: string) => <ResourceOwnerWithName uuid={uuid} />} />
- </Grid>
- <Grid item xs={12}>
- <DetailsAttribute label='Created at' value={formatDate(workflow?.createdAt)} />
- </Grid>
- <Grid item xs={12}>
- <DetailsAttribute label='Last modified' value={formatDate(workflow?.modifiedAt)} />
- </Grid>
- <Grid item xs={12} >
- <DetailsAttribute
- label='Last modified by user' linkToUuid={workflow?.modifiedByUserUuid}
- uuidEnhancer={(uuid: string) => <ResourceOwnerWithName uuid={uuid} />} />
- </Grid>
- </Grid >;
-};