--- /dev/null
+// 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
--- /dev/null
+// 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,
+ });
+};
--- /dev/null
+// 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
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' &&
snackbar: snackbarReducer,
treePicker: treePickerReducer,
fileUploader: fileUploaderReducer,
- processPanel: processPanelReducer
+ processPanel: processPanelReducer,
+ progressIndicator: progressIndicatorReducer
});
--- /dev/null
+// 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
+);
--- /dev/null
+// 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
+);
--- /dev/null
+// 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
+);
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';
direction="column"
className={this.props.classes.contentWrapper}>
<Grid item>
+ <WorkbenchProgress />
<MainContentBar />
</Grid>
<Grid item xs className={this.props.classes.content}>