X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/88ce683068f65862b3b5e753e55989902be5f1a9..8775768ca3a344775c81b7278a50d56d9be3f9b6:/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 748151c6c3..96c2fc96f0 100644 --- a/src/views/collection-panel/collection-panel.tsx +++ b/src/views/collection-panel/collection-panel.tsx @@ -16,7 +16,6 @@ import { DetailsAttribute } from '~/components/details-attribute/details-attribu 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 { CollectionTagForm } from './collection-tag-form'; import { deleteCollectionTag } from '~/store/collection-panel/collection-panel-action'; import { snackbarActions } from '~/store/snackbar/snackbar-actions'; @@ -55,7 +54,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ interface CollectionPanelDataProps { item: CollectionResource; - tags: TagResource[]; } type CollectionPanelProps = CollectionPanelDataProps & DispatchProp @@ -66,87 +64,94 @@ export const CollectionPanel = withStyles(styles)( connect((state: RootState, props: RouteComponentProps<{ id: string }>) => { const collection = getResource(props.match.params.id)(state.resources); return { - item: collection, - tags: state.collectionPanel.tags + item: collection }; })( class extends React.Component { render() { - const { classes, item, tags } = this.props; - return
- - } - action={ - - - - } - title={item && item.name} - subheader={item && item.description} /> - - - - - - this.onCopy()}> - - - - - - - + const { classes, item } = this.props; + return item + ? <> + + } + action={ + + + + + + } + title={item && item.name} + subheader={item && item.description} /> + + + + + + this.onCopy()}> + + + + + + + + - - - + + - - - - - - - { - tags.map(tag => { - return ; - }) - } + + + + + + + + + { + Object.keys(item.properties).map(k => { + return ; + }) + } + - - - -
- -
-
; + + +
+ +
+ + : null; } handleContextMenu = (event: React.MouseEvent) => { - const { uuid, ownerUuid, name, description, kind } = this.props.item; + const { uuid, ownerUuid, name, description, kind, isTrashed } = this.props.item; const resource = { uuid, ownerUuid, name, description, kind, - menuKind: ContextMenuKind.COLLECTION + menuKind: isTrashed + ? ContextMenuKind.TRASHED_COLLECTION + : ContextMenuKind.COLLECTION }; this.props.dispatch(openContextMenu(event, resource)); } - handleDelete = (uuid: string) => () => { - this.props.dispatch(deleteCollectionTag(uuid)); + handleDelete = (key: string) => () => { + this.props.dispatch(deleteCollectionTag(key)); } onCopy = () => { @@ -158,8 +163,3 @@ export const CollectionPanel = withStyles(styles)( } ) ); - -const renderTagLabel = (tag: TagResource) => { - const { properties } = tag; - return `${properties.key}: ${properties.value}`; -};