[ARVADOS-WORKBENCH2] updated: 2.3.0-138-g89a4eb90

Git user git at public.arvados.org
Tue Jan 18 15:45:15 UTC 2022


Summary of changes:
 src/components/data-table/data-table.tsx            | 14 ++++++++------
 .../data-explorer/data-explorer.tsx                 | 21 ++++++++++++++++++---
 src/views/project-panel/project-panel.tsx           | 16 ++--------------
 3 files changed, 28 insertions(+), 23 deletions(-)

       via  89a4eb90454f12be703f711279d0867781013631 (commit)
      from  f528cc85e7687e1d899860c4226984bd067c5bd3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 89a4eb90454f12be703f711279d0867781013631
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date:   Tue Jan 18 16:38:09 2022 +0100

    18207: Added common icon and removed code duplication
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>

diff --git a/src/components/data-table/data-table.tsx b/src/components/data-table/data-table.tsx
index de694e08..3646fc8f 100644
--- a/src/components/data-table/data-table.tsx
+++ b/src/components/data-table/data-table.tsx
@@ -10,6 +10,7 @@ import { DataTableDefaultView } from '../data-table-default-view/data-table-defa
 import { DataTableFilters } from '../data-table-filters/data-table-filters-tree';
 import { DataTableFiltersPopover } from '../data-table-filters/data-table-filters-popover';
 import { countNodes } from 'models/tree';
+import { ProjectIcon } from 'components/icon/icon';
 import { SvgIconProps } from '@material-ui/core/SvgIcon';
 import ArrowDownwardIcon from '@material-ui/icons/ArrowDownward';
 
@@ -49,10 +50,8 @@ const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
         background: theme.palette.background.paper
     },
     loader: {
-        top: '50%',
         left: '50%',
-        marginTop: '-15px',
-        marginLeft: '-15px',
+        marginLeft: '-84px',
         position: 'absolute'
     },
     noItemsInfo: {
@@ -98,9 +97,12 @@ export const DataTable = withStyles(styles)(
                         </TableHead>
                         <TableBody className={classes.tableBody}>
                             {
-                                this.props.working ? 
-                                    null :
-                                    items.map(this.renderBodyRow)
+                                this.props.working ?
+                                <div className={classes.loader}>
+                                    <DataTableDefaultView
+                                        icon={ProjectIcon}
+                                        messages={['Loading data, please wait.']} />
+                                </div> : items.map(this.renderBodyRow)
                             }
                         </TableBody>
                     </Table>
diff --git a/src/views-components/data-explorer/data-explorer.tsx b/src/views-components/data-explorer/data-explorer.tsx
index 7d804a1c..900ab94e 100644
--- a/src/views-components/data-explorer/data-explorer.tsx
+++ b/src/views-components/data-explorer/data-explorer.tsx
@@ -21,12 +21,27 @@ interface Props {
     working?: boolean;
 }
 
-const mapStateToProps = (state: RootState, { id, working: parentWorking }: Props) => {
+let data: any[] = [];
+let href: string = '';
+
+const mapStateToProps = (state: RootState, { id }: Props) => {
     const progress = state.progressIndicator.find(p => p.id === id);
-    const working = (progress && progress.working) || parentWorking;
+    const dataExplorerState = getDataExplorer(state.dataExplorer, id);
     const currentRoute = state.router.location ? state.router.location.pathname : '';
     const currentItemUuid = currentRoute === '/workflows' ? state.properties.workflowPanelDetailsUuid : state.detailsPanel.resourceUuid;
-    return { ...getDataExplorer(state.dataExplorer, id), working, paperKey: currentRoute, currentItemUuid };
+
+    let loading = false;
+
+    if (dataExplorerState.items.length > 0 && data === dataExplorerState.items && href !== window.location.href) {
+        loading = true
+    } else {
+        href = window.location.href;
+        data = dataExplorerState.items;
+    }
+
+    const working = (progress && progress.working) || loading;
+
+    return { ...dataExplorerState, working, paperKey: currentRoute, currentItemUuid };
 };
 
 const mapDispatchToProps = () => {
diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx
index 892d2819..178a96aa 100644
--- a/src/views/project-panel/project-panel.tsx
+++ b/src/views/project-panel/project-panel.tsx
@@ -137,31 +137,19 @@ interface ProjectPanelDataProps {
 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,
+        userUuid: state.auth.user!.uuid
     }))(
         class extends React.Component<ProjectPanelProps> {
             render() {
-                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;
-                }
+                const { classes } = this.props;
 
                 return <div data-cy='project-panel' className={classes.root}>
                     <DataExplorer
-                        working={loading}
                         id={PROJECT_PANEL_ID}
                         onRowClick={this.handleRowClick}
                         onRowDoubleClick={this.handleRowDoubleClick}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list