From 6c9138600a27ea2980ac455e9b62ac7b7c1e64b8 Mon Sep 17 00:00:00 2001 From: Lisa Knox <lisaknox83@gmail.com> Date: Wed, 8 Nov 2023 14:39:22 -0500 Subject: [PATCH] 19302: linkified Owner name on sharedwithme panel Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com> --- .../data-explorer/renderers.tsx | 24 +++++++++++++++++++ .../shared-with-me-panel.tsx | 6 ++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx index 257eacfb29..2cbf038abb 100644 --- a/src/views-components/data-explorer/renderers.tsx +++ b/src/views-components/data-explorer/renderers.tsx @@ -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); diff --git a/src/views/shared-with-me-panel/shared-with-me-panel.tsx b/src/views/shared-with-me-panel/shared-with-me-panel.tsx index 929ec6b582..250447ea95 100644 --- a/src/views/shared-with-me-panel/shared-with-me-panel.tsx +++ b/src/views/shared-with-me-panel/shared-with-me-panel.tsx @@ -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, -- 2.30.2