Merge remote-tracking branch 'origin/main' into 18207-Workbench2-is-not-clearing...
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 12 Jan 2022 20:52:19 +0000 (21:52 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Wed, 12 Jan 2022 20:52:19 +0000 (21:52 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

1  2 
src/views/project-panel/project-panel.tsx

index ab11593dd1a1f0d7da9447d49b0067c156ed5266,e08aea32217016ae6448f8cb55e87640e8d12860..892d2819a2f71c355f51aa424359dfd2bd7bb6aa
@@@ -131,37 -131,22 +131,37 @@@ interface ProjectPanelDataProps 
      resources: ResourcesState;
      isAdmin: boolean;
      userUuid: string;
 +    dataExplorerItems: any;
  }
  
  type ProjectPanelProps = ProjectPanelDataProps & DispatchProp
      & WithStyles<CssRules> & 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<ProjectPanelProps> {
              render() {
 -                const { classes } = this.props;
 +                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 <div data-cy='project-panel' className={classes.root}>
                      <DataExplorer
 +                        working={loading}
                          id={PROJECT_PANEL_ID}
                          onRowClick={this.handleRowClick}
                          onRowDoubleClick={this.handleRowDoubleClick}
                          menuKind,
                          description: resource.description,
                          storageClassesDesired: (resource as CollectionResource).storageClassesDesired,
+                         properties: ('properties' in resource) ? resource.properties : {},
                      }));
                  }
                  this.props.dispatch<any>(loadDetailsPanel(resourceUuid));