X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/da85f1807c0223ab3de12448ae75df5482a457d8..8ff2ace73eab152113f8eec5027a302df48d31a5:/src/views/subprocess-panel/subprocess-panel-root.tsx?ds=sidebyside

diff --git a/src/views/subprocess-panel/subprocess-panel-root.tsx b/src/views/subprocess-panel/subprocess-panel-root.tsx
index fac421bc..e35a5712 100644
--- a/src/views/subprocess-panel/subprocess-panel-root.tsx
+++ b/src/views/subprocess-panel/subprocess-panel-root.tsx
@@ -2,20 +2,21 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
-import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
-import { DataColumns } from '~/components/data-table/data-table';
-import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
-import { ContainerRequestState } from '~/models/container-request';
-import { SortDirection } from '~/components/data-table/data-column';
-import { ResourceKind } from '~/models/resource';
-import { ResourceCreatedAtDate, ProcessStatus, ContainerRunTime } from '~/views-components/data-explorer/renderers';
-import { ProcessIcon } from '~/components/icon/icon';
-import { ResourceName } from '~/views-components/data-explorer/renderers';
-import { SUBPROCESS_PANEL_ID } from '~/store/subprocess-panel/subprocess-panel-actions';
-import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
-import { createTree } from '~/models/tree';
-import { getInitialProcessStatusFilters } from '~/store/resource-type-filters/resource-type-filters';
+import React from 'react';
+import { DataExplorer } from "views-components/data-explorer/data-explorer";
+import { DataColumns } from 'components/data-table/data-table';
+import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters';
+import { ContainerRequestState } from 'models/container-request';
+import { SortDirection } from 'components/data-table/data-column';
+import { ResourceKind } from 'models/resource';
+import { ResourceCreatedAtDate, ProcessStatus, ContainerRunTime } from 'views-components/data-explorer/renderers';
+import { ProcessIcon } from 'components/icon/icon';
+import { ResourceName } from 'views-components/data-explorer/renderers';
+import { SUBPROCESS_PANEL_ID } from 'store/subprocess-panel/subprocess-panel-actions';
+import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
+import { createTree } from 'models/tree';
+import { getInitialProcessStatusFilters } from 'store/resource-type-filters/resource-type-filters';
+import { ResourcesState } from 'store/resources/resources';
 
 export enum SubprocessPanelColumnNames {
     NAME = "Name",
@@ -63,27 +64,36 @@ export const subprocessPanelColumns: DataColumns<string> = [
 ];
 
 export interface SubprocessPanelDataProps {
-    isAdmin: boolean;
+    resources: ResourcesState;
+    panelName?: string;
 }
 
 export interface SubprocessPanelActionProps {
     onItemClick: (item: string) => void;
-    onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string, isAdmin: boolean) => void;
+    onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string, resources: ResourcesState) => void;
     onItemDoubleClick: (item: string) => void;
+    doHidePanel?: () => void;
 }
 
 type SubprocessPanelProps = SubprocessPanelActionProps & SubprocessPanelDataProps;
 
+const DEFAULT_VIEW_MESSAGES = [
+    'No subprocesses available for listing.',
+    'The current process may not have any or none matches current filtering.'
+];
+
 export const SubprocessPanelRoot = (props: SubprocessPanelProps) => {
     return <DataExplorer
         id={SUBPROCESS_PANEL_ID}
         onRowClick={props.onItemClick}
         onRowDoubleClick={props.onItemDoubleClick}
-        onContextMenu={(event, item) => props.onContextMenu(event, item, props.isAdmin)}
+        onContextMenu={(event, item) => props.onContextMenu(event, item, props.resources)}
         contextMenuColumn={true}
         dataTableDefaultView={
             <DataTableDefaultView
                 icon={ProcessIcon}
-                messages={['This process has no subprocesses.']} />
-        } />;
+                messages={DEFAULT_VIEW_MESSAGES} />
+        }
+        doHidePanel={props.doHidePanel}
+        panelName={props.panelName} />;
 };
\ No newline at end of file
