X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ffdce0fe089aab55d26a3a4fe05934b912c691af..cdca66515836c841a175f3965929a837ee15ab09:/src/views/project-panel/project-panel.tsx diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx index 63aedaddeb..1221d0d1fb 100644 --- a/src/views/project-panel/project-panel.tsx +++ b/src/views/project-panel/project-panel.tsx @@ -3,7 +3,6 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { Button, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core'; import { DataExplorer } from "~/views-components/data-explorer/data-explorer"; import { DispatchProp, connect } from 'react-redux'; import { DataColumns } from '~/components/data-table/data-table'; @@ -14,7 +13,6 @@ import { ContainerRequestState } from '~/models/container-request'; import { SortDirection } from '~/components/data-table/data-column'; import { ResourceKind, Resource } from '~/models/resource'; import { resourceLabel } from '~/common/labels'; -import { ArvadosTheme } from '~/common/custom-theme'; import { ResourceFileSize, ResourceLastModifiedDate, ProcessStatus, ResourceType, ResourceOwner } from '~/views-components/data-explorer/renderers'; import { ProjectIcon } from '~/components/icon/icon'; import { ResourceName } from '~/views-components/data-explorer/renderers'; @@ -25,13 +23,12 @@ import { ProjectResource } from '~/models/project'; import { navigateTo } from '~/store/navigation/navigation-action'; import { getProperty } from '~/store/properties/properties'; import { PROJECT_PANEL_CURRENT_UUID } from '~/store/project-panel/project-panel-action'; -import { openCollectionCreateDialog } from '~/store/collections/collection-create-actions'; -import { openProjectCreateDialog } from '~/store/projects/project-create-actions'; -import { filterResources } from '~/store/resources/resources'; -import { PanelDefaultView } from '~/components/panel-default-view/panel-default-view'; import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view'; +import { StyleRulesCallback, WithStyles } from "@material-ui/core"; +import { ArvadosTheme } from "~/common/custom-theme"; +import withStyles from "@material-ui/core/styles/withStyles"; -type CssRules = 'root' | "toolbar" | "button"; +type CssRules = 'root' | "button"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -39,10 +36,6 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ width: '100%', height: '100%' }, - toolbar: { - paddingBottom: theme.spacing.unit * 3, - textAlign: "right" - }, button: { marginLeft: theme.spacing.unit }, @@ -143,50 +136,27 @@ export const ProjectPanel = withStyles(styles)( render() { const { classes } = this.props; return
-
- - - -
- {this.hasAnyItems() - ? } /> - : - } - + + }/>
; } - hasAnyItems = () => { - const resources = filterResources(this.isCurrentItemChild)(this.props.resources); - return resources.length > 0; - } - isCurrentItemChild = (resource: Resource) => { return resource.ownerUuid === this.props.currentItemId; } - handleNewProjectClick = () => { - this.props.dispatch(openProjectCreateDialog(this.props.currentItemId)); - } - - handleNewCollectionClick = () => { - this.props.dispatch(openCollectionCreateDialog(this.props.currentItemId)); - } - handleContextMenu = (event: React.MouseEvent, resourceUuid: string) => { const menuKind = resourceKindToContextMenuKind(resourceUuid); const resource = getResource(resourceUuid)(this.props.resources); @@ -200,6 +170,7 @@ export const ProjectPanel = withStyles(styles)( menuKind })); } + this.props.dispatch(loadDetailsPanel(resourceUuid)); } handleRowDoubleClick = (uuid: string) => {