X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7776b799eed223b9318443c1e319e01957a8fb45..refs/heads/16848-token-handling-improvements:/src/components/details-attribute/details-attribute.tsx diff --git a/src/components/details-attribute/details-attribute.tsx b/src/components/details-attribute/details-attribute.tsx index 4b8ee837..2cecc8ce 100644 --- a/src/components/details-attribute/details-attribute.tsx +++ b/src/components/details-attribute/details-attribute.tsx @@ -61,6 +61,8 @@ interface DetailsAttributeDataProps { children?: React.ReactNode; onValueClick?: () => void; linkToUuid?: string; + copyValue?: string; + uuidEnhancer?: Function; } type DetailsAttributeProps = DetailsAttributeDataProps & WithStyles & FederationConfig & DispatchProp; @@ -83,23 +85,25 @@ export const DetailsAttribute = connect(mapStateToProps)(withStyles(styles)( } render() { - const { label, link, value, children, classes, classLabel, + const { uuidEnhancer, label, link, value, children, classes, classLabel, classValue, lowercaseValue, onValueClick, linkToUuid, - localCluster, remoteHostsConfig, sessions } = this.props; + localCluster, remoteHostsConfig, sessions, copyValue } = this.props; let valueNode: React.ReactNode; if (linkToUuid) { + const uuid = uuidEnhancer ? uuidEnhancer(linkToUuid) : linkToUuid; const linkUrl = getNavUrl(linkToUuid || "", { localCluster, remoteHostsConfig, sessions }); if (linkUrl[0] === '/') { - valueNode = {linkToUuid}; + valueNode = {uuid}; } else { - valueNode = {linkToUuid}; + valueNode = {uuid}; } } else if (link) { valueNode = {value}; } else { valueNode = value; } + return {label} {valueNode} {children} - {linkToUuid && + {(linkToUuid || copyValue) && - this.onCopy("Copied")}> + this.onCopy("Copied")}>