X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/8a8318d34c4ce519eca0c97c83e698f58713c6d7..9eaee66663fa21962f46e301ba6257ab63a9b10c:/src/views/trash-panel/trash-panel.tsx diff --git a/src/views/trash-panel/trash-panel.tsx b/src/views/trash-panel/trash-panel.tsx index a3664542..a0cf3e4f 100644 --- a/src/views/trash-panel/trash-panel.tsx +++ b/src/views/trash-panel/trash-panel.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { IconButton, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core'; +import { IconButton, StyleRulesCallback, WithStyles, withStyles, Tooltip } from '@material-ui/core'; import { DataExplorer } from "~/views-components/data-explorer/data-explorer"; import { connect, DispatchProp } from 'react-redux'; import { DataColumns } from '~/components/data-table/data-table'; @@ -63,18 +63,20 @@ export const ResourceRestore = const resource = getResource(props.uuid)(state.resources); return { resource, dispatch: props.dispatch }; })((props: { resource?: TrashableResource, dispatch?: Dispatch }) => - { - if (props.resource && props.dispatch) { - props.dispatch(toggleTrashed( - props.resource.kind, - props.resource.uuid, - props.resource.ownerUuid, - props.resource.isTrashed - )); - } - }}> - - + + { + if (props.resource && props.dispatch) { + props.dispatch(toggleTrashed( + props.resource.kind, + props.resource.uuid, + props.resource.ownerUuid, + props.resource.isTrashed + )); + }}} + > + + + ); export const trashPanelColumns: DataColumns = [ @@ -84,8 +86,7 @@ export const trashPanelColumns: DataColumns = [ configurable: true, sortDirection: SortDirection.ASC, filters: [], - render: uuid => , - width: "450px" + render: uuid => }, { name: TrashPanelColumnNames.TYPE, @@ -98,11 +99,6 @@ export const trashPanelColumns: DataColumns = [ selected: true, type: ResourceKind.COLLECTION }, - { - name: resourceLabel(ResourceKind.PROCESS), - selected: true, - type: ResourceKind.PROCESS - }, { name: resourceLabel(ResourceKind.PROJECT), selected: true, @@ -110,7 +106,6 @@ export const trashPanelColumns: DataColumns = [ } ], render: uuid => , - width: "125px" }, { name: TrashPanelColumnNames.FILE_SIZE, @@ -118,8 +113,7 @@ export const trashPanelColumns: DataColumns = [ configurable: true, sortDirection: SortDirection.NONE, filters: [], - render: uuid => , - width: "50px" + render: uuid => }, { name: TrashPanelColumnNames.TRASHED_DATE, @@ -127,8 +121,7 @@ export const trashPanelColumns: DataColumns = [ configurable: true, sortDirection: SortDirection.NONE, filters: [], - render: uuid => , - width: "50px" + render: uuid => }, { name: TrashPanelColumnNames.TO_BE_DELETED, @@ -136,8 +129,7 @@ export const trashPanelColumns: DataColumns = [ configurable: true, sortDirection: SortDirection.NONE, filters: [], - render: uuid => , - width: "50px" + render: uuid => }, { name: '', @@ -145,8 +137,7 @@ export const trashPanelColumns: DataColumns = [ configurable: false, sortDirection: SortDirection.NONE, filters: [], - render: uuid => , - width: "50px" + render: uuid => } ]; @@ -164,23 +155,17 @@ export const TrashPanel = 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) => { @@ -195,6 +180,7 @@ export const TrashPanel = withStyles(styles)( menuKind: ContextMenuKind.TRASH })); } + this.props.dispatch(loadDetailsPanel(resourceUuid)); } handleRowDoubleClick = (uuid: string) => {