);
});
+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 }
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;
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';
<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}>