import { CollectionResource } from "~/models/collection";
import { ProjectResource } from "~/models/project";
import { ProcessResource } from "~/models/process";
+import { WorkflowResource } from "~/models/workflow";
import { TrashableResourceService } from "~/services/common-service/trashable-resource-service";
import { ApiActions } from "~/services/api/api-actions";
import { GroupResource } from "~/models/group";
export type GroupContentsResource =
CollectionResource |
ProjectResource |
- ProcessResource;
+ ProcessResource |
+ WorkflowResource;
export class GroupsService<T extends GroupResource = GroupResource> extends TrashableResourceService<T> {
export enum GroupContentsResourcePrefix {
COLLECTION = "collections",
PROJECT = "groups",
- PROCESS = "container_requests"
+ PROCESS = "container_requests",
+ WORKFLOW = "workflows"
}
import { Grid, Typography, withStyles, Tooltip, IconButton, Checkbox } from '@material-ui/core';
import { FavoriteStar, PublicFavoriteStar } from '../favorite-star/favorite-star';
import { ResourceKind, TrashableResource } from '~/models/resource';
-import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon, WorkflowIcon, ShareIcon } from '~/components/icon/icon';
+import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon, ShareIcon, CollectionOldVersionIcon, WorkflowIcon } from '~/components/icon/icon';
import { formatDate, formatFileSize, formatTime } from '~/common/formatters';
import { resourceLabel } from '~/common/labels';
import { connect, DispatchProp } from 'react-redux';
import { CollectionResource } from '~/models/collection';
import { IllegalNamingWarning } from '~/components/warning/warning';
-const renderName = (dispatch: Dispatch, item: { name: string; uuid: string, kind: string }) =>
+const renderName = (dispatch: Dispatch, item: GroupContentsResource) =>
<Grid container alignItems="center" wrap="nowrap" spacing={16}>
<Grid item>
- {renderIcon(item.kind)}
+ {renderIcon(item)}
</Grid>
<Grid item>
<Typography color="primary" style={{ width: 'auto', cursor: 'pointer' }} onClick={() => dispatch<any>(navigateTo(item.uuid))}>
export const ResourceName = connect(
(state: RootState, props: { uuid: string }) => {
const resource = getResource<GroupContentsResource>(props.uuid)(state.resources);
- return resource || { name: '', uuid: '', kind: '' };
- })((resource: { name: string; uuid: string, kind: string } & DispatchProp<any>) => renderName(resource.dispatch, resource));
+ return resource;
+ })((resource: GroupContentsResource & DispatchProp<any>) => renderName(resource.dispatch, resource));
-const renderIcon = (kind: string) => {
- switch (kind) {
+const renderIcon = (item: GroupContentsResource) => {
+ switch (item.kind) {
case ResourceKind.PROJECT:
return <ProjectIcon />;
case ResourceKind.COLLECTION:
- return <CollectionIcon />;
+ if (item.uuid === item.currentVersionUuid) {
+ return <CollectionIcon />;
+ }
+ return <CollectionOldVersionIcon />;
case ResourceKind.PROCESS:
return <ProcessIcon />;
case ResourceKind.WORKFLOW:
return <Typography noWrap style={{ minWidth: '100px' }}>{formatDate(date)}</Typography>;
};
-const renderWorkflowName = (item: { name: string; uuid: string, kind: string, ownerUuid: string }) =>
+const renderWorkflowName = (item: WorkflowResource) =>
<Grid container alignItems="center" wrap="nowrap" spacing={16}>
<Grid item>
- {renderIcon(item.kind)}
+ {renderIcon(item)}
</Grid>
<Grid item>
<Typography color="primary" style={{ width: '100px' }}>
export const ResourceWorkflowName = connect(
(state: RootState, props: { uuid: string }) => {
const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
- return resource || { name: '', uuid: '', kind: '', ownerUuid: '' };
+ return resource;
})(renderWorkflowName);
const getPublicUuid = (uuidPrefix: string) => {
import { DataColumns } from '~/components/data-table/data-table';
import { SortDirection } from '~/components/data-table/data-column';
import { createTree } from '~/models/tree';
-import { ResourceName, ResourceOwnerName, ResourceLastModifiedDate } from '~/views-components/data-explorer/renderers';
+import { ResourceName, ResourceOwnerName, ResourceLastModifiedDate, ResourceStatus } from '~/views-components/data-explorer/renderers';
type CssRules = 'backLink' | 'backIcon' | 'card' | 'title' | 'iconHeader' | 'link';
enum CollectionContentAddressPanelColumnNames {
COLLECTION_WITH_THIS_ADDRESS = "Collection with this address",
+ STATUS = "Status",
LOCATION = "Location",
LAST_MODIFIED = "Last modified"
}
filters: createTree(),
render: uuid => <ResourceName uuid={uuid} />
},
+ {
+ name: CollectionContentAddressPanelColumnNames.STATUS,
+ selected: true,
+ configurable: true,
+ filters: createTree(),
+ render: uuid => <ResourceStatus uuid={uuid} />
+ },
{
name: CollectionContentAddressPanelColumnNames.LOCATION,
selected: true,