Merge branch 'master'
[arvados-workbench2.git] / src / views-components / advanced-tab-dialog / metadataTab.tsx
index f8386fd24f590d1efe1696e988f4ec154d951c25..6250a7ad643c5cd48aba090a26a36312586f5572 100644 (file)
@@ -4,7 +4,7 @@
 
 import * as React from "react";
 import { Table, TableHead, TableCell, TableRow, TableBody, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
-import { navigateTo } from "~/store/navigation/navigation-action";
+import { UserResource } from "~/models/user";
 
 type CssRules = 'cell';
 
@@ -25,6 +25,8 @@ interface MetadataTable {
 
 interface MetadataProps {
     items: MetadataTable[];
+    user: UserResource;
+    uuid: string;
 }
 
 export const MetadataTab = withStyles(styles)((props: MetadataProps & WithStyles<CssRules>) =>
@@ -40,18 +42,16 @@ export const MetadataTab = withStyles(styles)((props: MetadataProps & WithStyles
             </TableRow>
         </TableHead>
         <TableBody>
-            {props.items.map((it: MetadataTable, index: number) => {
-                return (
-                    <TableRow key={index}>
-                        <TableCell className={props.classes.cell}>{it.uuid}</TableCell>
-                        <TableCell className={props.classes.cell}>{it.linkClass}</TableCell>
-                        <TableCell className={props.classes.cell}>{it.name}</TableCell>
-                        <TableCell className={props.classes.cell}>{it.tailUuid}</TableCell>
-                        <TableCell className={props.classes.cell}>{it.headUuid}</TableCell>
-                        <TableCell className={props.classes.cell}>{JSON.stringify(it.properties, null, 2)}</TableCell>
-                    </TableRow>
-                );
-            })}
+            {props.items.map((it, index) =>
+                <TableRow key={index}>
+                    <TableCell className={props.classes.cell}>{it.uuid}</TableCell>
+                    <TableCell className={props.classes.cell}>{it.linkClass}</TableCell>
+                    <TableCell className={props.classes.cell}>{it.name}</TableCell>
+                    <TableCell className={props.classes.cell}>{props.user ? `User: ${props.user.firstName} ${props.user.lastName}` : it.tailUuid}</TableCell>
+                    <TableCell className={props.classes.cell}>{it.headUuid === props.uuid ? 'this' : it.headUuid}</TableCell>
+                    <TableCell className={props.classes.cell}>{JSON.stringify(it.properties)}</TableCell>
+                </TableRow>
+            )}
         </TableBody>
     </Table>
 );
\ No newline at end of file