Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14479_ssh_keys
[arvados-workbench2.git] / src / views / trash-panel / trash-panel.tsx
index e627f4f26bcddbd32117934f93c08fd9fa80128f..a0cf3e4fd40f2add68c0603c9d1e2760d3010c24 100644 (file)
@@ -64,7 +64,7 @@ export const ResourceRestore =
         return { resource, dispatch: props.dispatch };
     })((props: { resource?: TrashableResource, dispatch?: Dispatch<any> }) =>
         <Tooltip title="Restore">
-            <IconButton onClick={() => {
+            <IconButton style={{ padding: '0' }} onClick={() => {
                 if (props.resource && props.dispatch) {
                     props.dispatch(toggleTrashed(
                         props.resource.kind,
@@ -72,8 +72,8 @@ export const ResourceRestore =
                         props.resource.ownerUuid,
                         props.resource.isTrashed
                     ));
-                }
-            }}>
+                }}}
+            >
                 <RestoreFromTrashIcon />
             </IconButton>
         </Tooltip>
@@ -155,23 +155,17 @@ export const TrashPanel = withStyles(styles)(
     }))(
         class extends React.Component<TrashPanelProps> {
             render() {
-                return this.hasAnyTrashedResources()
-                    ? <DataExplorer
-                        id={TRASH_PANEL_ID}
-                        onRowClick={this.handleRowClick}
-                        onRowDoubleClick={this.handleRowDoubleClick}
-                        onContextMenu={this.handleContextMenu}
-                        contextMenuColumn={false}
-                        dataTableDefaultView={<DataTableDefaultView icon={TrashIcon} />} />
-                    : <PanelDefaultView
-                        icon={TrashIcon}
-                        messages={['Your trash list is empty.']} />;
-            }
-
-            hasAnyTrashedResources = () => {
-                // TODO: implement check if there is anything in the trash,
-                //       without taking pagination into the account
-                return true;
+                return <DataExplorer
+                    id={TRASH_PANEL_ID}
+                    onRowClick={this.handleRowClick}
+                    onRowDoubleClick={this.handleRowDoubleClick}
+                    onContextMenu={this.handleContextMenu}
+                    contextMenuColumn={false}
+                    dataTableDefaultView={
+                        <DataTableDefaultView
+                            icon={TrashIcon}
+                            messages={['Your trash list is empty.']}/>
+                    } />;
             }
 
             handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
@@ -186,6 +180,7 @@ export const TrashPanel = withStyles(styles)(
                         menuKind: ContextMenuKind.TRASH
                     }));
                 }
+                this.props.dispatch<any>(loadDetailsPanel(resourceUuid));
             }
 
             handleRowDoubleClick = (uuid: string) => {