X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/2ba76201944d5ad4ef84aaf16c18f5bbb38a8b89..59cc1b248e39a17bbf46449add178d957b167b9a:/src/views/inactive-panel/inactive-panel.tsx?ds=sidebyside diff --git a/src/views/inactive-panel/inactive-panel.tsx b/src/views/inactive-panel/inactive-panel.tsx index abfa1f81..42262deb 100644 --- a/src/views/inactive-panel/inactive-panel.tsx +++ b/src/views/inactive-panel/inactive-panel.tsx @@ -3,15 +3,15 @@ // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; -import { connect, DispatchProp } from 'react-redux'; -import { Grid, Typography, Button, Select } from '@material-ui/core'; +import { Dispatch } from 'redux'; +import { connect } from 'react-redux'; +import { Grid, Typography, Button } from '@material-ui/core'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; -import { login, authActions } from '~/store/auth/auth-action'; import { ArvadosTheme } from '~/common/custom-theme'; +import { navigateToLinkAccount } from '~/store/navigation/navigation-action'; import { RootState } from '~/store/store'; -import * as classNames from 'classnames'; -type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button'; +type CssRules = 'root' | 'ontop' | 'title'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -28,51 +28,51 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ opacity: 0.2, } }, - container: { - width: '560px', + ontop: { 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 & WithStyles & { - remoteHosts: { [key: string]: string }, - homeCluster: string, - uuidPrefix: string -}; +export interface InactivePanelActionProps { + startLinking: () => void; +} + +const mapDispatchToProps = (dispatch: Dispatch): InactivePanelActionProps => ({ + startLinking: () => { + dispatch(navigateToLinkAccount); + } +}); + +export interface InactivePanelStateProps { + inactivePageText: string; +} -export const InactivePanel = withStyles(styles)( - connect((state: RootState) => ({ - remoteHosts: state.auth.remoteHosts, - homeCluster: state.auth.homeCluster, - uuidPrefix: state.auth.localCluster - }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix }: LoginPanelProps) => - - - - Hi! You're logged in, but... - - - Your account is inactive. +type InactivePanelProps = WithStyles & InactivePanelActionProps & InactivePanelStateProps; - An administrator must activate your account before you can get any further. - - - - )); +export const InactivePanel = connect((state: RootState) => ({ + inactivePageText: state.auth.config.clusterConfig.Workbench.InactivePageHTML +}), mapDispatchToProps)(withStyles(styles)((({ classes, startLinking, inactivePageText }: InactivePanelProps) => + + + +
+ + + + + If you would like to use this login to access another account click "Link Account". + + + + + + +)));