21507: removed word wrap on collection owner field Arvados-DCO-1.1-Signed-off-by...
authorLisa Knox <lisaknox83@gmail.com>
Thu, 14 Mar 2024 14:22:22 +0000 (10:22 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Thu, 14 Mar 2024 14:22:22 +0000 (10:22 -0400)
services/workbench2/src/views-components/data-explorer/renderers.tsx
services/workbench2/src/views/collection-panel/collection-panel.tsx

index 4ecbc7e10b23a832f327d7800d20a2552e1a1824..478dd1860123c962d915951c423ab96e9ac8d02d 100644 (file)
@@ -921,6 +921,33 @@ const _resourceWithName = withStyles(
     );
 });
 
+const _resourceWithNameWrap = withStyles(
+    {},
+    { withTheme: true }
+)((props: { uuid: string; userFullname: string; dispatch: Dispatch; theme: ArvadosTheme }) => {
+    const { uuid, userFullname, dispatch, theme } = props;
+    if (userFullname === "") {
+        dispatch<any>(loadResource(uuid, false));
+        return (
+            <Typography
+                style={{ color: theme.palette.primary.main }}
+                inline
+            >
+                {uuid}
+            </Typography>
+        );
+    }
+
+    return (
+        <Typography
+            style={{ color: theme.palette.primary.main }}
+            inline
+        >
+            {userFullname} ({uuid})
+        </Typography>
+    );
+});
+
 const _resourceWithNameLink = withStyles(
     {},
     { withTheme: true }
@@ -949,6 +976,8 @@ export const ResourceOwnerWithName = ownerFromResourceId(_resourceWithName);
 
 export const ResourceWithName = userFromID(_resourceWithName);
 
+export const ResourceWithNameWrap = userFromID(_resourceWithNameWrap);
+
 export const UserNameFromID = compose(userFromID)((props: { uuid: string; displayAsText?: string; userFullname: string; dispatch: Dispatch }) => {
     const { uuid, userFullname, dispatch } = props;
 
index 28983457e6e7c5a5d2821bad5cc782ecd37ee216..6a50442a34e656e676aea056333de5635e7421df 100644 (file)
@@ -34,7 +34,7 @@ import { UserResource } from 'models/user';
 import { getUserUuid } from 'common/getuser';
 import { Link } from 'react-router-dom';
 import { Link as ButtonLink } from '@material-ui/core';
-import { ResourceWithName, ResponsiblePerson } from 'views-components/data-explorer/renderers';
+import { ResourceWithNameWrap, ResponsiblePerson } from 'views-components/data-explorer/renderers';
 import { MPVContainer, MPVPanelContent, MPVPanelState } from 'components/multi-panel-view/multi-panel-view';
 import { resourceIsFrozen } from 'common/frozen-resources';
 import { NotFoundView } from 'views/not-found-panel/not-found-panel';
@@ -307,7 +307,7 @@ export const CollectionDetailsAttributes = (props: CollectionDetailsProps) => {
         <Grid item xs={12} md={mdSize}>
             <DetailsAttribute classLabel={classes.label} classValue={classes.value}
                 label='Owner' linkToUuid={item.ownerUuid}
-                uuidEnhancer={(uuid: string) => <ResourceWithName uuid={uuid} />} />
+                uuidEnhancer={(uuid: string) => <ResourceWithNameWrap uuid={uuid} />} />
         </Grid>
         <div data-cy="responsible-person-wrapper" ref={responsiblePersonRef}>
             <Grid item xs={12} md={12}>