X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eda7767bc88b7a2a3dc582af47417937ff4de38a..3971518483964a5c789eea29f7a199ebd99bdce3:/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 47dbd9b062..4a3f60a619 100644
--- a/src/views/project-panel/project-panel.tsx
+++ b/src/views/project-panel/project-panel.tsx
@@ -2,56 +2,56 @@
 //
 // 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';
 import { StyleRulesCallback, WithStyles } from "@material-ui/core";
 
-import { DataExplorer } from "~/views-components/data-explorer/data-explorer";
-import { DataColumns } from '~/components/data-table/data-table';
-import { RootState } from '~/store/store';
-import { DataTableFilterItem } from '~/components/data-table-filters/data-table-filters';
-import { ContainerRequestState } from '~/models/container-request';
-import { SortDirection } from '~/components/data-table/data-column';
-import { ResourceKind, Resource } from '~/models/resource';
+import { DataExplorer } from "views-components/data-explorer/data-explorer";
+import { DataColumns } from 'components/data-table/data-table';
+import { RootState } from 'store/store';
+import { DataTableFilterItem } from 'components/data-table-filters/data-table-filters';
+import { ContainerRequestState } from 'models/container-request';
+import { SortDirection } from 'components/data-table/data-column';
+import { ResourceKind, Resource } from 'models/resource';
 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';
+} from 'views-components/data-explorer/renderers';
+import { ProjectIcon } from 'components/icon/icon';
+import { ResourceName } from 'views-components/data-explorer/renderers';
 import {
     ResourcesState,
     getResource
-} from '~/store/resources/resources';
-import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
+} from 'store/resources/resources';
+import { loadDetailsPanel } from 'store/details-panel/details-panel-action';
 import {
     openContextMenu,
     resourceUuidToContextMenuKind
-} from '~/store/context-menu/context-menu-actions';
-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 { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
-import { ArvadosTheme } from "~/common/custom-theme";
-import { createTree } from '~/models/tree';
+} from 'store/context-menu/context-menu-actions';
+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 { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
+import { ArvadosTheme } from "common/custom-theme";
+import { createTree } from 'models/tree';
 import {
     getInitialResourceTypeFilters,
     getInitialProcessStatusFilters
-} from '~/store/resource-type-filters/resource-type-filters';
-import { GroupContentsResource } from '~/services/groups-service/groups-service';
+} 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<CssRules> = (theme: ArvadosTheme) => ({
     root: {
-        position: 'relative',
         width: '100%',
-        height: '100%'
     },
     button: {
         marginLeft: theme.spacing.unit
@@ -145,7 +145,7 @@ export const ProjectPanel = withStyles(styles)(
         class extends React.Component<ProjectPanelProps> {
             render() {
                 const { classes } = this.props;
-                return <div className={classes.root}>
+                return <div data-cy='project-panel' className={classes.root}>
                     <DataExplorer
                         id={PROJECT_PANEL_ID}
                         onRowClick={this.handleRowClick}
@@ -167,7 +167,14 @@ export const ProjectPanel = withStyles(styles)(
             handleContextMenu = (event: React.MouseEvent<HTMLElement>, resourceUuid: string) => {
                 const { resources } = this.props;
                 const resource = getResource<GroupContentsResource>(resourceUuid)(resources);
-                const menuKind = this.props.dispatch<any>(resourceUuidToContextMenuKind(resourceUuid));
+                // When viewing the contents of a filter group, all contents should be treated as read only.
+                let readonly = false;
+                const project = getResource<GroupResource>(this.props.currentItemId)(resources);
+                if (project && project.groupClass === GroupClass.FILTER) {
+                    readonly = true;
+                }
+
+                const menuKind = this.props.dispatch<any>(resourceUuidToContextMenuKind(resourceUuid, readonly));
                 if (menuKind && resource) {
                     this.props.dispatch<any>(openContextMenu(event, {
                         name: resource.name,
@@ -175,7 +182,9 @@ export const ProjectPanel = withStyles(styles)(
                         ownerUuid: resource.ownerUuid,
                         isTrashed: ('isTrashed' in resource) ? resource.isTrashed: false,
                         kind: resource.kind,
-                        menuKind
+                        menuKind,
+                        description: resource.description,
+                        storageClassesDesired: (resource as CollectionResource).storageClassesDesired,
                     }));
                 }
                 this.props.dispatch<any>(loadDetailsPanel(resourceUuid));
