X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/95b86eb6b3184b787b570a906347ccaac32195c6..bfd0188773272d62ac8b9196c3a445d83a5719aa:/src/views/search-results-panel/search-results-panel-view.tsx

diff --git a/src/views/search-results-panel/search-results-panel-view.tsx b/src/views/search-results-panel/search-results-panel-view.tsx
index ea658ee725..ca95421753 100644
--- a/src/views/search-results-panel/search-results-panel-view.tsx
+++ b/src/views/search-results-panel/search-results-panel-view.tsx
@@ -8,12 +8,10 @@ import { DataColumns } from '~/components/data-table/data-table';
 import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
 import { ResourceKind } from '~/models/resource';
 import { ContainerRequestState } from '~/models/container-request';
-import { resourceLabel } from '~/common/labels';
-import { SearchBarAdvanceFormData } from '~/models/search-bar';
 import { SEARCH_RESULTS_PANEL_ID } from '~/store/search-results-panel/search-results-panel-actions';
 import { DataExplorer } from '~/views-components/data-explorer/data-explorer';
 import {
-    ProcessStatus,
+    ProcessStatus, ResourceCluster,
     ResourceFileSize,
     ResourceLastModifiedDate,
     ResourceName,
@@ -21,9 +19,13 @@ import {
     ResourceType
 } from '~/views-components/data-explorer/renderers';
 import { createTree } from '~/models/tree';
-import { getInitialResourceTypeFilters } from '../../store/resource-type-filters/resource-type-filters';
-// TODO: code clean up
+import { getInitialResourceTypeFilters } from '~/store/resource-type-filters/resource-type-filters';
+import { SearchResultsPanelProps } from "./search-results-panel";
+import { Link } from 'react-router-dom';
+import { Routes } from '~/routes/routes';
+
 export enum SearchResultsPanelColumnNames {
+    CLUSTER = "Cluster",
     NAME = "Name",
     PROJECT = "Project",
     STATUS = "Status",
@@ -33,29 +35,23 @@ export enum SearchResultsPanelColumnNames {
     LAST_MODIFIED = "Last modified"
 }
 
-export interface SearchResultsPanelDataProps {
-    data: SearchBarAdvanceFormData;
-}
-
-export interface SearchResultsPanelActionProps {
-    onItemClick: (item: string) => void;
-    onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string) => void;
-    onDialogOpen: (ownerUuid: string) => void;
-    onItemDoubleClick: (item: string) => void;
-}
-
-export type SearchResultsPanelProps = SearchResultsPanelDataProps & SearchResultsPanelActionProps;
-
 export interface WorkflowPanelFilter extends DataTableFilterItem {
     type: ResourceKind | ContainerRequestState;
 }
 
 export const searchResultsPanelColumns: DataColumns<string> = [
+    {
+        name: SearchResultsPanelColumnNames.CLUSTER,
+        selected: true,
+        configurable: true,
+        filters: createTree(),
+        render: (uuid: string) => <ResourceCluster uuid={uuid} />
+    },
     {
         name: SearchResultsPanelColumnNames.NAME,
         selected: true,
         configurable: true,
-        sortDirection: SortDirection.ASC,
+        sortDirection: SortDirection.NONE,
         filters: createTree(),
         render: (uuid: string) => <ResourceName uuid={uuid} />
     },
@@ -98,17 +94,28 @@ export const searchResultsPanelColumns: DataColumns<string> = [
         name: SearchResultsPanelColumnNames.LAST_MODIFIED,
         selected: true,
         configurable: true,
-        sortDirection: SortDirection.NONE,
+        sortDirection: SortDirection.DESC,
         filters: createTree(),
         render: uuid => <ResourceLastModifiedDate uuid={uuid} />
     }
 ];
 
 export const SearchResultsPanelView = (props: SearchResultsPanelProps) => {
+    const homeCluster = props.user.uuid.substr(0, 5);
+    const loggedIn = props.sessions.filter((ss) => ss.loggedIn);
     return <DataExplorer
         id={SEARCH_RESULTS_PANEL_ID}
         onRowClick={props.onItemClick}
         onRowDoubleClick={props.onItemDoubleClick}
         onContextMenu={props.onContextMenu}
-        contextMenuColumn={true} />;
-};
\ No newline at end of file
+        contextMenuColumn={false}
+        hideSearchInput
+        title={
+            <div>{(props.localCluster !== homeCluster && loggedIn.length === 1) ?
+                <span>Searching local cluster {props.localCluster} only.  To search multiple clusters, <a href={props.remoteHostsConfig[homeCluster] && props.remoteHostsConfig[homeCluster].workbench2Url}> start from your home Workbench.</a></span> :
+                <span>Searching clusters: {loggedIn.map((ss) => <span key={ss.clusterId}> {ss.clusterId}</span>)}</span>}
+                <Link to={Routes.SITE_MANAGER} style={{ marginLeft: "2em" }}>Site Manager</Link>
+            </div>
+        }
+    />;
+};
