X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b04ed9ad5145bf8335cc5749b3d2f0ac166ef60f..5b30fab0552f623a35ff5b89b90dab82dfcee258:/src/views/collection-panel/collection-panel.tsx diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx index a28d5254..d93d6e92 100644 --- a/src/views/collection-panel/collection-panel.tsx +++ b/src/views/collection-panel/collection-panel.tsx @@ -11,13 +11,13 @@ import { Grid, Tooltip, Typography, - Card + Card, CardHeader, CardContent } from '@material-ui/core'; import { connect, DispatchProp } from "react-redux"; import { RouteComponentProps } from 'react-router'; import { ArvadosTheme } from 'common/custom-theme'; import { RootState } from 'store/store'; -import { MoreOptionsIcon, CollectionIcon, ReadOnlyIcon, CollectionOldVersionIcon } from 'components/icon/icon'; +import { MoreVerticalIcon, CollectionIcon, ReadOnlyIcon, CollectionOldVersionIcon } from 'components/icon/icon'; import { DetailsAttribute } from 'components/details-attribute/details-attribute'; import { CollectionResource, getCollectionUrl } from 'models/collection'; import { CollectionPanelFiles } from 'views-components/collection-panel-files/collection-panel-files'; @@ -37,6 +37,7 @@ import { Link as ButtonLink } from '@material-ui/core'; import { ResourceWithName, 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'; type CssRules = 'root' | 'button' @@ -51,7 +52,11 @@ type CssRules = 'root' | 'centeredLabel' | 'warningLabel' | 'collectionName' - | 'readOnlyIcon'; + | 'readOnlyIcon' + | 'header' + | 'title' + | 'avatar' + | 'content'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -61,9 +66,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ cursor: 'pointer' }, infoCard: { - paddingLeft: theme.spacing.unit * 2, - paddingRight: theme.spacing.unit * 2, - paddingBottom: theme.spacing.unit * 2, }, propertiesCard: { padding: 0, @@ -73,14 +75,14 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ }, iconHeader: { fontSize: '1.875rem', - color: theme.customs.colors.yellow700 + color: theme.customs.colors.greyL }, tag: { marginRight: theme.spacing.unit / 2, marginBottom: theme.spacing.unit / 2 }, label: { - fontSize: '0.875rem' + fontSize: '0.875rem', }, centeredLabel: { fontSize: '0.875rem', @@ -106,6 +108,26 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ readOnlyIcon: { marginLeft: theme.spacing.unit, fontSize: 'small', + }, + header: { + paddingTop: theme.spacing.unit, + paddingBottom: theme.spacing.unit, + }, + title: { + overflow: 'hidden', + paddingTop: theme.spacing.unit * 0.5, + color: theme.customs.colors.green700, + }, + avatar: { + alignSelf: 'flex-start', + paddingTop: theme.spacing.unit * 0.5 + }, + content: { + padding: theme.spacing.unit * 1.0, + paddingTop: theme.spacing.unit * 0.5, + '&:last-child': { + paddingBottom: theme.spacing.unit * 1, + } } }); @@ -129,8 +151,8 @@ export const CollectionPanel = withStyles(styles)(connect( isWritable = true; } else { const itemOwner = getResource(item.ownerUuid)(state.resources); - if (itemOwner && itemOwner.writableBy) { - isWritable = itemOwner.writableBy.indexOf(currentUserUUID || '') >= 0; + if (itemOwner) { + isWritable = itemOwner.canWrite; } } } @@ -152,52 +174,54 @@ export const CollectionPanel = withStyles(styles)(connect( ? - - - - {isOldVersion - ? - : } - - + + {isOldVersion + ? + : } + } + title={ + {item.name} {isWritable || - - } + } - - + } + action={ - + - - - - - - {item.description} + } + /> + + + {item.description} + + dispatch(openDetailsPanel(item.uuid, 1))} /> + {(item.properties.container_request || item.properties.containerRequest) && + dispatch(navigateToProcess(item.properties.container_request || item.properties.containerRequest))}> + + + } + {isOldVersion && + + This is an old version. Make a copy to make changes. Go to the head version for sharing options. - dispatch(openDetailsPanel(item.uuid, 1))} /> - {(item.properties.container_request || item.properties.containerRequest) && - dispatch(navigateToProcess(item.properties.container_request || item.properties.containerRequest))}> - - - } - {isOldVersion && - - This is an old version. Make a copy to make changes. Go to the head version for sharing options. - - } - - + } + @@ -205,8 +229,12 @@ export const CollectionPanel = withStyles(styles)(connect( - - : null; + + : + ; } handleContextMenu = (event: React.MouseEvent) => { @@ -328,7 +356,7 @@ export const CollectionDetailsAttributes = (props: CollectionDetailsProps) => { {/* NOTE: The property list should be kept at the bottom, because it spans the entire available width, without regards of the twoCol prop. - */} + */}