13493: Merge branch 'master' into 13494-collection-version-browser
[arvados-workbench2.git] / src / views / collection-content-address-panel / collection-content-address-panel.tsx
index dfe1b5bf825375ed08321b130869bf2cc4328a86..038fea2fd44eb4bb3de3d060a3cf163fedd9b6bb 100644 (file)
@@ -3,10 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { Link } from 'react-router-dom';
-import {
-    StyleRulesCallback, WithStyles, withStyles, Grid
-} from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, withStyles, Grid, Button } from '@material-ui/core';
 import { CollectionIcon } from '~/components/icon/icon';
 import { ArvadosTheme } from '~/common/custom-theme';
 import { BackIcon } from '~/components/icon/icon';
@@ -23,18 +20,18 @@ import { navigateTo } from '~/store/navigation/navigation-action';
 import { DataColumns } from '~/components/data-table/data-table';
 import { SortDirection } from '~/components/data-table/data-column';
 import { createTree } from '~/models/tree';
-import { ResourceName, ResourceOwner, ResourceLastModifiedDate } from '~/views-components/data-explorer/renderers';
+import { ResourceName, ResourceOwnerName, ResourceLastModifiedDate, ResourceStatus } from '~/views-components/data-explorer/renderers';
 
 type CssRules = 'backLink' | 'backIcon' | 'card' | 'title' | 'iconHeader' | 'link';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     backLink: {
-        fontSize: '1rem',
+        fontSize: '14px',
         fontWeight: 600,
         display: 'flex',
         alignItems: 'center',
-        textDecoration: 'none',
         padding: theme.spacing.unit,
+        marginBottom: theme.spacing.unit,
         color: theme.palette.grey["700"],
     },
     backIcon: {
@@ -62,6 +59,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 enum CollectionContentAddressPanelColumnNames {
     COLLECTION_WITH_THIS_ADDRESS = "Collection with this address",
+    STATUS = "Status",
     LOCATION = "Location",
     LAST_MODIFIED = "Last modified"
 }
@@ -75,12 +73,19 @@ export const collectionContentAddressPanelColumns: DataColumns<string> = [
         filters: createTree(),
         render: uuid => <ResourceName uuid={uuid} />
     },
+    {
+        name: CollectionContentAddressPanelColumnNames.STATUS,
+        selected: true,
+        configurable: true,
+        filters: createTree(),
+        render: uuid => <ResourceStatus uuid={uuid} />
+    },
     {
         name: CollectionContentAddressPanelColumnNames.LOCATION,
         selected: true,
         configurable: true,
         filters: createTree(),
-        render: uuid => <ResourceOwner uuid={uuid} />
+        render: uuid => <ResourceOwnerName uuid={uuid} />
     },
     {
         name: CollectionContentAddressPanelColumnNames.LAST_MODIFIED,
@@ -132,17 +137,20 @@ export const CollectionsContentAddressPanel = withStyles(styles)(
         class extends React.Component<CollectionContentAddressPanelActionProps & CollectionContentAddressDataProps & WithStyles<CssRules>> {
             render() {
                 return <Grid item xs={12}>
-                    {/* <Link to={`/collections/${collectionUuid}`} className={this.props.classes.backLink}>
+                    <Button
+                        onClick={() => history.back()}
+                        className={this.props.classes.backLink}>
                         <BackIcon className={this.props.classes.backIcon} />
                         Back
-                    </Link> */}
+                    </Button>
                     <DataExplorer
                         id={COLLECTIONS_CONTENT_ADDRESS_PANEL_ID}
+                        hideSearchInput
                         onRowClick={this.props.onItemClick}
                         onRowDoubleClick={this.props.onItemDoubleClick}
                         onContextMenu={this.props.onContextMenu}
                         contextMenuColumn={true}
-                        title={this.props.match.params.id}
+                        title={`Content address: ${this.props.match.params.id}`}
                         dataTableDefaultView={
                             <DataTableDefaultView
                                 icon={CollectionIcon}
@@ -152,4 +160,4 @@ export const CollectionsContentAddressPanel = withStyles(styles)(
             }
         }
     )
-);
\ No newline at end of file
+);