19302: linkified Owner name on sharedwithme panel Arvados-DCO-1.1-Signed-off-by:...
authorLisa Knox <lisaknox83@gmail.com>
Wed, 8 Nov 2023 19:39:22 +0000 (14:39 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Wed, 8 Nov 2023 19:39:22 +0000 (14:39 -0500)
src/views-components/data-explorer/renderers.tsx
src/views/shared-with-me-panel/shared-with-me-panel.tsx

index 257eacfb294bde6b6b06c2e2aeeb0abca5a5b77d..2cbf038abb006bdc69e84b89b1ff21dae147a4c5 100644 (file)
@@ -914,6 +914,30 @@ const _resourceWithName = withStyles(
     );
 });
 
+const _resourceWithNameLink = 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, cursor: 'pointer' }}
+            inline
+            noWrap
+            onClick={() => dispatch<any>(navigateTo(uuid))}
+        >
+            {userFullname ? userFullname : uuid}
+        </Typography>
+    )
+});
+
+
+export const ResourceOwnerWithNameLink = ownerFromResourceId(_resourceWithNameLink);
+
 export const ResourceOwnerWithName = ownerFromResourceId(_resourceWithName);
 
 export const ResourceWithName = userFromID(_resourceWithName);
index 929ec6b5825b99fb8b847a437f48c41e03f6cf5e..250447ea95d10cc927f78ee85aae0df5c5bfe740 100644 (file)
@@ -10,7 +10,7 @@ import { RootState } from 'store/store';
 import { ArvadosTheme } from 'common/custom-theme';
 import { ShareMeIcon } from 'components/icon/icon';
 import { ResourcesState, getResource } from 'store/resources/resources';
-import { ResourceKind, Resource } from 'models/resource';
+import { ResourceKind } from 'models/resource';
 import { navigateTo } from "store/navigation/navigation-action";
 import { loadDetailsPanel } from "store/details-panel/details-panel-action";
 import { SHARED_WITH_ME_PANEL_ID } from 'store/shared-with-me-panel/shared-with-me-panel-actions';
@@ -22,7 +22,7 @@ import {
     ResourceName,
     ProcessStatus as ResourceStatus,
     ResourceType,
-    ResourceOwnerWithName,
+    ResourceOwnerWithNameLink,
     ResourcePortableDataHash,
     ResourceFileSize,
     ResourceFileCount,
@@ -118,7 +118,7 @@ export const sharedWithMePanelColumns: DataColumns<string, ProjectResource> = [
         selected: true,
         configurable: true,
         filters: createTree(),
-        render: (uuid) => <ResourceOwnerWithName uuid={uuid} />,
+        render: (uuid) => <ResourceOwnerWithNameLink uuid={uuid} />,
     },
     {
         name: SharedWithMePanelColumnNames.PORTABLE_DATA_HASH,