title-for-data-table
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Fri, 10 May 2019 10:22:20 +0000 (12:22 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Fri, 10 May 2019 10:22:20 +0000 (12:22 +0200)
Feature #15020

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

src/components/data-explorer/data-explorer.tsx
src/views/collection-content-address-panel/collection-content-address-panel.tsx

index 7c1f9045b4c0f61211c2678e121a8f8694fda8a4..5f01957753d0fc5252f5a31b3a63b83b221bd770 100644 (file)
@@ -14,7 +14,7 @@ import { DataTableFilters } from '~/components/data-table-filters/data-table-fil
 import { MoreOptionsIcon } from '~/components/icon/icon';
 import { PaperProps } from '@material-ui/core/Paper';
 
-type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton';
+type CssRules = 'searchBox' | "toolbar" | "footer" | "root" | 'moreOptionsButton' | 'title';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     searchBox: {
@@ -31,6 +31,11 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
     moreOptionsButton: {
         padding: 0
+    },
+    title: {
+        paddingLeft: theme.spacing.unit * 3,
+        paddingTop: theme.spacing.unit * 3,
+        fontSize: '18px'
     }
 });
 
@@ -52,6 +57,7 @@ interface DataExplorerDataProps<T> {
     hideSearchInput?: boolean;
     paperKey?: string;
     currentItemUuid: string;
+    title?: string;
 }
 
 interface DataExplorerActionProps<T> {
@@ -84,9 +90,10 @@ export const DataExplorer = withStyles(styles)(
                 rowsPerPage, rowsPerPageOptions, onColumnToggle, searchValue, onSearch,
                 items, itemsAvailable, onRowClick, onRowDoubleClick, classes,
                 dataTableDefaultView, hideColumnSelector, actions, paperProps, hideSearchInput,
-                paperKey, fetchMode, currentItemUuid
+                paperKey, fetchMode, currentItemUuid, title
             } = this.props;
             return <Paper className={classes.root} {...paperProps} key={paperKey}>
+                {title ? <div className={classes.title}>Content Address: {title}</div> : null}
                 {(!hideColumnSelector || !hideSearchInput) && <Toolbar className={classes.toolbar}>
                     <Grid container justify="space-between" wrap="nowrap" alignItems="center">
                         <div className={classes.searchBox}>
index f2c6df346083fb797a86ce6368ca08d2fe55d006..dfe1b5bf825375ed08321b130869bf2cc4328a86 100644 (file)
@@ -121,9 +121,15 @@ const mapDispatchToProps = (dispatch: Dispatch): CollectionContentAddressPanelAc
     }
 });
 
+interface CollectionContentAddressDataProps {
+    match: {
+        params: { id: string }
+    };
+}
+
 export const CollectionsContentAddressPanel = withStyles(styles)(
     connect(null, mapDispatchToProps)(
-        class extends React.Component<CollectionContentAddressPanelActionProps & WithStyles<CssRules>> {
+        class extends React.Component<CollectionContentAddressPanelActionProps & CollectionContentAddressDataProps & WithStyles<CssRules>> {
             render() {
                 return <Grid item xs={12}>
                     {/* <Link to={`/collections/${collectionUuid}`} className={this.props.classes.backLink}>
@@ -136,6 +142,7 @@ export const CollectionsContentAddressPanel = withStyles(styles)(
                         onRowDoubleClick={this.props.onItemDoubleClick}
                         onContextMenu={this.props.onContextMenu}
                         contextMenuColumn={true}
+                        title={this.props.match.params.id}
                         dataTableDefaultView={
                             <DataTableDefaultView
                                 icon={CollectionIcon}