import { ArvadosTheme } from '~/common/custom-theme';
import { compose } from 'redux';
import { WorkflowResource } from '~/models/workflow';
+import { ResourceStatus } from '~/views/workflow-panel/workflow-panel';
export const renderName = (item: { name: string; uuid: string, kind: string }) =>
<Grid container alignItems="center" wrap="nowrap" spacing={16}>
return <Typography noWrap style={{ minWidth: '100px' }}>{formatDate(date)}</Typography>;
};
-export const renderWorkflowStatus = () => {
- return <Typography noWrap style={{ width: '60px' }}>{"Public"}</Typography>;
+export const renderWorkflowStatus = (ownerUuid?: string) => {
+ if (ownerUuid === 'qr1hi-j7d0g-2ax8o1pscovq2lg') {
+ return <Typography noWrap style={{ width: '60px' }}>{ResourceStatus.PUBLIC}</Typography>;
+ } else {
+ return <Typography noWrap style={{ width: '60px' }}>{ResourceStatus.PRIVATE}</Typography>;
+ }
};
export const ResourceWorkflowStatus = connect(
(state: RootState, props: { uuid: string }) => {
const resource = getResource<WorkflowResource>(props.uuid)(state.resources);
- return {};
- })((props: { status?: string }) => renderWorkflowStatus());
+ return { ownerUuid: resource ? resource.ownerUuid : '' };
+ })((props: { ownerUuid?: string }) => renderWorkflowStatus(props.ownerUuid));
export const ResourceLastModifiedDate = connect(
(state: RootState, props: { uuid: string }) => {
SHARE = 'Share'
}
+export interface WorkflowPanelFilter extends DataTableFilterItem {
+ type: ResourceStatus;
+}
+
interface WorkflowPanelDataProps {
resources: ResourcesState;
}
export enum ResourceStatus {
- PUBLIC = 'public',
- PRIVATE = 'private',
- SHARED = 'shared'
+ PUBLIC = "Public",
+ PRIVATE = "Private",
+ SHARED = "Shared"
}
const resourceStatus = (type: string) => {
</Tooltip>;
};
-export const workflowPanelColumns: DataColumns<string, DataTableFilterItem> = [
+export const workflowPanelColumns: DataColumns<string, WorkflowPanelFilter> = [
{
name: WorkflowPanelColumnNames.NAME,
selected: true,
name: WorkflowPanelColumnNames.AUTHORISATION,
selected: true,
configurable: true,
- sortDirection: SortDirection.NONE,
filters: [
{
name: resourceStatus(ResourceStatus.PUBLIC),
selected: true,
+ type: ResourceStatus.PUBLIC
},
{
name: resourceStatus(ResourceStatus.PRIVATE),
selected: true,
+ type: ResourceStatus.PRIVATE
},
{
name: resourceStatus(ResourceStatus.SHARED),
selected: true,
+ type: ResourceStatus.SHARED
}
],
render: (uuid: string) => <ResourceWorkflowStatus uuid={uuid} />,
{
name: '',
selected: true,
- configurable: true,
- sortDirection: SortDirection.NONE,
+ configurable: false,
filters: [],
render: (uuid: string) => <ResourceShare uuid={uuid} />
}