[ARVADOS-WORKBENCH2] created: 1.2.0-421-ge02a51f

Git user git at public.curoverse.com
Thu Sep 20 06:13:07 EDT 2018


        at  e02a51f2799aaab5cdd0194dc9363e31592d4209 (commit)


commit e02a51f2799aaab5cdd0194dc9363e31592d4209
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Thu Sep 20 12:12:49 2018 +0200

    init login panel and main panel, change workbench
    
    Feature #13935
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/index.tsx b/src/index.tsx
index 020f548..f456c99 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -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>
diff --git a/src/views-components/main-app-bar/main-app-bar.tsx b/src/views-components/main-app-bar/main-app-bar.tsx
index 93cf496..1072a56 100644
--- a/src/views-components/main-app-bar/main-app-bar.tsx
+++ b/src/views-components/main-app-bar/main-app-bar.tsx
@@ -78,7 +78,7 @@ export const MainAppBar = withStyles(styles)(
                                 <AccountMenu />
                                 <HelpMenu />
                             </>
-                            : <AnonymousMenu />}
+                            : <HelpMenu />}
                     </Grid>
                 </Grid>
             </Toolbar>
diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx
new file mode 100644
index 0000000..2521e14
--- /dev/null
+++ b/src/views/login-panel/login-panel.tsx
@@ -0,0 +1,72 @@
+// 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: {
+        background: theme.palette.background.default
+    },
+    container: {
+        width: '560px'
+    },
+    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
index 0000000..22455c3
--- /dev/null
+++ b/src/views/main-panel/main-panel.tsx
@@ -0,0 +1,78 @@
+// 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 { isSystemWorking } from '~/store/progress-indicator/progress-indicator-reducer';
+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';
+
+type CssRules = 'root';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+    root: {
+        overflow: 'hidden',
+        width: '100vw',
+        height: '100vh'
+    }
+});
+
+interface MainPanelDataProps {
+    user?: User;
+    working: 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)
+        })
+    )(
+        class extends React.Component<MainPanelProps, MainPanelState> {
+            state = {
+                searchText: "",
+            };
+
+            render() {
+                const { classes, user, buildInfo, working } = this.props;
+                const { searchText } = this.state;
+                return <>
+                    <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.test.tsx b/src/views/workbench/workbench.test.tsx
index d03e117..14ca694 100644
--- a/src/views/workbench/workbench.test.tsx
+++ b/src/views/workbench/workbench.test.tsx
@@ -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>,
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index ad1a266..78918be 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -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,20 +34,17 @@ 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";
 
-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'
@@ -65,127 +55,71 @@ 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} />
-                                                </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} />
+                            </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>
+    );

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list