X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f80a908d033729d3fb63e2611e3bd11d94fa2a65..0c04dddf8855474ea629a6b55be38f15fbc4ac4c:/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 582aa9c7..76a314ae 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 @@ -14,8 +14,11 @@ 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 { + 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 = (theme: ArvadosTheme) => ({ interface SharedWithMePanelDataProps { resources: ResourcesState; + userUuid: string; } type SharedWithMePanelProps = SharedWithMePanelDataProps & DispatchProp & WithStyles; export const SharedWithMePanel = withStyles(styles)( connect((state: RootState) => ({ - resources: state.resources + resources: state.resources, + userUuid: state.auth.user!.uuid, }))( class extends React.Component { render() { @@ -51,14 +56,15 @@ export const SharedWithMePanel = withStyles(styles)( } handleContextMenu = (event: React.MouseEvent, resourceUuid: string) => { - const menuKind = resourceKindToContextMenuKind(resourceUuid); - const resource = getResource(resourceUuid)(this.props.resources); + const { resources } = this.props; + const resource = getResource(resourceUuid)(resources); + const menuKind = this.props.dispatch(resourceUuidToContextMenuKind(resourceUuid)); if (menuKind && resource) { this.props.dispatch(openContextMenu(event, { name: '', uuid: resource.uuid, ownerUuid: resource.ownerUuid, - isTrashed: resource.isTrashed, + isTrashed: ('isTrashed' in resource) ? resource.isTrashed: false, kind: resource.kind, menuKind })); @@ -71,7 +77,7 @@ export const SharedWithMePanel = withStyles(styles)( } handleRowClick = (uuid: string) => { - this.props.dispatch(loadDetailsPanel(uuid)); + this.props.dispatch(loadDetailsPanel(uuid)); } } )