X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/25216cc7acedc987c26a159f0b640210c0ef101e..5b30fab0552f623a35ff5b89b90dab82dfcee258:/src/views/inactive-panel/inactive-panel.tsx diff --git a/src/views/inactive-panel/inactive-panel.tsx b/src/views/inactive-panel/inactive-panel.tsx index dc6846a23f..be76570697 100644 --- a/src/views/inactive-panel/inactive-panel.tsx +++ b/src/views/inactive-panel/inactive-panel.tsx @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import { Dispatch } from 'redux'; import { connect } from 'react-redux'; import { Grid, Typography, Button } from '@material-ui/core'; @@ -10,23 +10,16 @@ import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/st import { ArvadosTheme } from 'common/custom-theme'; import { navigateToLinkAccount } from 'store/navigation/navigation-action'; import { RootState } from 'store/store'; +import { sanitizeHTML } from 'common/html-sanitize'; -type CssRules = 'root' | 'ontop' | 'title'; +export type CssRules = 'root' | 'ontop' | 'title'; const styles: StyleRulesCallback = (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, - } + background: 'url("arvados-logo-big.png") no-repeat center center', + backgroundBlendMode: 'soft-light', }, ontop: { zIndex: 10 @@ -47,32 +40,44 @@ const mapDispatchToProps = (dispatch: Dispatch): InactivePanelActionProps => ({ } }); +const mapStateToProps = (state: RootState): InactivePanelStateProps => ({ + inactivePageText: state.auth.config.clusterConfig.Workbench.InactivePageHTML, + isLoginClusterFederation: state.auth.config.clusterConfig.Login.LoginCluster !== '', +}); + export interface InactivePanelStateProps { inactivePageText: string; + isLoginClusterFederation: boolean; } type InactivePanelProps = WithStyles & InactivePanelActionProps & InactivePanelStateProps; -export const InactivePanel = connect((state: RootState) => ({ - inactivePageText: state.auth.config.clusterConfig.Workbench.InactivePageHTML -}), mapDispatchToProps)(withStyles(styles)((({ classes, startLinking, inactivePageText }: InactivePanelProps) => +export const InactivePanelRoot = ({ classes, startLinking, inactivePageText, isLoginClusterFederation }: InactivePanelProps) => -
+ - + { !isLoginClusterFederation + ? <> - If you would like to use this login to access another account click "Link Account". - + If you would like to use this login to access another account click "Link Account". + - - -))); + + + : <> + + If you would like to use this login to access another account, please contact your administrator. + + } + ; + +export const InactivePanel = connect(mapStateToProps, mapDispatchToProps)( + withStyles(styles)(InactivePanelRoot));