Merge remote-tracking branch 'origin/main' into 18207-Workbench2-is-not-clearing...
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Fri, 17 Dec 2021 23:09:37 +0000 (00:09 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Fri, 17 Dec 2021 23:18:30 +0000 (00:18 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

1  2 
src/components/data-table/data-table.tsx
src/views-components/context-menu/action-sets/collection-files-action-set.ts
src/views/project-panel/project-panel.tsx

index 79a9459952ff31e6e179a542e444411ec8331230,de52d365030dfdc7a48a47bb2f6f52cd31fade51..9a31cbfde742314a65a687106cbb55dfe94888e0
@@@ -3,7 -3,7 +3,7 @@@
  // SPDX-License-Identifier: AGPL-3.0
  
  import React from 'react';
 -import { Table, TableBody, TableRow, TableCell, TableHead, TableSortLabel, StyleRulesCallback, Theme, WithStyles, withStyles, IconButton } from '@material-ui/core';
 +import { Table, TableBody, TableRow, TableCell, TableHead, TableSortLabel, StyleRulesCallback, Theme, WithStyles, withStyles, IconButton, CircularProgress } from '@material-ui/core';
  import classnames from 'classnames';
  import { DataColumn, SortDirection } from './data-column';
  import { DataTableDefaultView } from '../data-table-default-view/data-table-default-view';
@@@ -35,28 -35,19 +35,26 @@@ export interface DataTableDataProps<T> 
      currentRoute?: string;
  }
  
 -type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell' | 'arrow' | 'arrowButton' | 'tableCellWorkflows';
 +type CssRules = "tableBody" | "root" | "content" | "noItemsInfo" | 'tableCell' | 'arrow' | 'arrowButton' | 'tableCellWorkflows' | 'loader';
  
  const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
      root: {
-         overflowX: 'auto',
-         overflowY: 'auto',
-         height: 'calc(100vh - 280px)',
+         width: '100%',
      },
      content: {
          display: 'inline-block',
-         width: '100%'
+         width: '100%',
      },
      tableBody: {
          background: theme.palette.background.paper
      },
 +    loader: {
 +        top: '50%',
 +        left: '50%',
 +        marginTop: '-15px',
 +        marginLeft: '-15px',
 +        position: 'absolute'
 +    },
      noItemsInfo: {
          textAlign: "center",
          padding: theme.spacing.unit
@@@ -99,13 -90,7 +97,13 @@@ export const DataTable = withStyles(sty
                              </TableRow>
                          </TableHead>
                          <TableBody className={classes.tableBody}>
 -                            {items.map(this.renderBodyRow)}
 +                            {
 +                                this.props.working ? 
 +                                    <div>
 +                                        <CircularProgress className={classes.loader} size={30} />
 +                                    </div> :
 +                                    items.map(this.renderBodyRow)
 +                            }
                          </TableBody>
                      </Table>
                      {items.length === 0 && this.props.working !== undefined && !this.props.working && this.renderNoItemsPlaceholder()}
index 3aeec4c09c08ed854612ebdc3aeb55c248f406f9,59a5f368af40db783e489bd79d8543d77c66f7d9..7e08eef0ca14d6bb9e9374843a3d5f7c323e20f2
@@@ -4,7 -4,7 +4,7 @@@
  
  import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
  import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "store/collection-panel/collection-panel-files/collection-panel-files-actions";
--import { openCollectionPartialCopyDialog, openCollectionPartialCopyToSelectedCollectionDialog } from 'store/collections/collection-partial-copy-actions';
++import { openCollectionPartialCopyDialog } from 'store/collections/collection-partial-copy-actions';
  
  // These action sets are used on the multi-select actions button.
  export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[
              dispatch<any>(openCollectionPartialCopyDialog());
          }
      },
-     {
-         name: "Copy selected into the collection",
-         execute: dispatch => {
-             dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
-         }
-     }
+     // Disabled while addressing #18587
+     // {
+     //     name: "Copy selected into the collection",
+     //     execute: dispatch => {
+     //         dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
+     //     }
+     // }
  ]];
  
  export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[
index 80663330cc1f3ffefdf33e90937242cb0fd38533,4a3f60a619badef42c72e3b5ed5a56ba97868f3a..ab11593dd1a1f0d7da9447d49b0067c156ed5266
@@@ -51,9 -51,7 +51,7 @@@ type CssRules = 'root' | "button"
  
  const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
      root: {
-         position: 'relative',
          width: '100%',
-         height: '100%'
      },
      button: {
          marginLeft: theme.spacing.unit
@@@ -133,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 className={classes.root}>
+                 return <div data-cy='project-panel' className={classes.root}>
                      <DataExplorer
 +                        working={loading}
                          id={PROJECT_PANEL_ID}
                          onRowClick={this.handleRowClick}
                          onRowDoubleClick={this.handleRowDoubleClick}