X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f22d9424ca3321c01e3a9b27ed5905b80eee35f5..a34ed98858d0a43904715e62a09d6de118073701:/src/views/login-panel/login-panel.tsx diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx index 6a9210acad..cca4027ddb 100644 --- a/src/views/login-panel/login-panel.tsx +++ b/src/views/login-panel/login-panel.tsx @@ -4,10 +4,11 @@ import * as React from 'react'; import { connect, DispatchProp } from 'react-redux'; -import { Grid, Typography, Button } from '@material-ui/core'; +import { Grid, Typography, Button, Select } from '@material-ui/core'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; -import { login } from '~/store/auth/auth-action'; +import { login, authActions } from '~/store/auth/auth-action'; import { ArvadosTheme } from '~/common/custom-theme'; +import { RootState } from '~/store/store'; import * as classNames from 'classnames'; type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button'; @@ -48,33 +49,58 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ } }); -type LoginPanelProps = DispatchProp & WithStyles; +type LoginPanelProps = DispatchProp & WithStyles & { + remoteHosts: { [key: string]: string }, + homeCluster: string, + uuidPrefix: string, + loginCluster: string +}; -export const LoginPanel = withStyles(styles)(connect()( - ({ classes, dispatch }: LoginPanelProps) => - - - - Welcome to the Arvados Workbench - - - 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. - - - If you have never used Arvados Workbench before, logging in for the first time will automatically create a new account. - - - IMPORTANT: Please keep in mind to store exploratory data only but not any information used for clinical decision making. - - - Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google. - - - - - - -)); +export const LoginPanel = withStyles(styles)( + connect((state: RootState) => ({ + remoteHosts: state.auth.remoteHosts, + homeCluster: state.auth.homeCluster, + uuidPrefix: state.auth.localCluster, + loginCluster: state.auth.loginCluster + }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix, loginCluster }: LoginPanelProps) => + + + + Welcome to the Arvados Workbench + + + 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. + + + If you have never used Arvados Workbench before, logging in for the first time will automatically create a new account. + + + IMPORTANT: Please keep in mind to store exploratory data only but not any information used for clinical decision making. + + + Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google. + + + {Object.keys(remoteHosts).length > 1 && loginCluster === "" && + + + + } + + + + + + + ));