X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/fbe71606b4a8bcdb9561c64ee71e0cbd0a38dc08..e9d30481d8d57a0b906364ee115e136305b7ce79:/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 5d782f5d..4aee73a6 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 @@ -9,12 +9,13 @@ 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 } from "~/store/resources/resources"; +import { ResourcesState, getResource } from '~/store/resources/resources'; import { navigateTo } from "~/store/navigation/navigation-action"; import { loadDetailsPanel } from "~/store/details-panel/details-panel-action"; -import { PanelDefaultView } from '~/components/panel-default-view/panel-default-view'; 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'; type CssRules = "toolbar" | "button"; @@ -40,37 +41,28 @@ export const SharedWithMePanel = withStyles(styles)( }))( class extends React.Component { render() { - return this.hasAnyTrashedResources() - ? } /> - : ; - } - - hasAnyTrashedResources = () => { - // TODO: implement check if there is anything in the trash, - // without taking pagination into the account - return true; + return } />; } handleContextMenu = (event: React.MouseEvent, resourceUuid: string) => { - // const resource = getResource(resourceUuid)(this.props.resources); - // if (resource) { - // this.props.dispatch(openContextMenu(event, { - // name: '', - // uuid: resource.uuid, - // ownerUuid: resource.ownerUuid, - // isTrashed: resource.isTrashed, - // kind: resource.kind, - // menuKind: ContextMenuKind.TRASH - // })); - // } + const menuKind = resourceKindToContextMenuKind(resourceUuid); + const resource = getResource(resourceUuid)(this.props.resources); + if (menuKind && resource) { + this.props.dispatch(openContextMenu(event, { + name: '', + uuid: resource.uuid, + ownerUuid: resource.ownerUuid, + isTrashed: resource.isTrashed, + kind: resource.kind, + menuKind + })); + } } handleRowDoubleClick = (uuid: string) => {