X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/7f160d39308e02e571543b2958320f387b5372ab..614e5664c62ac01307744e29072ca1804cb7e676:/src/views/collection-panel/collection-panel.tsx?ds=sidebyside diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx index d513cfb4..db273b99 100644 --- a/src/views/collection-panel/collection-panel.tsx +++ b/src/views/collection-panel/collection-panel.tsx @@ -21,7 +21,7 @@ import { MoreOptionsIcon, CollectionIcon, ReadOnlyIcon, CollectionOldVersionIcon 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'; -import { navigateToProcess, collectionPanelActions } from 'store/collection-panel/collection-panel-action'; +import { navigateToProcess } from 'store/collection-panel/collection-panel-action'; import { getResource } from 'store/resources/resources'; import { openContextMenu, resourceUuidToContextMenuKind } from 'store/context-menu/context-menu-actions'; import { formatDate, formatFileSize } from "common/formatters"; @@ -33,10 +33,10 @@ import { GroupResource } from 'models/group'; import { UserResource } from 'models/user'; 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 { COLLECTION_PANEL_LOAD_FILES, loadCollectionFiles } 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'; -import { ResourceOwnerWithName, ResponsiblePerson } from 'views-components/data-explorer/renderers'; +import { ResourceWithName, ResponsiblePerson } from 'views-components/data-explorer/renderers'; import { MPVContainer, MPVPanelContent, MPVPanelState } from 'components/multi-panel-view/multi-panel-view'; type CssRules = 'root' @@ -115,7 +115,6 @@ interface CollectionPanelDataProps { isWritable: boolean; isOldVersion: boolean; isLoadingFiles: boolean; - tooManyFiles: boolean; } type CollectionPanelProps = CollectionPanelDataProps & DispatchProp @@ -139,15 +138,14 @@ export const CollectionPanel = withStyles(styles)( } const loadingFilesIndicator = getProgressIndicator(COLLECTION_PANEL_LOAD_FILES)(state.progressIndicator); const isLoadingFiles = (loadingFilesIndicator && loadingFilesIndicator!.working) || false; - const tooManyFiles = (!state.collectionPanel.loadBigCollections && item && item.fileCount > COLLECTION_PANEL_LOAD_FILES_THRESHOLD) || false; - return { item, isWritable, isOldVersion, isLoadingFiles, tooManyFiles }; + return { item, isWritable, isOldVersion, isLoadingFiles }; })( class extends React.Component { render() { - const { classes, item, dispatch, isWritable, isOldVersion, isLoadingFiles, tooManyFiles } = this.props; + const { classes, item, dispatch, isWritable, isOldVersion, isLoadingFiles } = this.props; const panelsData: MPVPanelState[] = [ - {name: "Details"}, - {name: "Files"}, + { name: "Details" }, + { name: "Files" }, ]; return item ? @@ -195,7 +193,7 @@ export const CollectionPanel = withStyles(styles)( {isOldVersion && This is an old version. Make a copy to make changes. Go to the head version for sharing options. - + } @@ -206,9 +204,7 @@ export const CollectionPanel = withStyles(styles)( { - dispatch(collectionPanelActions.LOAD_BIG_COLLECTIONS(true)); dispatch(loadCollectionFiles(this.props.item.uuid)); } } /> @@ -288,7 +284,7 @@ export const CollectionDetailsAttributes = (props: CollectionDetailsProps) => { } /> + uuidEnhancer={(uuid: string) => } />
@@ -323,7 +319,7 @@ export const CollectionDetailsAttributes = (props: CollectionDetailsProps) => { + label='Number of files' value={{item.fileCount}} /> { - { Object.keys(item.properties).length > 0 + {Object.keys(item.properties).length > 0 ? Object.keys(item.properties).map(k => - Array.isArray(item.properties[k]) + Array.isArray(item.properties[k]) ? item.properties[k].map((v: string) => getPropertyChip(k, v, undefined, classes.tag)) : getPropertyChip(k, item.properties[k], undefined, classes.tag)) - :
No properties
} + :
No properties
}
; };