[ARVADOS-WORKBENCH2] created: 2.2.1-61-g4541e7e7
Git user
git at public.arvados.org
Tue Aug 10 01:27:47 UTC 2021
at 4541e7e78a5fbbad1e34cf215fa7f2fa4d40e88d (commit)
commit 4541e7e78a5fbbad1e34cf215fa7f2fa4d40e88d
Author: Stephen Smith <stephen at curii.com>
Date: Mon Aug 9 21:26:41 2021 -0400
17532: Add modifiedByUser to collection details version history table
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/views-components/data-explorer/renderers.tsx b/src/views-components/data-explorer/renderers.tsx
index 314390e2..4a56b142 100644
--- a/src/views-components/data-explorer/renderers.tsx
+++ b/src/views-components/data-explorer/renderers.tsx
@@ -425,24 +425,27 @@ export const ResourceOwnerName = connect(
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}
@@ -450,7 +453,22 @@ export const ResourceOwnerWithName =
}
return <Typography style={{ color: theme.palette.primary.main }} inline noWrap>
- {ownerName} ({uuid})
+ {userFullname} ({uuid})
+ </Typography>;
+ });
+
+export const UserNameFromID =
+ compose(
+ userFromID,
+ withStyles({}, { withTheme: true }))
+ ((props: { uuid: string, userFullname: string, dispatch: Dispatch }) => {
+ const { uuid, userFullname, dispatch } = props;
+
+ if (userFullname === '') {
+ dispatch<any>(loadResource(uuid, false));
+ }
+ return <Typography inline>
+ {userFullname ? userFullname : uuid}
</Typography>;
});
diff --git a/src/views-components/details-panel/collection-details.tsx b/src/views-components/details-panel/collection-details.tsx
index c61b3340..0d4fce51 100644
--- a/src/views-components/details-panel/collection-details.tsx
+++ b/src/views-components/details-panel/collection-details.tsx
@@ -12,6 +12,7 @@ import { filterResources, getResource } from 'store/resources/resources';
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';
@@ -108,12 +109,17 @@ const CollectionVersionBrowser = withStyles(styles)(
Nr
</Typography>
</Grid>
- <Grid item xs={4}>
+ <Grid item xs={2}>
<Typography variant="caption" className={classes.versionBrowserHeader}>
Size
</Typography>
</Grid>
- <Grid item xs={6}>
+ <Grid item xs={3}>
+ <Typography variant="caption" className={classes.versionBrowserHeader}>
+ User
+ </Typography>
+ </Grid>
+ <Grid item xs={5}>
<Typography variant="caption" className={classes.versionBrowserHeader}>
Date
</Typography>
@@ -132,12 +138,17 @@ const CollectionVersionBrowser = withStyles(styles)(
{item.version}
</Typography>
</Grid>
- <Grid item xs={4}>
+ <Grid item xs={2}>
<Typography variant="caption" className={classes.versionBrowserItem}>
{formatFileSize(item.fileSizeTotal)}
</Typography>
</Grid>
- <Grid item xs={6}>
+ <Grid item xs={3}>
+ <Typography variant="caption" className={classes.versionBrowserItem}>
+ <UserNameFromID uuid={item.modifiedByUserUuid} />
+ </Typography>
+ </Grid>
+ <Grid item xs={5}>
<Typography variant="caption" className={classes.versionBrowserItem}>
{formatDate(item.modifiedAt)}
</Typography>
@@ -147,4 +158,4 @@ const CollectionVersionBrowser = withStyles(styles)(
})}
</Grid>
</div>;
- }));
\ No newline at end of file
+ }));
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list