[ARVADOS-WORKBENCH2] created: 1.2.0-356-g3853f85

Git user git at public.curoverse.com
Thu Sep 13 06:01:10 EDT 2018


        at  3853f85e670483e3afa3a15101ea391cac2ba8ec (commit)


commit 3853f85e670483e3afa3a15101ea391cac2ba8ec
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Thu Sep 13 12:00:48 2018 +0200

    progress-indicator-store-and-HOC
    
    Feature #14186
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/store/progress-indicator/progress-indicator-actions.ts b/src/store/progress-indicator/progress-indicator-actions.ts
new file mode 100644
index 0000000..5f824e4
--- /dev/null
+++ b/src/store/progress-indicator/progress-indicator-actions.ts
@@ -0,0 +1,12 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { unionize, ofType, UnionOf } from "~/common/unionize";
+
+export const progressIndicatorActions = unionize({
+    START_SUBMIT: ofType<{ id: string }>(),
+    STOP_SUBMIT: ofType<{ id: string }>()
+});
+
+export type ProgressIndicatorAction = UnionOf<typeof progressIndicatorActions>;
\ No newline at end of file
diff --git a/src/store/progress-indicator/progress-indicator-reducer.ts b/src/store/progress-indicator/progress-indicator-reducer.ts
new file mode 100644
index 0000000..7e1c236
--- /dev/null
+++ b/src/store/progress-indicator/progress-indicator-reducer.ts
@@ -0,0 +1,34 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { ProgressIndicatorAction, progressIndicatorActions } from "~/store/progress-indicator/progress-indicator-actions";
+
+export interface ProgressIndicatorState {
+    'workbenchProgress': { started: boolean };
+    'contentProgress': { started: boolean };
+    'detailsProgress': { started: boolean };
+}
+
+const initialState: ProgressIndicatorState = {
+    'workbenchProgress': { started: false },
+    'contentProgress': { started: false },
+    'detailsProgress': { started: false }
+};
+
+export enum ProgressIndicatorData {
+    WORKBENCH_PROGRESS = 'workbenchProgress',
+    CONTENT_PROGRESS = 'contentProgress',
+    DETAILS_PROGRESS = 'detailsProgress'
+}
+
+export const progressIndicatorReducer = (state: ProgressIndicatorState = initialState, action: ProgressIndicatorAction) => {
+    return progressIndicatorActions.match(action, {
+        START_SUBMIT: ({ id }) => ({ ...state, [id]: { started: true } }),
+        STOP_SUBMIT: ({ id }) => ({
+            ...state,
+            [id]: state[id] ? { ...state[id], started: false } : { started: false }
+        }),
+        default: () => state,
+    });
+};
diff --git a/src/store/progress-indicator/with-progress.ts b/src/store/progress-indicator/with-progress.ts
new file mode 100644
index 0000000..b91c05d
--- /dev/null
+++ b/src/store/progress-indicator/with-progress.ts
@@ -0,0 +1,20 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { RootState } from '~/store/store';
+
+export type WithProgressStateProps = {
+    started: boolean;
+};
+
+export const withProgress = (id: string) =>
+    (component: React.ComponentType<WithProgressStateProps>) =>
+        connect(mapStateToProps(id))(component);
+
+export const mapStateToProps = (id: string) => (state: RootState): WithProgressStateProps => {
+    const progress = state.progressIndicator[id];
+    return progress;
+};
\ No newline at end of file
diff --git a/src/store/store.ts b/src/store/store.ts
index 9b4f42b..205a21e 100644
--- a/src/store/store.ts
+++ b/src/store/store.ts
@@ -32,6 +32,7 @@ import { TrashPanelMiddlewareService } from "~/store/trash-panel/trash-panel-mid
 import { TRASH_PANEL_ID } from "~/store/trash-panel/trash-panel-action";
 import { processLogsPanelReducer } from './process-logs-panel/process-logs-panel-reducer';
 import { processPanelReducer } from '~/store/process-panel/process-panel-reducer';
+import { progressIndicatorReducer } from './progress-indicator/progress-indicator-reducer';
 
 const composeEnhancers =
     (process.env.NODE_ENV === 'development' &&
@@ -83,5 +84,6 @@ const createRootReducer = (services: ServiceRepository) => combineReducers({
     snackbar: snackbarReducer,
     treePicker: treePickerReducer,
     fileUploader: fileUploaderReducer,
-    processPanel: processPanelReducer
+    processPanel: processPanelReducer,
+    progressIndicator: progressIndicatorReducer
 });
diff --git a/src/views-components/progress/content-progress.tsx b/src/views-components/progress/content-progress.tsx
new file mode 100644
index 0000000..0d291f4
--- /dev/null
+++ b/src/views-components/progress/content-progress.tsx
@@ -0,0 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// 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';
+
+export const ContentProgress = withProgress(ProgressIndicatorData.CONTENT_PROGRESS)((props: WithProgressStateProps) => 
+    props.started ? <CircularProgress /> : null
+);
diff --git a/src/views-components/progress/detail-panel-progress.tsx b/src/views-components/progress/detail-panel-progress.tsx
new file mode 100644
index 0000000..d5d566e
--- /dev/null
+++ b/src/views-components/progress/detail-panel-progress.tsx
@@ -0,0 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// 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';
+
+export const DetailsPanelProgress = withProgress(ProgressIndicatorData.DETAILS_PROGRESS)((props: WithProgressStateProps) => 
+    props.started ? <CircularProgress /> : null
+);
diff --git a/src/views-components/progress/workbench-progress.tsx b/src/views-components/progress/workbench-progress.tsx
new file mode 100644
index 0000000..35bfd7a
--- /dev/null
+++ b/src/views-components/progress/workbench-progress.tsx
@@ -0,0 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// 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';
+
+export const WorkbenchProgress = withProgress(ProgressIndicatorData.WORKBENCH_PROGRESS)((props: WithProgressStateProps) => 
+    props.started ? <CircularProgress /> : null
+);
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 0e85ca3..e5d26a2 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -41,6 +41,7 @@ import { PartialCopyCollectionDialog } from '~/views-components/dialog-forms/par
 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';
 
 type CssRules = 'root' | 'contentWrapper' | 'content' | 'appBar';
 
@@ -124,6 +125,7 @@ export const Workbench = withStyles(styles)(
                                     direction="column"
                                     className={this.props.classes.contentWrapper}>
                                     <Grid item>
+                                        <WorkbenchProgress />
                                         <MainContentBar />
                                     </Grid>
                                     <Grid item xs className={this.props.classes.content}>

commit b4405043d5d6b397a53c4c5351b64d242fea3b48
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Wed Sep 12 12:54:03 2018 +0200

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

diff --git a/src/common/custom-theme.ts b/src/common/custom-theme.ts
index 2079010..be8e77f 100644
--- a/src/common/custom-theme.ts
+++ b/src/common/custom-theme.ts
@@ -26,8 +26,6 @@ interface Colors {
     yellow700: string;
     red900: string;
     blue500: string;
-    grey500: string;
-    grey700: string;
 }
 
 const red900 = red["900"];
@@ -47,8 +45,6 @@ export const themeOptions: ArvadosThemeOptions = {
             yellow700: yellow["700"],
             red900: red['900'],
             blue500: blue['500'],
-            grey500,
-            grey700
         }
     },
     overrides: {
diff --git a/src/store/processes/process.ts b/src/store/processes/process.ts
index c9e62f9..ab8093b 100644
--- a/src/store/processes/process.ts
+++ b/src/store/processes/process.ts
@@ -61,7 +61,7 @@ export const getProcessRuntime = ({ container }: Process) =>
         ? getTimeDiff(container.finishedAt || '', container.startedAt || '')
         : 0;
 
-export const getProcessStatusColor = (status: string, { customs }: ArvadosTheme) => {
+export const getProcessStatusColor = (status: string, { customs, palette }: ArvadosTheme) => {
     switch (status) {
         case ProcessStatus.RUNNING:
             return customs.colors.blue500;
@@ -71,7 +71,7 @@ export const getProcessStatusColor = (status: string, { customs }: ArvadosTheme)
         case ProcessStatus.FAILED:
             return customs.colors.red900;
         default:
-            return customs.colors.grey500;
+            return palette.grey["500"];
     }
 };
 
diff --git a/src/views/process-panel/subprocesses-card.tsx b/src/views/process-panel/subprocesses-card.tsx
index 0607c47..9cff1e9 100644
--- a/src/views/process-panel/subprocesses-card.tsx
+++ b/src/views/process-panel/subprocesses-card.tsx
@@ -16,7 +16,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         height: '100%'
     },
     title: {
-        color: theme.customs.colors.grey700
+        color: theme.palette.grey["700"]
     },
     gridFilter: {
         height: '20px',

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list