From: Janicki Artur Date: Thu, 20 Sep 2018 12:09:18 +0000 (+0200) Subject: Merge branch 'master' into 13935-login-page-and-main-panel X-Git-Tag: 1.3.0~83^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/da9179a2e43be0cb19910ef689cd922457f84744 Merge branch 'master' into 13935-login-page-and-main-panel refs #13935 Arvados-DCO-1.1-Signed-off-by: Janicki Artur --- da9179a2e43be0cb19910ef689cd922457f84744 diff --cc src/views/main-panel/main-panel.tsx index 22455c3c,00000000..297a6214 mode 100644,000000..100644 --- a/src/views/main-panel/main-panel.tsx +++ b/src/views/main-panel/main-panel.tsx @@@ -1,78 -1,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 { 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'; ++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 = (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 & WithStyles; + +export const MainPanel = withStyles(styles)( + connect( + (state: RootState) => ({ + user: state.auth.user, - working: isSystemWorking(state.progressIndicator) ++ working: isSystemWorking(state.progressIndicator), ++ loading: isWorkbenchLoading(state) + }) + )( + class extends React.Component { + state = { + searchText: "", + }; + + render() { - const { classes, user, buildInfo, working } = this.props; ++ const { classes, user, buildInfo, working, loading } = this.props; + const { searchText } = this.state; - return <> - - {working ? : null} - - - {user ? : } - - ; ++ return loading ++ ? ++ : <> ++ ++ {working ? : null} ++ ++ ++ {user ? : } ++ ++ ; + } + + onSearch = (searchText: string) => { + this.setState({ searchText }); + this.props.dispatch(push(`/search?q=${searchText}`)); + } + } + ) +);