X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c08ec9f2612ffa2ceef5405d357e5c5b8cb608c9..f523522e3b9024b706da52bcddbce42a58c56296:/services/workbench2/src/views/project-panel/project-panel.tsx?ds=sidebyside

diff --git a/services/workbench2/src/views/project-panel/project-panel.tsx b/services/workbench2/src/views/project-panel/project-panel.tsx
index 112f09968a..433cb11209 100644
--- a/services/workbench2/src/views/project-panel/project-panel.tsx
+++ b/services/workbench2/src/views/project-panel/project-panel.tsx
@@ -51,32 +51,20 @@ import { GroupClass, GroupResource } from 'models/group';
 import { CollectionResource } from 'models/collection';
 import { resourceIsFrozen } from 'common/frozen-resources';
 import { ProjectResource } from 'models/project';
-import { NotFoundView } from 'views/not-found-panel/not-found-panel';
 import { deselectAllOthers, toggleOne } from 'store/multiselect/multiselect-actions';
-import { PendingIcon } from 'components/icon/icon';
-import { DataTableDefaultView } from 'components/data-table-default-view/data-table-default-view';
+import { ProjectDetailsCard } from 'views-components/project-details-card/project-details-card';
 
-type CssRules = 'root' | 'button' | 'loader' | 'notFoundView';
+type CssRules = 'root' | 'button' ;
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
         width: '100%',
+        display: 'flex',
+        flexDirection: 'column',
     },
     button: {
         marginLeft: theme.spacing.unit,
     },
-    loader: {
-        top: "25%",
-        left: "46.5%",
-        marginLeft: "-84px",
-        position: "absolute",
-    },
-    notFoundView: {
-        top: "30%",
-        left: "50%",
-        marginLeft: "-84px",
-        position: "absolute",
-    },
 });
 
 export enum ProjectPanelColumnNames {
@@ -266,9 +254,7 @@ type ProjectPanelProps = ProjectPanelDataProps & DispatchProp & WithStyles<CssRu
 const mapStateToProps = (state: RootState) => {
     const currentItemId = getProperty<string>(PROJECT_PANEL_CURRENT_UUID)(state.properties);
     const project = getResource<GroupResource>(currentItemId || "")(state.resources);
-    const working = !!state.progressIndicator.some(p => p.id === PROJECT_PANEL_ID && p.working);
     return {
-        working,
         currentItemId,
         project,
         resources: state.resources,
@@ -276,57 +262,24 @@ const mapStateToProps = (state: RootState) => {
     };
 }
 
-type ProjectPanelState = {
-    isLoaded: boolean;
-};
-
 export const ProjectPanel = withStyles(styles)(
     connect(mapStateToProps)(
         class extends React.Component<ProjectPanelProps> {
 
-            state: ProjectPanelState ={
-                isLoaded: false,
-            }
-
-            componentDidMount(): void {
-                this.setState({ isLoaded: false });
-            }
-
-            componentDidUpdate( prevProps: Readonly<ProjectPanelProps>, prevState: Readonly<{}>, snapshot?: any ): void {
-                if(prevProps.working === true && this.props.working === false) {
-                    this.setState({ isLoaded: true });
-                }
-            }
-
             render() {
                 const { classes } = this.props;
-
-                return this.props.project ?
-                    <div data-cy='project-panel' className={classes.root}>
-                        <DataExplorer
-                            id={PROJECT_PANEL_ID}
-                            onRowClick={this.handleRowClick}
-                            onRowDoubleClick={this.handleRowDoubleClick}
-                            onContextMenu={this.handleContextMenu}
-                            contextMenuColumn={true}
-                            defaultViewIcon={ProjectIcon}
-                            defaultViewMessages={DEFAULT_VIEW_MESSAGES}
-                        />
-                    </div>
-                : this.state.isLoaded ?
-                    <div className={classes.notFoundView}>
-                        <NotFoundView
-                            icon={ProjectIcon}
-                            messages={["Project not found"]}
-                            />
-                    </div>
-                    :   
-                    <div className={classes.loader}>
-                        <DataTableDefaultView
-                            icon={PendingIcon}
-                            messages={["Loading data, please wait."]}
-                        />
-                    </div>
+                return <div data-cy='project-panel' className={classes.root}>
+                    <ProjectDetailsCard />
+                    <DataExplorer
+                        id={PROJECT_PANEL_ID}
+                        onRowClick={this.handleRowClick}
+                        onRowDoubleClick={this.handleRowDoubleClick}
+                        onContextMenu={this.handleContextMenu}
+                        contextMenuColumn={true}
+                        defaultViewIcon={ProjectIcon}
+                        defaultViewMessages={DEFAULT_VIEW_MESSAGES}
+                    />
+                </div>
             }
 
             isCurrentItemChild = (resource: Resource) => {
