X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1bdd1dfe632195c85e4dbda768dd342811a468b0..900081d75c21b924f4da42a94c1ca4ef7084a3df:/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 c6554f9ca1..f476c9397c 100644 --- a/src/views/collection-panel/collection-panel.tsx +++ b/src/views/collection-panel/collection-panel.tsx @@ -3,26 +3,28 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { - StyleRulesCallback, WithStyles, withStyles, Card, - CardHeader, IconButton, CardContent, Grid, Chip, TextField, Button +import { + StyleRulesCallback, WithStyles, withStyles, Card, + CardHeader, IconButton, CardContent, Grid, Chip } 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, CopyIcon } from '../../components/icon/icon'; -import { DetailsAttribute } from '../../components/details-attribute/details-attribute'; -import { CollectionResource } from '../../models/collection'; +import { ArvadosTheme } from '~/common/custom-theme'; +import { RootState } from '~/store/store'; +import { MoreOptionsIcon, CollectionIcon, CopyIcon } from '~/components/icon/icon'; +import { DetailsAttribute } from '~/components/details-attribute/details-attribute'; +import { CollectionResource } from '~/models/collection'; +import { CollectionPanelFiles } from '~/views-components/collection-panel-files/collection-panel-files'; import * as CopyToClipboard from 'react-copy-to-clipboard'; -import { TagResource } from '../../models/tag'; +import { TagResource } from '~/models/tag'; import { CollectionTagForm } from './collection-tag-form'; +import { deleteCollectionTag } from '~/store/collection-panel/collection-panel-action'; -type CssRules = 'card' | 'iconHeader' | 'tag' | 'copyIcon'; +type CssRules = 'card' | 'iconHeader' | 'tag' | 'copyIcon' | 'label' | 'value'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ card: { - marginBottom: '20px' + marginBottom: theme.spacing.unit * 2 }, iconHeader: { fontSize: '1.875rem', @@ -37,6 +39,13 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ fontSize: '1.125rem', color: theme.palette.grey["500"], cursor: 'pointer' + }, + label: { + fontSize: '0.875rem' + }, + value: { + textTransform: 'none', + fontSize: '0.875rem' } }); @@ -55,44 +64,50 @@ type CollectionPanelProps = CollectionPanelDataProps & CollectionPanelActionProp export const CollectionPanel = withStyles(styles)( - connect((state: RootState) => ({ - item: state.collectionPanel.item, - tags: state.collectionPanel.tags + connect((state: RootState) => ({ + item: state.collectionPanel.item, + tags: state.collectionPanel.tags }))( - class extends React.Component { + class extends React.Component { render() { const { classes, item, tags, onContextMenu } = this.props; return
- } - action={ + action={ onContextMenu(event, item)}> - + } - title={item && item.name } + title={item && item.name } subheader={item && item.description} /> - - - - - - - + + + + + + + + - + @@ -100,7 +115,7 @@ export const CollectionPanel = withStyles(styles)( { tags.map(tag => { return ; }) } @@ -108,20 +123,16 @@ export const CollectionPanel = withStyles(styles)( - - - - - - - Files - - - - +
+ +
; } + handleDelete = (uuid: string) => () => { + this.props.dispatch(deleteCollectionTag(uuid)); + } + componentWillReceiveProps({ match, item, onItemRouteChange }: CollectionPanelProps) { if (!item || match.params.id !== item.uuid) { onItemRouteChange(match.params.id); @@ -136,7 +147,3 @@ const renderTagLabel = (tag: TagResource) => { const { properties } = tag; return `${properties.key}: ${properties.value}`; }; - -const handleDelete = () => { - alert('tag has been deleted'); -}; \ No newline at end of file