workflow-view-middleware-service
authorPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Fri, 21 Sep 2018 12:04:06 +0000 (14:04 +0200)
committerPawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>
Fri, 21 Sep 2018 12:04:06 +0000 (14:04 +0200)
Feature #13857

Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk@contractors.roche.com>

17 files changed:
public/arvados-logo-big.png [new file with mode: 0644]
public/arvados_logo.png [new file with mode: 0644]
src/index.tsx
src/store/progress-indicator/progress-indicator-reducer.ts
src/store/store.ts
src/store/workbench/workbench-actions.ts
src/store/workflow-panel/workflow-middleware-service.ts
src/views-components/data-explorer/data-explorer.tsx
src/views-components/main-app-bar/main-app-bar.tsx
src/views-components/main-content-bar/main-content-bar.tsx
src/views/login-panel/login-panel.tsx [new file with mode: 0644]
src/views/main-panel/main-panel.tsx [new file with mode: 0644]
src/views/workbench/workbench-loading-screen.tsx [new file with mode: 0644]
src/views/workbench/workbench.test.tsx
src/views/workbench/workbench.tsx
src/views/workflow-panel/workflow-description-card.tsx
src/views/workflow-panel/workflow-panel.tsx

diff --git a/public/arvados-logo-big.png b/public/arvados-logo-big.png
new file mode 100644 (file)
index 0000000..c511f0e
Binary files /dev/null and b/public/arvados-logo-big.png differ
diff --git a/public/arvados_logo.png b/public/arvados_logo.png
new file mode 100644 (file)
index 0000000..cdb8160
Binary files /dev/null and b/public/arvados_logo.png differ
index 020f5482cd2e28e07ce78061ea2dd07a33302c0f..f456c995d1b34698decde9953479f4ffdde1250f 100644 (file)
@@ -5,7 +5,7 @@
 import * as React from 'react';
 import * as ReactDOM from 'react-dom';
 import { Provider } from "react-redux";
-import { Workbench } from './views/workbench/workbench';
+import { MainPanel } from './views/main-panel/main-panel';
 import './index.css';
 import { Route } from 'react-router';
 import createBrowserHistory from "history/createBrowserHistory";
@@ -38,7 +38,6 @@ 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 { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions";
 
 const getBuildNumber = () => "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev");
 const getGitCommit = () => "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7);
@@ -79,7 +78,7 @@ fetchConfig()
         store.dispatch(setCurrentTokenDialogApiHost(apiHost));
 
         const TokenComponent = (props: any) => <ApiToken authService={services.authService} {...props} />;
-        const WorkbenchComponent = (props: any) => <Workbench authService={services.authService} buildInfo={buildInfo} {...props} />;
+        const MainPanelComponent = (props: any) => <MainPanel buildInfo={buildInfo} {...props} />;
 
         const App = () =>
             <MuiThemeProvider theme={CustomTheme}>
@@ -87,7 +86,7 @@ fetchConfig()
                     <ConnectedRouter history={history}>
                         <div>
                             <Route path={Routes.TOKEN} component={TokenComponent} />
-                            <Route path={Routes.ROOT} component={WorkbenchComponent} />
+                            <Route path={Routes.ROOT} component={MainPanelComponent} />
                         </div>
                     </ConnectedRouter>
                 </Provider>
index 849906b53a300786d981d7ed83e2b3ecc70bf7bd..89885afb526ee7b904855e2bfab15c2f8ea8b5fe 100644 (file)
@@ -27,3 +27,7 @@ export const progressIndicatorReducer = (state: ProgressIndicatorState = initial
 export function isSystemWorking(state: ProgressIndicatorState): boolean {
     return state.length > 0 && state.reduce((working, p) => working ? true : p.working, false);
 }
+
+export const getProgressIndicator = (id: string) =>
+    (state: ProgressIndicatorState) =>
+        state.find(state => state.id === id);
index 97be93d868927822df3129b8e60a681de2abb5dc..16d0d055e30d9c100f8985e071ceee1e63768dd8 100644 (file)
@@ -73,6 +73,7 @@ export function configureStore(history: History, services: ServiceRepository): R
         favoritePanelMiddleware,
         trashPanelMiddleware,
         sharedWithMePanelMiddleware,
+        workflowPanelMiddleware
     ];
     const enhancer = composeEnhancers(applyMiddleware(...middlewares));
     return createStore(rootReducer, enhancer);
index 9124c660ddf4c4c69c459dc2e7ac4039459d9d01..5440fc902561868ac7a72f0ddc0b9636e166ebd6 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { Dispatch } from 'redux';
+import { Dispatch, AnyAction } from 'redux';
 import { RootState } from "../store";
 import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
 import { loadCollectionPanel } from '~/store/collection-panel/collection-panel-action';
@@ -41,9 +41,31 @@ import { loadSharedWithMePanel } from '../shared-with-me-panel/shared-with-me-pa
 import { CopyFormDialogData } from '~/store/copy-dialog/copy-dialog';
 import { loadWorkflowPanel, workflowPanelActions } from '~/store/workflow-panel/workflow-panel-actions';
 import { workflowPanelColumns } from '~/views/workflow-panel/workflow-panel';
+import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions';
+import { getProgressIndicator } from '../progress-indicator/progress-indicator-reducer';
+
+export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen';
+
+export const isWorkbenchLoading = (state: RootState) => {
+    const progress = getProgressIndicator(WORKBENCH_LOADING_SCREEN)(state.progressIndicator);
+    return progress ? progress.working : false;
+};
+
+const handleFirstTimeLoad = (action: any) =>
+    async (dispatch: Dispatch<any>, getState: () => RootState) => {
+        try {
+            await dispatch(action);
+        } finally {
+            if (isWorkbenchLoading(getState())) {
+                dispatch(progressIndicatorActions.STOP_WORKING(WORKBENCH_LOADING_SCREEN));
+            }
+        }
+    };
+
 
 export const loadWorkbench = () =>
     async (dispatch: Dispatch, getState: () => RootState) => {
+        dispatch(progressIndicatorActions.START_WORKING(WORKBENCH_LOADING_SCREEN));
         const { auth, router } = getState();
         const { user } = auth;
         if (user) {
@@ -53,7 +75,7 @@ export const loadWorkbench = () =>
                 dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns }));
                 dispatch(trashPanelActions.SET_COLUMNS({ columns: trashPanelColumns }));
                 dispatch(sharedWithMePanelActions.SET_COLUMNS({ columns: projectPanelColumns }));
-                dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns}));
+                dispatch(workflowPanelActions.SET_COLUMNS({ columns: workflowPanelColumns }));
                 dispatch<any>(initSidePanelTree());
                 if (router.location) {
                     const match = matchRootRoute(router.location.pathname);
@@ -70,26 +92,29 @@ export const loadWorkbench = () =>
     };
 
 export const loadFavorites = () =>
-    (dispatch: Dispatch) => {
-        dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.FAVORITES));
-        dispatch<any>(loadFavoritePanel());
-        dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.FAVORITES));
-    };
+    handleFirstTimeLoad(
+        (dispatch: Dispatch) => {
+            dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.FAVORITES));
+            dispatch<any>(loadFavoritePanel());
+            dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.FAVORITES));
+        });
 
 export const loadTrash = () =>
-    (dispatch: Dispatch) => {
-        dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
-        dispatch<any>(loadTrashPanel());
-        dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
-    };
+    handleFirstTimeLoad(
+        (dispatch: Dispatch) => {
+            dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.TRASH));
+            dispatch<any>(loadTrashPanel());
+            dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.TRASH));
+        });
 
 export const loadProject = (uuid: string) =>
-    async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
-        dispatch(openProjectPanel(uuid));
-        await dispatch(activateSidePanelTreeItem(uuid));
-        dispatch(setProjectBreadcrumbs(uuid));
-        dispatch(loadDetailsPanel(uuid));
-    };
+    handleFirstTimeLoad(
+        async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+            dispatch(openProjectPanel(uuid));
+            await dispatch(activateSidePanelTreeItem(uuid));
+            dispatch(setProjectBreadcrumbs(uuid));
+            dispatch(loadDetailsPanel(uuid));
+        });
 
 export const createProject = (data: projectCreateActions.ProjectCreateFormDialogData) =>
     async (dispatch: Dispatch) => {
@@ -136,12 +161,13 @@ export const updateProject = (data: projectUpdateActions.ProjectUpdateFormDialog
     };
 
 export const loadCollection = (uuid: string) =>
-    async (dispatch: Dispatch) => {
-        const collection = await dispatch<any>(loadCollectionPanel(uuid));
-        await dispatch<any>(activateSidePanelTreeItem(collection.ownerUuid));
-        dispatch<any>(setCollectionBreadcrumbs(collection.uuid));
-        dispatch(loadDetailsPanel(uuid));
-    };
+    handleFirstTimeLoad(
+        async (dispatch: Dispatch) => {
+            const collection = await dispatch<any>(loadCollectionPanel(uuid));
+            await dispatch<any>(activateSidePanelTreeItem(collection.ownerUuid));
+            dispatch<any>(setCollectionBreadcrumbs(collection.uuid));
+            dispatch(loadDetailsPanel(uuid));
+        });
 
 export const createCollection = (data: collectionCreateActions.CollectionCreateFormDialogData) =>
     async (dispatch: Dispatch) => {
@@ -194,14 +220,14 @@ export const moveCollection = (data: MoveToFormDialogData) =>
     };
 
 export const loadProcess = (uuid: string) =>
-    async (dispatch: Dispatch, getState: () => RootState) => {
-        dispatch<any>(loadProcessPanel(uuid));
-        const process = await dispatch<any>(processesActions.loadProcess(uuid));
-        await dispatch<any>(activateSidePanelTreeItem(process.containerRequest.ownerUuid));
-        dispatch<any>(setProcessBreadcrumbs(uuid));
-        dispatch(loadDetailsPanel(uuid));
-
-    };
+    handleFirstTimeLoad(
+        async (dispatch: Dispatch, getState: () => RootState) => {
+            dispatch<any>(loadProcessPanel(uuid));
+            const process = await dispatch<any>(processesActions.loadProcess(uuid));
+            await dispatch<any>(activateSidePanelTreeItem(process.containerRequest.ownerUuid));
+            dispatch<any>(setProcessBreadcrumbs(uuid));
+            dispatch(loadDetailsPanel(uuid));
+        });
 
 export const updateProcess = (data: processUpdateActions.ProcessUpdateFormDialogData) =>
     async (dispatch: Dispatch) => {
@@ -245,12 +271,13 @@ export const copyProcess = (data: CopyFormDialogData) =>
     };
 
 export const loadProcessLog = (uuid: string) =>
-    async (dispatch: Dispatch) => {
-        const process = await dispatch<any>(processesActions.loadProcess(uuid));
-        dispatch<any>(setProcessBreadcrumbs(uuid));
-        dispatch<any>(initProcessLogsPanel(uuid));
-        await dispatch<any>(activateSidePanelTreeItem(process.containerRequest.ownerUuid));
-    };
+    handleFirstTimeLoad(
+        async (dispatch: Dispatch) => {
+            const process = await dispatch<any>(processesActions.loadProcess(uuid));
+            dispatch<any>(setProcessBreadcrumbs(uuid));
+            dispatch<any>(initProcessLogsPanel(uuid));
+            await dispatch<any>(activateSidePanelTreeItem(process.containerRequest.ownerUuid));
+        });
 
 export const resourceIsNotLoaded = (uuid: string) =>
     snackbarActions.OPEN_SNACKBAR({
@@ -273,14 +300,14 @@ export const reloadProjectMatchingUuid = (matchingUuids: string[]) =>
         }
     };
 
-export const loadSharedWithMe = (dispatch: Dispatch) => {
-    dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME));
+export const loadSharedWithMe = handleFirstTimeLoad(async (dispatch: Dispatch) => {
     dispatch<any>(loadSharedWithMePanel());
-    dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.SHARED_WITH_ME));
-};
+    await dispatch<any>(activateSidePanelTreeItem(SidePanelTreeCategory.SHARED_WITH_ME));
+    await dispatch<any>(setSidePanelBreadcrumbs(SidePanelTreeCategory.SHARED_WITH_ME));
+});
 
-export const loadWorkflow = (dispatch: Dispatch<any>) => {
+export const loadWorkflow = handleFirstTimeLoad(async (dispatch: Dispatch<any>) => {
     dispatch(activateSidePanelTreeItem(SidePanelTreeCategory.WORKFLOWS));
-    dispatch(loadWorkflowPanel());
+    await dispatch(loadWorkflowPanel());
     dispatch(setSidePanelBreadcrumbs(SidePanelTreeCategory.WORKFLOWS));
-};
+});
index 2ca5337e2f39d7ed7d8a525d8fd12c71f89243ea..7fa2dd4f819422b96e9acc9489c8e62e5635ca7e 100644 (file)
@@ -7,7 +7,7 @@ import { MiddlewareAPI, Dispatch } from 'redux';
 import { DataExplorerMiddlewareService, dataExplorerToListParams, listResultsToDataExplorerItemsMeta } from '~/store/data-explorer/data-explorer-middleware-service';
 import { RootState } from '~/store/store';
 import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
-import { DataExplorer } from '~/store/data-explorer/data-explorer-reducer';
+import { DataExplorer, getDataExplorer } from '~/store/data-explorer/data-explorer-reducer';
 import { updateResources } from '~/store/resources/resources-actions';
 import { FilterBuilder } from '~/services/api/filter-builder';
 import { SortDirection } from '~/components/data-table/data-column';
@@ -23,10 +23,12 @@ export class WorkflowMiddlewareService extends DataExplorerMiddlewareService {
     }
 
     async requestItems(api: MiddlewareAPI<Dispatch, RootState>) {
+        const state = api.getState();
+        const dataExplorer = getDataExplorer(state.dataExplorer, this.getId());
         try {
-            const response = await this.services.workflowService;
-            api.dispatch(updateResources([]));
-            api.dispatch(setItems({ kind: '', offset: 4, limit: 4, items: [], itemsAvailable: 4 }));
+            const response = await this.services.workflowService.list({ order: getOrder(dataExplorer) });
+            api.dispatch(updateResources(response.items));
+            api.dispatch(setItems(response));
         } catch {
             api.dispatch(couldNotFetchWorkflows());
         }
index 74c3e64aaacf1139d5a90cff0c5ada69f40b14b2..17f2c77b0a44fdd3b235b1625c9d0ddf39ba430f 100644 (file)
@@ -15,7 +15,7 @@ import { DataColumns } from "~/components/data-table/data-table";
 interface Props {
     id: string;
     onRowClick: (item: any) => void;
-    onContextMenu: (event: React.MouseEvent<HTMLElement>, item: any) => void;
+    onContextMenu?: (event: React.MouseEvent<HTMLElement>, item: any) => void;
     onRowDoubleClick: (item: any) => void;
     extractKey?: (item: any) => React.Key;
 }
index 93cf4968e99e5bd1475258fa23b5f3ed35fe8003..1072a56f65c65b50dcfe6a880ec1049a7238a7a6 100644 (file)
@@ -78,7 +78,7 @@ export const MainAppBar = withStyles(styles)(
                                 <AccountMenu />
                                 <HelpMenu />
                             </>
-                            : <AnonymousMenu />}
+                            : <HelpMenu />}
                     </Grid>
                 </Grid>
             </Toolbar>
index 41442bba0d395e0f02f43d4ae6b3adb3bab00cbb..6fb419e36710aa187e0f28a79b46fba82ed5f0d7 100644 (file)
@@ -16,14 +16,14 @@ interface MainContentBarProps {
     buttonVisible: boolean;
 }
 
-const isButtonVisible = ({ router }: RootState) => {
+const isWorkflowPath = ({ router }: RootState) => {
     const pathname = router.location ? router.location.pathname : '';
-    const match = !matchWorkflowRoute(pathname);
+    const match = matchWorkflowRoute(pathname);
     return !!match;
 };
 
 export const MainContentBar = connect((state: RootState) => ({
-    buttonVisible: isButtonVisible(state)
+    buttonVisible: !isWorkflowPath(state)
 }), {
         onDetailsPanelToggle: detailsPanelActions.TOGGLE_DETAILS_PANEL
     })((props: MainContentBarProps) =>
diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx
new file mode 100644 (file)
index 0000000..377c58b
--- /dev/null
@@ -0,0 +1,83 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { compose } from 'redux';
+import { connect, DispatchProp } from 'react-redux';
+import { Grid, Typography, Button } from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { login } from '~/store/auth/auth-action';
+import { ArvadosTheme } from '~/common/custom-theme';
+import * as classNames from 'classnames';
+
+type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    root: {
+        position: 'relative',
+        backgroundColor: theme.palette.grey["200"],
+        '&::after': {
+            content: `''`,
+            position: 'absolute',
+            top: 0,
+            left: 0,
+            bottom: 0,
+            right: 0,
+            background: 'url("arvados-logo-big.png") no-repeat center center',
+            opacity: 0.2,
+        }
+    },
+    container: {
+        width: '560px',
+        zIndex: 10
+    },
+    title: {
+        marginBottom: theme.spacing.unit * 6,
+        color: theme.palette.grey["800"]
+    },
+    content: {
+        marginBottom: theme.spacing.unit * 3,
+        lineHeight: '1.2rem',
+        color: theme.palette.grey["800"]
+    },
+    'content__bolder': {
+        fontWeight: 'bolder'
+    },
+    button: {
+        boxShadow: 'none'
+    }
+});
+
+type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules>;
+
+export const LoginPanel = compose(
+    withStyles(styles),
+    connect()
+)(({ classes, dispatch }: LoginPanelProps) => 
+    <Grid container direction="column" item xs alignItems="center" justify="center" className={classes.root}>
+        <Grid item className={classes.container}>
+            <Typography variant="title" align="center" className={classes.title}>
+                Welcome to the Arvados Wrokbench
+            </Typography>
+            <Typography variant="body1" className={classes.content}>
+                The "Log in" button below will show you a Google sign-in page. 
+                After you assure Google that you want to log in here with your Google account, you will be redirected back here to Arvados Workbench.
+            </Typography>
+            <Typography variant="body1" className={classes.content}>
+                If you have never used Arvados Workbench before, logging in for the first time will automatically create a new account.
+            </Typography>
+            <Typography variant="body2" className={classNames(classes.content, classes.content__bolder)}>
+                IMPORTANT: Please keep in mind to store exploratory data only but not any information used for clinical decision making.
+            </Typography>
+            <Typography variant="body1" className={classes.content}>
+                Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google.
+            </Typography>
+            <Typography component="div" align="right">
+                <Button variant="contained" color="primary" className={classes.button} onClick={() => dispatch(login())}>
+                    Log in
+                </Button>
+            </Typography>
+        </Grid>
+    </Grid>
+);
\ No newline at end of file
diff --git a/src/views/main-panel/main-panel.tsx b/src/views/main-panel/main-panel.tsx
new file mode 100644 (file)
index 0000000..297a621
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { connect, DispatchProp } from 'react-redux';
+import { push } from 'react-router-redux';
+import { LinearProgress, Grid } from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { RootState } from '~/store/store';
+import { User } from '~/models/user';
+import { WorkbenchPanel } from '~/views/workbench/workbench';
+import { LoginPanel } from '~/views/login-panel/login-panel';
+import { MainAppBar } from '~/views-components/main-app-bar/main-app-bar';
+import { isSystemWorking } from '~/store/progress-indicator/progress-indicator-reducer';
+import { isWorkbenchLoading } from '../../store/workbench/workbench-actions';
+import { WorkbenchLoadingScreen } from '~/views/workbench/workbench-loading-screen';
+
+type CssRules = 'root';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    root: {
+        overflow: 'hidden',
+        width: '100vw',
+        height: '100vh'
+    }
+});
+
+interface MainPanelDataProps {
+    user?: User;
+    working: boolean;
+    loading: boolean;
+}
+
+interface MainPanelGeneralProps {
+    buildInfo: string;
+}
+
+interface MainPanelState {
+    searchText: string;
+}
+
+type MainPanelProps = MainPanelDataProps & MainPanelGeneralProps & DispatchProp<any> & WithStyles<CssRules>;
+
+export const MainPanel = withStyles(styles)(
+    connect<MainPanelDataProps>(
+        (state: RootState) => ({
+            user: state.auth.user,
+            working: isSystemWorking(state.progressIndicator),
+            loading: isWorkbenchLoading(state)
+        })
+    )(
+        class extends React.Component<MainPanelProps, MainPanelState> {
+            state = {
+                searchText: "",
+            };
+
+            render() {
+                const { classes, user, buildInfo, working, loading } = this.props;
+                const { searchText } = this.state;
+                return loading
+                    ? <WorkbenchLoadingScreen />
+                    : <>
+                        <MainAppBar
+                            searchText={searchText}
+                            user={user}
+                            onSearch={this.onSearch}
+                            buildInfo={buildInfo}>
+                            {working ? <LinearProgress color="secondary" /> : null}
+                        </MainAppBar>
+                        <Grid container direction="column" className={classes.root}>
+                            {user ? <WorkbenchPanel /> : <LoginPanel />}
+                        </Grid>
+                    </>;
+            }
+
+            onSearch = (searchText: string) => {
+                this.setState({ searchText });
+                this.props.dispatch(push(`/search?q=${searchText}`));
+            }
+        }
+    )
+);
\ No newline at end of file
diff --git a/src/views/workbench/workbench-loading-screen.tsx b/src/views/workbench/workbench-loading-screen.tsx
new file mode 100644 (file)
index 0000000..3040103
--- /dev/null
@@ -0,0 +1,32 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { Grid, CircularProgress } from '@material-ui/core';
+
+type CssRules = 'root' | 'img';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    img: {
+        marginBottom: theme.spacing.unit * 4
+    },
+    root: {
+        background: theme.palette.background.default,
+        bottom: 0,
+        left: 0,
+        position: 'fixed',
+        right: 0,
+        top: 0,
+        zIndex: theme.zIndex.appBar + 1,
+    }
+});
+
+export const WorkbenchLoadingScreen = withStyles(styles)(({ classes }: WithStyles<CssRules>) =>
+    <Grid container direction="column" alignItems='center' justify='center' className={classes.root}>
+        <img src='/arvados_logo.png' className={classes.img} />
+        <CircularProgress />
+    </Grid>
+);
index d03e1172fb4fc963c99fcaaeb9ea014c9dda6751..14ca6947edfe967c6b3892f2b4340adf156f37a8 100644 (file)
@@ -4,7 +4,7 @@
 
 import * as React from 'react';
 import * as ReactDOM from 'react-dom';
-import { Workbench } from './workbench';
+import { WorkbenchPanel } from './workbench';
 import { Provider } from "react-redux";
 import { configureStore } from "~/store/store";
 import createBrowserHistory from "history/createBrowserHistory";
@@ -24,7 +24,7 @@ it('renders without crashing', () => {
         <MuiThemeProvider theme={CustomTheme}>
             <Provider store={store}>
                 <ConnectedRouter history={history}>
-                    <Workbench authService={services.authService}/>
+                    <WorkbenchPanel />
                 </ConnectedRouter>
             </Provider>
         </MuiThemeProvider>,
index 54336575742ea83c51a6eb7a1b4a35d2a5f82427..692c40b819b8b68cea59fa8f59b9f34b9b5a30aa 100644 (file)
@@ -4,22 +4,15 @@
 
 import * as React from 'react';
 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
-import { connect, DispatchProp } from "react-redux";
 import { Route, Switch } from "react-router";
-import { User } from "~/models/user";
-import { RootState } from "~/store/store";
-import { MainAppBar } from '~/views-components/main-app-bar/main-app-bar';
-import { push } from 'react-router-redux';
 import { ProjectPanel } from "~/views/project-panel/project-panel";
 import { DetailsPanel } from '~/views-components/details-panel/details-panel';
 import { ArvadosTheme } from '~/common/custom-theme';
-import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
 import { ContextMenu } from "~/views-components/context-menu/context-menu";
 import { FavoritePanel } from "../favorite-panel/favorite-panel";
 import { CurrentTokenDialog } from '~/views-components/current-token-dialog/current-token-dialog';
 import { Snackbar } from '~/views-components/snackbar/snackbar';
 import { CollectionPanel } from '../collection-panel/collection-panel';
-import { AuthService } from "~/services/auth-service/auth-service";
 import { RenameFileDialog } from '~/views-components/rename-file-dialog/rename-file-dialog';
 import { FileRemoveDialog } from '~/views-components/file-remove-dialog/file-remove-dialog';
 import { MultipleFilesRemoveDialog } from '~/views-components/file-remove-dialog/multiple-files-remove-dialog';
@@ -41,21 +34,18 @@ 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, LinearProgress } from '@material-ui/core';
+import { Grid } from '@material-ui/core';
 import { SharedWithMePanel } from '../shared-with-me-panel/shared-with-me-panel';
 import SplitterLayout from 'react-splitter-layout';
 import { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog';
-import { isSystemWorking } from "~/store/progress-indicator/progress-indicator-reducer";
 import { WorkflowPanel } from '~/views/workflow-panel/workflow-panel';
 
-type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content' | 'appBar';
+type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
-        overflow: 'hidden',
-        width: '100vw',
-        height: '100vh',
-        paddingTop: theme.spacing.unit * 8
+        paddingTop: theme.spacing.unit * 7,
+        background: theme.palette.background.default
     },
     container: {
         position: 'relative'
@@ -66,128 +56,72 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         }
     },
     asidePanel: {
-        height: '100%',
-        background: theme.palette.background.default
+        paddingTop: theme.spacing.unit,
+        height: '100%'
     },
     contentWrapper: {
-        background: theme.palette.background.default,
-        minWidth: 0,
+        paddingTop: theme.spacing.unit,
+        minWidth: 0
     },
     content: {
         minWidth: 0,
         paddingLeft: theme.spacing.unit * 3,
         paddingRight: theme.spacing.unit * 3,
-    },
-    appBar: {
-        zIndex: 1,
     }
 });
 
-interface WorkbenchDataProps {
-    user?: User;
-    currentToken?: string;
-    working: boolean;
-}
-
-interface WorkbenchGeneralProps {
-    authService: AuthService;
-    buildInfo: string;
-}
-
-type WorkbenchProps = WorkbenchDataProps & WorkbenchGeneralProps & DispatchProp<any> & WithStyles<CssRules>;
+type WorkbenchPanelProps = WithStyles<CssRules>;
 
-interface WorkbenchState {
-    searchText: string;
-}
-
-export const Workbench = withStyles(styles)(
-    connect<WorkbenchDataProps>(
-        (state: RootState) => ({
-            user: state.auth.user,
-            currentToken: state.auth.apiToken,
-            working: isSystemWorking(state.progressIndicator)
-        })
-    )(
-        class extends React.Component<WorkbenchProps, WorkbenchState> {
-            state = {
-                searchText: "",
-            };
-            render() {
-                const { classes } = this.props;
-                return <>
-                    <MainAppBar
-                        searchText={this.state.searchText}
-                        user={this.props.user}
-                        onSearch={this.onSearch}
-                        buildInfo={this.props.buildInfo}>
-                        {this.props.working ? <LinearProgress color="secondary" /> : null}
-                    </MainAppBar>
-                    <Grid container direction="column" className={classes.root}>
-                        {this.props.user &&
-                            <Grid container item xs alignItems="stretch" wrap="nowrap">
-                                <Grid container item className={classes.container}>
-                                    <SplitterLayout customClassName={classes.splitter} percentage={true}
-                                        primaryIndex={0} primaryMinSize={20} secondaryInitialSize={80} secondaryMinSize={40}>
-                                        <Grid container item xs component='aside' direction='column' className={classes.asidePanel}>
-                                            <SidePanel />
-                                        </Grid>
-                                        <Grid container item xs component="main" direction="column" className={classes.contentWrapper}>
-                                            <Grid item>
-                                                <MainContentBar />
-                                            </Grid>
-                                            <Grid item xs className={classes.content}>
-                                                <Switch>
-                                                    <Route path={Routes.PROJECTS} component={ProjectPanel} />
-                                                    <Route path={Routes.COLLECTIONS} component={CollectionPanel} />
-                                                    <Route path={Routes.FAVORITES} component={FavoritePanel} />
-                                                    <Route path={Routes.PROCESSES} component={ProcessPanel} />
-                                                    <Route path={Routes.TRASH} component={TrashPanel} />
-                                                    <Route path={Routes.PROCESS_LOGS} component={ProcessLogPanel} />
-                                                    <Route path={Routes.SHARED_WITH_ME} component={SharedWithMePanel} />
-                                                    <Route path={Routes.WORKFLOWS} component={WorkflowPanel} />
-                                                </Switch>
-                                            </Grid>
-                                        </Grid>
-                                    </SplitterLayout>
-                                </Grid>
-                                <Grid item>
-                                    <DetailsPanel />
-                                </Grid>
-                            </Grid>
-                        }
+export const WorkbenchPanel = 
+    withStyles(styles)(({ classes }: WorkbenchPanelProps) => 
+        <Grid container item xs className={classes.root}>
+            <Grid container item xs className={classes.container}>
+                <SplitterLayout customClassName={classes.splitter} percentage={true}
+                    primaryIndex={0} primaryMinSize={20} secondaryInitialSize={80} secondaryMinSize={40}>
+                    <Grid container item xs component='aside' direction='column' className={classes.asidePanel}>
+                        <SidePanel />
                     </Grid>
-                    <ContextMenu />
-                    <CopyCollectionDialog />
-                    <CopyProcessDialog />
-                    <CreateCollectionDialog />
-                    <CreateProjectDialog />
-                    <CurrentTokenDialog />
-                    <FileRemoveDialog />
-                    <FileRemoveDialog />
-                    <FilesUploadCollectionDialog />
-                    <MoveCollectionDialog />
-                    <MoveProcessDialog />
-                    <MoveProjectDialog />
-                    <MultipleFilesRemoveDialog />
-                    <PartialCopyCollectionDialog />
-                    <ProcessCommandDialog />
-                    <RenameFileDialog />
-                    <Snackbar />
-                    <UpdateCollectionDialog />
-                    <UpdateProcessDialog />
-                    <UpdateProjectDialog />
-                </>;
-            }
-
-            onSearch = (searchText: string) => {
-                this.setState({ searchText });
-                this.props.dispatch(push(`/search?q=${searchText}`));
-            }
-
-            toggleDetailsPanel = () => {
-                this.props.dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
-            }
-
-        }
-    )
-);
+                    <Grid container item xs component="main" direction="column" className={classes.contentWrapper}>
+                        <Grid item>
+                            <MainContentBar />
+                        </Grid>
+                        <Grid item xs className={classes.content}>
+                            <Switch>
+                                <Route path={Routes.PROJECTS} component={ProjectPanel} />
+                                <Route path={Routes.COLLECTIONS} component={CollectionPanel} />
+                                <Route path={Routes.FAVORITES} component={FavoritePanel} />
+                                <Route path={Routes.PROCESSES} component={ProcessPanel} />
+                                <Route path={Routes.TRASH} component={TrashPanel} />
+                                <Route path={Routes.PROCESS_LOGS} component={ProcessLogPanel} />
+                                <Route path={Routes.SHARED_WITH_ME} component={SharedWithMePanel} />
+                                <Route path={Routes.WORKFLOWS} component={WorkflowPanel} />
+                            </Switch>
+                        </Grid>
+                    </Grid>
+                </SplitterLayout>
+            </Grid>
+            <Grid item>
+                <DetailsPanel />
+            </Grid>
+            <ContextMenu />
+            <CopyCollectionDialog />
+            <CopyProcessDialog />
+            <CreateCollectionDialog />
+            <CreateProjectDialog />
+            <CurrentTokenDialog />
+            <FileRemoveDialog />
+            <FileRemoveDialog />
+            <FilesUploadCollectionDialog />
+            <MoveCollectionDialog />
+            <MoveProcessDialog />
+            <MoveProjectDialog />
+            <MultipleFilesRemoveDialog />
+            <PartialCopyCollectionDialog />
+            <ProcessCommandDialog />
+            <RenameFileDialog />
+            <Snackbar />
+            <UpdateCollectionDialog />
+            <UpdateProcessDialog />
+            <UpdateProjectDialog />
+        </Grid>
+    );
index 7aa26e6a12efbf3bbbc1bdb16c46b928bebebcd4..e2b0f295e8e4ba5cd99a29ded6d8dc48c2b39943 100644 (file)
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from 'react';
-import { StyleRulesCallback, WithStyles, withStyles, Card, CardHeader, Typography } from '@material-ui/core';
+import { StyleRulesCallback, WithStyles, withStyles, Card, CardHeader, Typography, CardContent } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
 import { WorkflowIcon } from '~/components/icon/icon';
 import { DataTableDefaultView } from '~/components/data-table-default-view/data-table-default-view';
@@ -28,8 +28,10 @@ export const WorkflowDescriptionCard = withStyles(styles)(
                 title={<Typography noWrap variant="body2">
                     Workflow description:
                 </Typography>} />
-            <DataTableDefaultView
-                icon={WorkflowIcon}
-                messages={['Please select a workflow to see its description.']} />
+            <CardContent>
+                <DataTableDefaultView
+                    icon={WorkflowIcon}
+                    messages={['Please select a workflow to see its description.']} />
+            </CardContent>
         </Card>;
     });
\ No newline at end of file
index ef0b5fbb6e4f2d1ef6ae1eaa335a953626dea30f..92bbcad65a1159a088a58d03614e8e2979cc2d52 100644 (file)
@@ -82,6 +82,7 @@ export const workflowPanelColumns: DataColumns<string, DataTableFilterItem> = [
                 selected: true,
             }
         ],
+        // do zmiany na ResourceAuthorisation
         render: (uuid: string) => <ResourceName uuid={uuid} />,
     },
     {
@@ -101,8 +102,8 @@ export const WorkflowPanel = connect((state: RootState) => ({
 }))(
     class extends React.Component<WorkflowPanelProps> {
         render() {
-            return <Grid container>
-                <Grid item xs={6} style={{ paddingRight: '24px', display: 'grid' }}>
+            return <Grid container spacing={16}>
+                <Grid item xs={6}>
                     <DataExplorer
                         id={WORKFLOW_PANEL_ID}
                         onRowClick={this.handleRowClick}