X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/37a1d67e8325906b9cfbb6bf3df608e72bd33b67..5d2cc407a7649ca7807b78369f2f08351202cc77:/src/views-components/data-explorer/renderers.tsx diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx index 52760cb4..bf504f2b 100644 --- a/src/views-components/data-explorer/renderers.tsx +++ b/src/views-components/data-explorer/renderers.tsx @@ -26,15 +26,14 @@ import { toggleIsActive, toggleIsAdmin } from '~/store/users/users-actions'; import { LinkResource } from '~/models/link'; import { navigateTo } from '~/store/navigation/navigation-action'; import { withResourceData } from '~/views-components/data-explorer/with-resources'; -import { extractUuidKind } from '~/models/resource'; -const renderName = (item: { name: string; uuid: string, kind: string }) => +const renderName = (dispatch: Dispatch, item: { name: string; uuid: string, kind: string }) => {renderIcon(item.kind)} - + dispatch(navigateTo(item.uuid))}> {item.name} @@ -50,7 +49,7 @@ export const ResourceName = connect( (state: RootState, props: { uuid: string }) => { const resource = getResource(props.uuid)(state.resources); return resource || { name: '', uuid: '', kind: '' }; - })(renderName); + })((resource: { name: string; uuid: string, kind: string } & DispatchProp) => renderName(resource.dispatch, resource)); const renderIcon = (kind: string) => { switch (kind) { @@ -402,7 +401,7 @@ export const ResourceFileSize = connect( })((props: { fileSize?: number }) => renderFileSize(props.fileSize)); const renderOwner = (owner: string) => - + {owner} ; @@ -412,6 +411,14 @@ export const ResourceOwner = connect( return { owner: resource ? resource.ownerUuid : '' }; })((props: { owner: string }) => renderOwner(props.owner)); +export const ResourceOwnerName = connect( + (state: RootState, props: { uuid: string }) => { + const resource = getResource(props.uuid)(state.resources); + const ownerNameState = state.ownerName; + const ownerName = ownerNameState.find(it => it.uuid === resource!.ownerUuid); + return { owner: ownerName ? ownerName!.name : resource!.ownerUuid }; + })((props: { owner: string }) => renderOwner(props.owner)); + const renderType = (type: string) => {resourceLabel(type)}