X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6653b7a7edbac351f5b3734114d6b5904dda1acc..e01c4dd1a518a03e948fffcb5f5d3c33534cbca2:/src/views/workflow-panel/workflow-panel-view.tsx

diff --git a/src/views/workflow-panel/workflow-panel-view.tsx b/src/views/workflow-panel/workflow-panel-view.tsx
index c48f46ad8c..44e14fd3c3 100644
--- a/src/views/workflow-panel/workflow-panel-view.tsx
+++ b/src/views/workflow-panel/workflow-panel-view.tsx
@@ -2,23 +2,24 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
-import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
-import { WorkflowIcon } from '~/components/icon/icon';
-import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
-import { WORKFLOW_PANEL_ID, workflowPanelActions } from '~/store/workflow-panel/workflow-panel-actions';
+import React from 'react';
+import { DataExplorer } from "views-components/data-explorer/data-explorer";
+import { WorkflowIcon } from 'components/icon/icon';
+import { WORKFLOW_PANEL_ID } from 'store/workflow-panel/workflow-panel-actions';
 import {
     ResourceLastModifiedDate,
-    RosurceWorkflowName,
+    ResourceWorkflowName,
     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 } from '@material-ui/core';
+    ResourceShare,
+    ResourceRunProcess
+} 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, Paper } from '@material-ui/core';
 import { WorkflowDetailsCard } from './workflow-description-card';
-import { WorkflowResource } from '../../models/workflow';
+import { WorkflowResource } from 'models/workflow';
+import { createTree } from 'models/tree';
 
 export enum WorkflowPanelColumnNames {
     NAME = "Name",
@@ -48,49 +49,52 @@ export enum ResourceStatus {
     SHARED = "Shared"
 }
 
-const resourceStatus = (type: string) => {
-    switch (type) {
-        case ResourceStatus.PUBLIC:
-            return "Public";
-        case ResourceStatus.PRIVATE:
-            return "Private";
-        case ResourceStatus.SHARED:
-            return "Shared";
-        default:
-            return "Unknown";
-    }
-};
+// TODO: restore filters
+// const resourceStatus = (type: string) => {
+//     switch (type) {
+//         case ResourceStatus.PUBLIC:
+//             return "Public";
+//         case ResourceStatus.PRIVATE:
+//             return "Private";
+//         case ResourceStatus.SHARED:
+//             return "Shared";
+//         default:
+//             return "Unknown";
+//     }
+// };
 
-export const workflowPanelColumns: DataColumns<string, WorkflowPanelFilter> = [
+export const workflowPanelColumns: DataColumns<string> = [
     {
         name: WorkflowPanelColumnNames.NAME,
         selected: true,
         configurable: true,
         sortDirection: SortDirection.ASC,
-        filters: [],
-        render: (uuid: string) => <RosurceWorkflowName uuid={uuid} />
+        filters: createTree(),
+        render: (uuid: string) => <ResourceWorkflowName uuid={uuid} />
     },
     {
         name: WorkflowPanelColumnNames.AUTHORISATION,
         selected: true,
         configurable: true,
-        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
-            }
-        ],
+        filters: createTree(),
+        // TODO: restore filters
+        // 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} />,
     },
     {
@@ -98,30 +102,41 @@ export const workflowPanelColumns: DataColumns<string, WorkflowPanelFilter> = [
         selected: true,
         configurable: true,
         sortDirection: SortDirection.NONE,
-        filters: [],
+        filters: createTree(),
         render: (uuid: string) => <ResourceLastModifiedDate uuid={uuid} />
     },
     {
         name: '',
         selected: true,
         configurable: false,
-        filters: [],
+        filters: createTree(),
         render: (uuid: string) => <ResourceShare uuid={uuid} />
+    },
+    {
+        name: '',
+        selected: true,
+        configurable: false,
+        filters: createTree(),
+        render: (uuid: string) => <ResourceRunProcess uuid={uuid} />
     }
 ];
 
 export const WorkflowPanelView = (props: WorkflowPanelProps) => {
-    return <Grid container spacing={16}>
+    return <Grid container spacing={16} style={{ minHeight: '500px' }}>
         <Grid item xs={6}>
             <DataExplorer
                 id={WORKFLOW_PANEL_ID}
                 onRowClick={props.handleRowClick}
                 onRowDoubleClick={props.handleRowDoubleClick}
                 contextMenuColumn={false}
-                dataTableDefaultView={<DataTableDefaultView icon={WorkflowIcon} />} />
+                onContextMenu={e => e}
+                defaultViewIcon={WorkflowIcon}
+                defaultViewMessages={['Workflow list is empty.']} />
         </Grid>
         <Grid item xs={6}>
-            <WorkflowDetailsCard workflow={props.workflow} />
+            <Paper style={{ height: '100%' }}>
+                <WorkflowDetailsCard workflow={props.workflow} />
+            </Paper>
         </Grid>
     </Grid>;
-};
\ No newline at end of file
+};
