X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/df5bb74b46652b2e0a73a0e9ef2c09a63314e409..eb7235a7a2cf4c6b6f52b42ac8313de388235aa9:/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 4cdd8c55..b7bd3a62 100644 --- a/src/views/collection-panel/collection-panel.tsx +++ b/src/views/collection-panel/collection-panel.tsx @@ -32,8 +32,10 @@ import { getUserUuid } from '~/common/getuser'; import { getProgressIndicator } from '~/store/progress-indicator/progress-indicator-reducer'; import { COLLECTION_PANEL_LOAD_FILES, loadCollectionFiles, COLLECTION_PANEL_LOAD_FILES_THRESHOLD } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions'; import { Link } from 'react-router-dom'; +import { Link as ButtonLink } from '@material-ui/core'; type CssRules = 'root' + | 'button' | 'filesCard' | 'iconHeader' | 'tag' @@ -51,6 +53,9 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ flexFlow: 'column', height: 'calc(100vh - 130px)', // (100% viewport height) - (top bar + breadcrumbs) }, + button: { + cursor: 'pointer' + }, filesCard: { marginBottom: theme.spacing.unit * 2, flex: 1, @@ -167,7 +172,7 @@ export const CollectionPanel = withStyles(styles)( {item.description} - + dispatch(openDetailsPanel(item.uuid, 1))} /> {(item.properties.container_request || item.properties.containerRequest) && dispatch(navigateToProcess(item.properties.container_request || item.properties.containerRequest))}> @@ -200,7 +205,7 @@ export const CollectionPanel = withStyles(styles)( getPropertyChip( k, v, isWritable - ? this.handleDelete(k, item.properties[k]) + ? this.handleDelete(k, v) : undefined, classes.tag)) : getPropertyChip( @@ -262,10 +267,11 @@ export const CollectionPanel = withStyles(styles)( this.props.dispatch(deleteCollectionTag(key, value)); } - openCollectionDetails = () => { + openCollectionDetails = (e: React.MouseEvent) => { const { item } = this.props; if (item) { - this.props.dispatch(openDetailsPanel(item.uuid)); + e.stopPropagation(); + this.props.dispatch(openDetailsPanel(item.uuid)); } } @@ -277,11 +283,12 @@ export const CollectionPanel = withStyles(styles)( ) ); -export const CollectionDetailsAttributes = (props: { item: CollectionResource, twoCol: boolean, classes?: Record }) => { +export const CollectionDetailsAttributes = (props: { item: CollectionResource, twoCol: boolean, classes?: Record, showVersionBrowser?: () => void }) => { const item = props.item; - const classes = props.classes || { label: '', value: '' }; + const classes = props.classes || { label: '', value: '', button: '' }; const isOldVersion = item && item.currentVersionUuid !== item.uuid; const mdSize = props.twoCol ? 6 : 12; + const showVersionBrowser = props.showVersionBrowser; return - - {isOldVersion && - - - - } + label='Head version' + value={isOldVersion ? undefined : 'this one'} + linkToUuid={isOldVersion ? item.currentVersionUuid : undefined} /> + + + showVersionBrowser()}> + {{item.version}} + + : item.version + } + />