Merge branch '15685-file-renaming-empty-name'
[arvados.git] / src / views-components / advanced-tab-dialog / metadataTab.tsx
index b7a7680ffdabf2f6dd29fa51737c4732d482bebe..467501a77f874c8fa66c1fde15a7f00a190c33ae 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 { UserResource } from "~/models/user";
+import { UserResource, getUserDisplayName } from "~/models/user";
 
 type CssRules = 'cell';
 
@@ -25,7 +25,7 @@ interface MetadataTable {
 
 interface MetadataProps {
     items: MetadataTable[];
-    tail: any;
+    user: UserResource;
     uuid: string;
 }
 
@@ -47,7 +47,7 @@ export const MetadataTab = withStyles(styles)((props: MetadataProps & WithStyles
                     <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.tail.firstName ? `User: ${props.tail.firstName} ${props.tail.lastName}` : `Group: ${props.tail}`}</TableCell>
+                    <TableCell className={props.classes.cell}>{props.user && `User: ${getUserDisplayName(props.user)}`}</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>