X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/fd24fbe43ef6f898f31804aff16ea6911a014ff8..75b017ae9d566d523e448aaeb863c4d89b3548fe:/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 df1b1f1d..eed9c7de 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 { DefaultView } from "components/default-view/default-view"; 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, @@ -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,18 @@ export const CollectionPanel = withStyles(styles)(connect( - - : null; + + : + + + ; } handleContextMenu = (event: React.MouseEvent) => { @@ -328,7 +362,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. - */} + */}