X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/25216cc7acedc987c26a159f0b640210c0ef101e..c952afae1af2fb31b68be04f70bd7ae6f9d52aba:/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 142abefd..892d2819 100644 --- a/src/views/project-panel/project-panel.tsx +++ b/src/views/project-panel/project-panel.tsx @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import withStyles from "@material-ui/core/styles/withStyles"; import { DispatchProp, connect } from 'react-redux'; import { RouteComponentProps } from 'react-router'; @@ -45,14 +45,13 @@ import { } from 'store/resource-type-filters/resource-type-filters'; import { GroupContentsResource } from 'services/groups-service/groups-service'; import { GroupClass, GroupResource } from 'models/group'; +import { CollectionResource } from 'models/collection'; type CssRules = 'root' | "button"; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { - position: 'relative', width: '100%', - height: '100%' }, button: { marginLeft: theme.spacing.unit @@ -132,22 +131,37 @@ interface ProjectPanelDataProps { resources: ResourcesState; isAdmin: boolean; userUuid: string; + dataExplorerItems: any; } type ProjectPanelProps = ProjectPanelDataProps & DispatchProp & WithStyles & RouteComponentProps<{ id: string }>; +let data: any[] = []; +let href: string = ''; + export const ProjectPanel = withStyles(styles)( connect((state: RootState) => ({ currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties), resources: state.resources, userUuid: state.auth.user!.uuid, + dataExplorerItems: state.dataExplorer?.projectPanel.items, }))( class extends React.Component { render() { - const { classes } = this.props; - return
+ const { classes, dataExplorerItems } = this.props; + let loading = false; + + if (dataExplorerItems.length > 0 && data === dataExplorerItems && href !== window.location.href) { + loading = true + } else { + href = window.location.href; + data = dataExplorerItems; + } + + return
(loadDetailsPanel(resourceUuid));