X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f6cb749fd3c67e2cbb74198e4d037e3c52e1267a..e02fcdadca54f1dc970734f7c5ce0bc6407e10c6:/src/views/shared-with-me-panel/shared-with-me-panel.tsx

diff --git a/src/views/shared-with-me-panel/shared-with-me-panel.tsx b/src/views/shared-with-me-panel/shared-with-me-panel.tsx
index 582aa9c741..eb3127a761 100644
--- a/src/views/shared-with-me-panel/shared-with-me-panel.tsx
+++ b/src/views/shared-with-me-panel/shared-with-me-panel.tsx
@@ -2,20 +2,23 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
-import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
+import { DataExplorer } from "views-components/data-explorer/data-explorer";
 import { connect, DispatchProp } from 'react-redux';
-import { RootState } from '~/store/store';
-import { ArvadosTheme } from '~/common/custom-theme';
-import { ShareMeIcon } from '~/components/icon/icon';
-import { ResourcesState, getResource } from '~/store/resources/resources';
-import { navigateTo } from "~/store/navigation/navigation-action";
-import { loadDetailsPanel } from "~/store/details-panel/details-panel-action";
-import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
-import { SHARED_WITH_ME_PANEL_ID } from '~/store/shared-with-me-panel/shared-with-me-panel-actions';
-import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
-import { GroupResource } from '~/models/group';
+import { RootState } from 'store/store';
+import { ArvadosTheme } from 'common/custom-theme';
+import { ShareMeIcon } from 'components/icon/icon';
+import { ResourcesState, getResource } from 'store/resources/resources';
+import { navigateTo } from "store/navigation/navigation-action";
+import { loadDetailsPanel } from "store/details-panel/details-panel-action";
+import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
+import { SHARED_WITH_ME_PANEL_ID } from 'store/shared-with-me-panel/shared-with-me-panel-actions';
+import {
+    openContextMenu,
+    resourceUuidToContextMenuKind
+} from 'store/context-menu/context-menu-actions';
+import { GroupContentsResource } from 'services/groups-service/groups-service';
 
 type CssRules = "toolbar" | "button";
 
@@ -31,13 +34,15 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 interface SharedWithMePanelDataProps {
     resources: ResourcesState;
+    userUuid: string;
 }
 
 type SharedWithMePanelProps = SharedWithMePanelDataProps & DispatchProp & WithStyles<CssRules>;
 
 export const SharedWithMePanel = withStyles(styles)(
     connect((state: RootState) => ({
-        resources: state.resources
+        resources: state.resources,
+        userUuid: state.auth.user!.uuid,
     }))(
         class extends React.Component<SharedWithMePanelProps> {
             render() {
@@ -51,14 +56,16 @@ export const SharedWithMePanel = withStyles(styles)(
             }
 
             handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
-                const menuKind = resourceKindToContextMenuKind(resourceUuid);
-                const resource = getResource<GroupResource>(resourceUuid)(this.props.resources);
+                const { resources } = this.props;
+                const resource = getResource<GroupContentsResource>(resourceUuid)(resources);
+                const menuKind = this.props.dispatch<any>(resourceUuidToContextMenuKind(resourceUuid));
                 if (menuKind && resource) {
                     this.props.dispatch<any>(openContextMenu(event, {
-                        name: '',
+                        name: resource.name,
                         uuid: resource.uuid,
+                        description: resource.description,
                         ownerUuid: resource.ownerUuid,
-                        isTrashed: resource.isTrashed,
+                        isTrashed: ('isTrashed' in resource) ? resource.isTrashed: false,
                         kind: resource.kind,
                         menuKind
                     }));
@@ -71,7 +78,7 @@ export const SharedWithMePanel = withStyles(styles)(
             }
 
             handleRowClick = (uuid: string) => {
-                this.props.dispatch(loadDetailsPanel(uuid));
+                this.props.dispatch<any>(loadDetailsPanel(uuid));
             }
         }
     )
