[arvados-workbench2] created: 2.4.0-62-gcc9e1b29
git repository hosting
git at public.arvados.org
Fri May 20 22:25:24 UTC 2022
at cc9e1b294ee50dbb25d68e89538ac1a7a3643396 (commit)
commit cc9e1b294ee50dbb25d68e89538ac1a7a3643396
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri May 20 18:24:53 2022 -0400
19143: Workflow objects appear in project view, are runnable.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/src/models/details.ts b/src/models/details.ts
index 150b6940..b6eabd70 100644
--- a/src/models/details.ts
+++ b/src/models/details.ts
@@ -7,5 +7,6 @@ import { CollectionResource } from "./collection";
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;
diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts
index 1cdb6784..973ba25a 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -8,6 +8,7 @@ import { ResourceKind, extractUuidKind } from 'models/resource';
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';
@@ -40,6 +41,9 @@ export const navigateTo = (uuid: string) =>
case ResourceKind.VIRTUAL_MACHINE:
dispatch<any>(navigateToAdminVirtualMachines);
return;
+ case ResourceKind.WORKFLOW:
+ dispatch<any>(openDetailsPanel(uuid));
+ return;
}
switch (uuid) {
diff --git a/src/views-components/details-panel/details-panel.tsx b/src/views-components/details-panel/details-panel.tsx
index 399f4ef4..adbbab79 100644
--- a/src/views-components/details-panel/details-panel.tsx
+++ b/src/views-components/details-panel/details-panel.tsx
@@ -18,6 +18,7 @@ import { ProjectDetails } from "./project-details";
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';
@@ -71,6 +72,8 @@ const getItem = (res: DetailsResource): DetailsData => {
return new CollectionDetails(res);
case ResourceKind.PROCESS:
return new ProcessDetails(res);
+ case ResourceKind.WORKFLOW:
+ return new WorkflowDetails(res);
default:
return new EmptyDetails(res);
}
@@ -152,9 +155,9 @@ export const DetailsPanel = withStyles(styles)(
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;
}
@@ -191,14 +194,14 @@ export const DetailsPanel = withStyles(styles)(
</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 >;
}
diff --git a/src/views/workflow-panel/workflow-description-card.tsx b/src/views/workflow-panel/workflow-description-card.tsx
index b9e89c76..e93caea4 100644
--- a/src/views/workflow-panel/workflow-description-card.tsx
+++ b/src/views/workflow-panel/workflow-description-card.tsx
@@ -15,16 +15,14 @@ import {
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';
@@ -58,10 +56,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
},
});
-interface WorkflowDetailsCardDataProps {
- workflow?: WorkflowResource;
-}
-
type WorkflowDetailsCardProps = WorkflowDetailsCardDataProps & WithStyles<CssRules>;
export const WorkflowDetailsCard = withStyles(styles)(
@@ -150,29 +144,3 @@ 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 >;
-};
commit b375eb7f05d9862716f5c27ef8450043453c52ba
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri May 20 16:58:48 2022 -0400
19143: Make workflows show up in projects view WIP
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/src/common/labels.ts b/src/common/labels.ts
index 682513fb..e784cec0 100644
--- a/src/common/labels.ts
+++ b/src/common/labels.ts
@@ -23,6 +23,8 @@ export const resourceLabel = (type: string, subtype = '') => {
return "Group";
case ResourceKind.VIRTUAL_MACHINE:
return "Virtual Machine";
+ case ResourceKind.WORKFLOW:
+ return "Workflow";
default:
return "Unknown";
}
diff --git a/src/index.tsx b/src/index.tsx
index f928ea8a..03840d49 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -62,6 +62,7 @@ import { linkActionSet } from 'views-components/context-menu/action-sets/link-ac
import { loadFileViewersConfig } from 'store/file-viewers/file-viewers-actions';
import { filterGroupAdminActionSet, projectAdminActionSet } from 'views-components/context-menu/action-sets/project-admin-action-set';
import { permissionEditActionSet } from 'views-components/context-menu/action-sets/permission-edit-action-set';
+import { workflowActionSet } from 'views-components/context-menu/action-sets/workflow-action-set';
import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
import { openNotFoundDialog } from './store/not-found-panel/not-found-panel-action';
import { storeRedirects } from './common/redirect-to';
@@ -102,6 +103,7 @@ addMenuActionSet(ContextMenuKind.PROCESS_ADMIN, processResourceAdminActionSet);
addMenuActionSet(ContextMenuKind.PROJECT_ADMIN, projectAdminActionSet);
addMenuActionSet(ContextMenuKind.FILTER_GROUP_ADMIN, filterGroupAdminActionSet);
addMenuActionSet(ContextMenuKind.PERMISSION_EDIT, permissionEditActionSet);
+addMenuActionSet(ContextMenuKind.WORKFLOW, workflowActionSet);
storeRedirects();
diff --git a/src/store/context-menu/context-menu-actions.ts b/src/store/context-menu/context-menu-actions.ts
index bc7f94b0..3e239fee 100644
--- a/src/store/context-menu/context-menu-actions.ts
+++ b/src/store/context-menu/context-menu-actions.ts
@@ -261,6 +261,8 @@ export const resourceUuidToContextMenuKind = (uuid: string, readonly = false) =>
return ContextMenuKind.ROOT_PROJECT;
case ResourceKind.LINK:
return ContextMenuKind.LINK;
+ case ResourceKind.WORKFLOW:
+ return ContextMenuKind.WORKFLOW;
default:
return;
}
diff --git a/src/store/resource-type-filters/resource-type-filters.ts b/src/store/resource-type-filters/resource-type-filters.ts
index a39807d5..b1c52e4f 100644
--- a/src/store/resource-type-filters/resource-type-filters.ts
+++ b/src/store/resource-type-filters/resource-type-filters.ts
@@ -27,6 +27,7 @@ export enum ObjectTypeFilter {
PROJECT = 'Project',
PROCESS = 'Process',
COLLECTION = 'Data collection',
+ WORKFLOW = 'Workflow',
}
export enum GroupTypeFilter {
@@ -62,6 +63,7 @@ export const getSimpleObjectTypeFilters = pipe(
initFilter(ObjectTypeFilter.PROJECT),
initFilter(ObjectTypeFilter.PROCESS),
initFilter(ObjectTypeFilter.COLLECTION),
+ initFilter(ObjectTypeFilter.WORKFLOW),
);
// Using pipe() with more than 7 arguments makes the return type be 'any',
@@ -84,6 +86,8 @@ export const getInitialResourceTypeFilters = pipe(
initFilter(CollectionTypeFilter.OUTPUT_COLLECTION, ObjectTypeFilter.COLLECTION),
initFilter(CollectionTypeFilter.LOG_COLLECTION, ObjectTypeFilter.COLLECTION),
),
+ initFilter(ObjectTypeFilter.WORKFLOW)
+
);
export const getInitialProcessTypeFilters = pipe(
@@ -130,6 +134,8 @@ const objectTypeToResourceKind = (type: ObjectTypeFilter) => {
return ResourceKind.PROCESS;
case ObjectTypeFilter.COLLECTION:
return ResourceKind.COLLECTION;
+ case ObjectTypeFilter.WORKFLOW:
+ return ResourceKind.WORKFLOW;
}
};
@@ -273,7 +279,7 @@ export const serializeSimpleObjectTypeFilters = (filters: Tree<DataTableFilterIt
.map(objectTypeToResourceKind);
};
-export const buildProcessStatusFilters = ( fb: FilterBuilder, activeStatusFilter: string, resourcePrefix?: string ): FilterBuilder => {
+export const buildProcessStatusFilters = (fb: FilterBuilder, activeStatusFilter: string, resourcePrefix?: string): FilterBuilder => {
switch (activeStatusFilter) {
case ProcessStatusFilter.ONHOLD: {
fb.addDistinct('state', ContainerRequestState.FINAL, resourcePrefix);
diff --git a/src/views-components/context-menu/context-menu.tsx b/src/views-components/context-menu/context-menu.tsx
index 6f3a4389..4766259a 100644
--- a/src/views-components/context-menu/context-menu.tsx
+++ b/src/views-components/context-menu/context-menu.tsx
@@ -70,7 +70,7 @@ export const addMenuActionSet = (name: string, itemSet: ContextMenuActionSet) =>
const emptyActionSet: ContextMenuActionSet = [];
const getMenuActionSet = (resource?: ContextMenuResource): ContextMenuActionSet => (
- resource ? menuActionSets.get(resource.menuKind) || emptyActionSet : emptyActionSet
+ resource ? menuActionSets.get(resource.menuKind) || emptyActionSet : emptyActionSet
);
export enum ContextMenuKind {
@@ -110,4 +110,5 @@ export enum ContextMenuKind {
GROUP_MEMBER = "GroupMember",
PERMISSION_EDIT = "PermissionEdit",
LINK = "Link",
+ WORKFLOW = "Workflow",
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list