X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e42867f560b3c2f4c09cf6a2c07c964c63714141..6e335a900ab99ddc7b7288e00d20a54f6c75ec8f:/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 6d8bbf59..8a7c7928 100644 --- a/src/views/inactive-panel/inactive-panel.tsx +++ b/src/views/inactive-panel/inactive-panel.tsx @@ -11,7 +11,7 @@ import { ArvadosTheme } from 'common/custom-theme'; import { navigateToLinkAccount } from 'store/navigation/navigation-action'; import { RootState } from 'store/store'; -type CssRules = 'root' | 'ontop' | 'title'; +export type CssRules = 'root' | 'ontop' | 'title'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -47,32 +47,45 @@ 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));