[ARVADOS-WORKBENCH2] updated: 1.2.0-375-g8e6af21

Git user git at public.curoverse.com
Fri Sep 14 09:59:59 EDT 2018


Summary of changes:
 src/index.tsx                                      |  3 +++
 .../progress-indicator-reducer.ts                  | 25 ++++++++++++++++------
 .../side-panel-tree/side-panel-tree-actions.ts     |  3 +++
 ...-panel-progress.tsx => side-panel-progress.tsx} |  4 ++--
 .../progress/workbench-progress.tsx                | 17 ++++++++-------
 .../side-panel-tree/side-panel-tree.tsx            |  1 +
 src/views-components/side-panel/side-panel.tsx     | 10 +++++++--
 src/views/workbench/workbench.tsx                  |  9 +++++---
 8 files changed, 51 insertions(+), 21 deletions(-)
 rename src/views-components/progress/{detail-panel-progress.tsx => side-panel-progress.tsx} (63%)

       via  8e6af2106e745285c5cda437d5856a99111686f8 (commit)
      from  12fbb73269d10424383cdbd712201498cc8d013a (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 8e6af2106e745285c5cda437d5856a99111686f8
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Fri Sep 14 15:59:47 2018 +0200

    side-panel-progress
    
    Feature #14186
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/index.tsx b/src/index.tsx
index a76a86a..a070685 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -37,6 +37,8 @@ import { Config } from '~/common/config';
 import { addRouteChangeHandlers } from './routes/route-change-handlers';
 import { setCurrentTokenDialogApiHost } from '~/store/current-token-dialog/current-token-dialog-actions';
 import { processResourceActionSet } from './views-components/context-menu/action-sets/process-resource-action-set';
+import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions';
+import { ProgressIndicatorData } from '~/store/progress-indicator/progress-indicator-reducer';
 
 const getBuildNumber = () => "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev");
 const getGitCommit = () => "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7);
@@ -67,6 +69,7 @@ fetchConfig()
         store.subscribe(initListener(history, store, services, config));
         store.dispatch(initAuth());
         store.dispatch(setCurrentTokenDialogApiHost(apiHost));
+        store.dispatch(progressIndicatorActions.START_SUBMIT({ id: ProgressIndicatorData.SIDE_PANEL_PROGRESS }));
 
         const TokenComponent = (props: any) => <ApiToken authService={services.authService} {...props} />;
         const WorkbenchComponent = (props: any) => <Workbench authService={services.authService} buildInfo={buildInfo} {...props} />;
diff --git a/src/store/progress-indicator/progress-indicator-reducer.ts b/src/store/progress-indicator/progress-indicator-reducer.ts
index 7e1c236..daacdb7 100644
--- a/src/store/progress-indicator/progress-indicator-reducer.ts
+++ b/src/store/progress-indicator/progress-indicator-reducer.ts
@@ -3,23 +3,26 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ProgressIndicatorAction, progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
+import { Dispatch } from 'redux';
+import { RootState } from '~/store/store';
+import { ServiceRepository } from '~/services/services';
 
 export interface ProgressIndicatorState {
-    'workbenchProgress': { started: boolean };
+    'sidePanelProgress': { started: boolean };
     'contentProgress': { started: boolean };
-    'detailsProgress': { started: boolean };
+    // 'workbenchProgress': { started: boolean };
 }
 
 const initialState: ProgressIndicatorState = {
-    'workbenchProgress': { started: false },
+    'sidePanelProgress': { started: false },
     'contentProgress': { started: false },
-    'detailsProgress': { started: false }
+    // 'workbenchProgress': { started: false }
 };
 
 export enum ProgressIndicatorData {
-    WORKBENCH_PROGRESS = 'workbenchProgress',
+    SIDE_PANEL_PROGRESS = 'sidePanelProgress',
     CONTENT_PROGRESS = 'contentProgress',
-    DETAILS_PROGRESS = 'detailsProgress'
+    // WORKBENCH_PROGRESS = 'workbenchProgress',
 }
 
 export const progressIndicatorReducer = (state: ProgressIndicatorState = initialState, action: ProgressIndicatorAction) => {
@@ -32,3 +35,13 @@ export const progressIndicatorReducer = (state: ProgressIndicatorState = initial
         default: () => state,
     });
 };
+
+// export const getProgress = () =>
+//     (dispatch: Dispatch, getState: () => RootState) => {
+//         const progress = getState().progressIndicator;
+//         if (progress.sidePanelProgress.started || progress.contentProgress.started) {
+//             dispatch(progressIndicatorActions.START_SUBMIT({ id: ProgressIndicatorData.WORKBENCH_PROGRESS }));
+//         } else {
+//             dispatch(progressIndicatorActions.STOP_SUBMIT({ id: ProgressIndicatorData.WORKBENCH_PROGRESS }));
+//         }
+//     };
diff --git a/src/store/side-panel-tree/side-panel-tree-actions.ts b/src/store/side-panel-tree/side-panel-tree-actions.ts
index 95e409f..c7ad91b 100644
--- a/src/store/side-panel-tree/side-panel-tree-actions.ts
+++ b/src/store/side-panel-tree/side-panel-tree-actions.ts
@@ -13,6 +13,8 @@ import { getTreePicker, TreePicker } from '../tree-picker/tree-picker';
 import { TreeItemStatus } from "~/components/tree/tree";
 import { getNodeAncestors, getNodeValue, getNodeAncestorsIds, getNode } from '~/models/tree';
 import { ProjectResource } from '~/models/project';
+import { progressIndicatorActions } from '../progress-indicator/progress-indicator-actions';
+import { ProgressIndicatorData } from '~/store/progress-indicator/progress-indicator-reducer';
 
 export enum SidePanelTreeCategory {
     PROJECTS = 'Projects',
@@ -99,6 +101,7 @@ export const activateSidePanelTreeItem = (nodeId: string) =>
         if (!isSidePanelTreeCategory(nodeId)) {
             await dispatch<any>(activateSidePanelTreeProject(nodeId));
         }
+        dispatch(progressIndicatorActions.STOP_SUBMIT({ id: ProgressIndicatorData.SIDE_PANEL_PROGRESS }));
     };
 
 export const activateSidePanelTreeProject = (nodeId: string) =>
diff --git a/src/views-components/progress/detail-panel-progress.tsx b/src/views-components/progress/side-panel-progress.tsx
similarity index 63%
rename from src/views-components/progress/detail-panel-progress.tsx
rename to src/views-components/progress/side-panel-progress.tsx
index d5d566e..b3bc0db 100644
--- a/src/views-components/progress/detail-panel-progress.tsx
+++ b/src/views-components/progress/side-panel-progress.tsx
@@ -8,6 +8,6 @@ import { withProgress } from '~/store/progress-indicator/with-progress';
 import { WithProgressStateProps } from '~/store/progress-indicator/with-progress';
 import { ProgressIndicatorData } from '~/store/progress-indicator/progress-indicator-reducer';
 
-export const DetailsPanelProgress = withProgress(ProgressIndicatorData.DETAILS_PROGRESS)((props: WithProgressStateProps) => 
-    props.started ? <CircularProgress /> : null
+export const SidePanelProgress = withProgress(ProgressIndicatorData.SIDE_PANEL_PROGRESS)((props: WithProgressStateProps) =>
+    props.started ? <span style={{ display: 'flex', justifyContent: 'center', marginTop: "40px" }}><CircularProgress /></span> : null
 );
diff --git a/src/views-components/progress/workbench-progress.tsx b/src/views-components/progress/workbench-progress.tsx
index 35bfd7a..1fdd57c 100644
--- a/src/views-components/progress/workbench-progress.tsx
+++ b/src/views-components/progress/workbench-progress.tsx
@@ -2,12 +2,13 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
-import { CircularProgress } from '@material-ui/core';
-import { withProgress } from '~/store/progress-indicator/with-progress';
-import { WithProgressStateProps } from '~/store/progress-indicator/with-progress';
-import { ProgressIndicatorData } from '~/store/progress-indicator/progress-indicator-reducer';
+// import * as React from 'react';
+// import { LinearProgress } from '@material-ui/core';
+// import { withProgress } from '~/store/progress-indicator/with-progress';
+// import { WithProgressStateProps } from '~/store/progress-indicator/with-progress';
+// import { ProgressIndicatorData } from '~/store/progress-indicator/progress-indicator-reducer';
 
-export const WorkbenchProgress = withProgress(ProgressIndicatorData.WORKBENCH_PROGRESS)((props: WithProgressStateProps) => 
-    props.started ? <CircularProgress /> : null
-);
+// export const WorkbenchProgress = withProgress(ProgressIndicatorData.WORKBENCH_PROGRESS)(
+//     (props: WithProgressStateProps) =>
+//         props.started ? <LinearProgress color="secondary" /> : null
+// );
diff --git a/src/views-components/side-panel-tree/side-panel-tree.tsx b/src/views-components/side-panel-tree/side-panel-tree.tsx
index d0b00d6..4d4760f 100644
--- a/src/views-components/side-panel-tree/side-panel-tree.tsx
+++ b/src/views-components/side-panel-tree/side-panel-tree.tsx
@@ -16,6 +16,7 @@ import { openSidePanelContextMenu } from '~/store/context-menu/context-menu-acti
 
 export interface SidePanelTreeProps {
     onItemActivation: (id: string) => void;
+    sidePanelProgress?: boolean;
 }
 
 type SidePanelTreeActionProps = Pick<TreePickerProps, 'onContextMenu' | 'toggleItemActive' | 'toggleItemOpen'>;
diff --git a/src/views-components/side-panel/side-panel.tsx b/src/views-components/side-panel/side-panel.tsx
index fffe334..780ecc7 100644
--- a/src/views-components/side-panel/side-panel.tsx
+++ b/src/views-components/side-panel/side-panel.tsx
@@ -11,6 +11,8 @@ import { connect } from 'react-redux';
 import { navigateFromSidePanel } from '../../store/side-panel/side-panel-action';
 import { Grid } from '@material-ui/core';
 import { SidePanelButton } from '~/views-components/side-panel-button/side-panel-button';
+import { RootState } from '~/store/store';
+import { SidePanelProgress } from '~/views-components/progress/side-panel-progress';
 
 const DRAWER_WITDH = 240;
 
@@ -32,11 +34,15 @@ const mapDispatchToProps = (dispatch: Dispatch): SidePanelTreeProps => ({
     }
 });
 
+const mapStateToProps = (state: RootState) => ({
+    sidePanelProgress: state.progressIndicator.sidePanelProgress.started
+});
+
 export const SidePanel = compose(
     withStyles(styles),
-    connect(undefined, mapDispatchToProps)
+    connect(mapStateToProps, mapDispatchToProps)
 )(({ classes, ...props }: WithStyles<CssRules> & SidePanelTreeProps) =>
     <Grid item xs>
         <SidePanelButton />
-        <SidePanelTree {...props} />
+        {props.sidePanelProgress ? <SidePanelProgress /> : <SidePanelTree {...props} />}
     </Grid>);
\ No newline at end of file
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index a24a8c9..c5cb983 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -41,8 +41,7 @@ import { FilesUploadCollectionDialog } from '~/views-components/dialog-forms/fil
 import { PartialCopyCollectionDialog } from '~/views-components/dialog-forms/partial-copy-collection-dialog';
 import { TrashPanel } from "~/views/trash-panel/trash-panel";
 import { MainContentBar } from '~/views-components/main-content-bar/main-content-bar';
-import { Grid } from '@material-ui/core';
-import { WorkbenchProgress } from '~/views-components/progress/workbench-progress';
+import { Grid, LinearProgress } from '@material-ui/core';
 import { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog';
 
 type CssRules = 'root' | 'asidePanel' | 'contentWrapper' | 'content' | 'appBar';
@@ -75,6 +74,8 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 interface WorkbenchDataProps {
     user?: User;
     currentToken?: string;
+    loadingSidePanel: boolean;
+    loadingContent: boolean;
 }
 
 interface WorkbenchGeneralProps {
@@ -93,6 +94,8 @@ export const Workbench = withStyles(styles)(
         (state: RootState) => ({
             user: state.auth.user,
             currentToken: state.auth.apiToken,
+            loadingSidePanel: state.progressIndicator.sidePanelProgress.started,
+            loadingContent: state.progressIndicator.contentProgress.started
         })
     )(
         class extends React.Component<WorkbenchProps, WorkbenchState> {
@@ -110,6 +113,7 @@ export const Workbench = withStyles(styles)(
                                 onSearch={this.onSearch}
                                 buildInfo={this.props.buildInfo} />
                         </Grid>
+                        {this.props.loadingContent || this.props.loadingSidePanel ? <LinearProgress color="secondary" /> : null}
                         {this.props.user &&
                             <Grid container item xs alignItems="stretch" wrap="nowrap">
                                 <Grid container item xs component='aside' direction='column' className={classes.asidePanel}>
@@ -117,7 +121,6 @@ export const Workbench = withStyles(styles)(
                                 </Grid>
                                 <Grid container item xs component="main" direction="column" className={classes.contentWrapper}>
                                     <Grid item>
-                                        <WorkbenchProgress />
                                         <MainContentBar />
                                     </Grid>
                                     <Grid item xs className={classes.content}>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list