.within(() => {
// Version 1: 6 bytes in size
cy.get('[data-cy=collection-version-browser-select-1]')
- .should('contain', '1').and('contain', '6 B');
+ .should('contain', '1')
+ .and('contain', '6 B')
+ .and('contain', adminUser.user.uuid);
// Version 2: 3 bytes in size (one file removed)
cy.get('[data-cy=collection-version-browser-select-2]')
- .should('contain', '2').and('contain', '3 B');
+ .should('contain', '2')
+ .and('contain', '3 B')
+ .and('contain', activeUser.user.full_name);
cy.get('[data-cy=collection-version-browser-select-3]')
.should('not.exist');
cy.get('[data-cy=collection-version-browser-select-1]')
return { owner: ownerName ? ownerName!.name : resource!.ownerUuid };
})((props: { owner: string }) => renderOwner(props.owner));
-export const ResourceOwnerWithName =
- compose(
- connect(
- (state: RootState, props: { uuid: string }) => {
- let ownerName = '';
- const resource = getResource<GroupContentsResource & UserResource>(props.uuid)(state.resources);
+const userFromID =
+ connect(
+ (state: RootState, props: { uuid: string }) => {
+ let userFullname = '';
+ const resource = getResource<GroupContentsResource & UserResource>(props.uuid)(state.resources);
+
+ if (resource) {
+ userFullname = getUserFullname(resource as User) || (resource as GroupContentsResource).name;
+ }
- if (resource) {
- ownerName = getUserFullname(resource as User) || (resource as GroupContentsResource).name;
- }
+ return { uuid: props.uuid, userFullname };
+ });
- return { uuid: props.uuid, ownerName };
- }),
+export const ResourceOwnerWithName =
+ compose(
+ userFromID,
withStyles({}, { withTheme: true }))
- ((props: { uuid: string, ownerName: string, dispatch: Dispatch, theme: ArvadosTheme }) => {
- const { uuid, ownerName, dispatch, theme } = props;
+ ((props: { uuid: string, userFullname: string, dispatch: Dispatch, theme: ArvadosTheme }) => {
+ const { uuid, userFullname, dispatch, theme } = props;
- if (ownerName === '') {
+ if (userFullname === '') {
dispatch<any>(loadResource(uuid, false));
return <Typography style={{ color: theme.palette.primary.main }} inline noWrap>
{uuid}
}
return <Typography style={{ color: theme.palette.primary.main }} inline noWrap>
- {ownerName} ({uuid})
+ {userFullname} ({uuid})
</Typography>;
});
+export const UserNameFromID =
+ compose(userFromID)(
+ (props: { uuid: string, userFullname: string, dispatch: Dispatch }) => {
+ const { uuid, userFullname, dispatch } = props;
+
+ if (userFullname === '') {
+ dispatch<any>(loadResource(uuid, false));
+ }
+ return <span>
+ {userFullname ? userFullname : uuid}
+ </span>;
+ });
+
export const ResponsiblePerson =
compose(
connect(
import { connect } from 'react-redux';
import { Grid, ListItem, StyleRulesCallback, Typography, withStyles, WithStyles } from '@material-ui/core';
import { formatDate, formatFileSize } from 'common/formatters';
+import { UserNameFromID } from '../data-explorer/renderers';
import { Dispatch } from 'redux';
import { navigateTo } from 'store/navigation/navigation-action';
import { openContextMenu, resourceUuidToContextMenuKind } from 'store/context-menu/context-menu-actions';
-export type CssRules = 'versionBrowserHeader' | 'versionBrowserItem';
+export type CssRules = 'versionBrowserHeader' | 'versionBrowserItem' | 'versionBrowserField';
const styles: StyleRulesCallback<CssRules> = theme => ({
versionBrowserHeader: {
fontWeight: 'bold',
},
versionBrowserItem: {
+ flexWrap: 'wrap',
+ },
+ versionBrowserField: {
textAlign: 'center',
}
});
key={item.version}
onClick={e => showVersion(item)}
onContextMenu={event => handleContextMenu(event, item)}
- selected={isSelectedVersion}>
+ selected={isSelectedVersion}
+ className={classes.versionBrowserItem}>
<Grid item xs={2}>
- <Typography variant="caption" className={classes.versionBrowserItem}>
+ <Typography variant="caption" className={classes.versionBrowserField}>
{item.version}
</Typography>
</Grid>
<Grid item xs={4}>
- <Typography variant="caption" className={classes.versionBrowserItem}>
+ <Typography variant="caption" className={classes.versionBrowserField}>
{formatFileSize(item.fileSizeTotal)}
</Typography>
</Grid>
<Grid item xs={6}>
- <Typography variant="caption" className={classes.versionBrowserItem}>
+ <Typography variant="caption" className={classes.versionBrowserField}>
{formatDate(item.modifiedAt)}
</Typography>
</Grid>
+ <Grid item xs={12}>
+ <Typography variant="caption" className={classes.versionBrowserField}>
+ Modified by: <UserNameFromID uuid={item.modifiedByUserUuid} />
+ </Typography>
+ </Grid>
</ListItem>
);
})}
</Grid>
</div>;
- }));
\ No newline at end of file
+ }));