VocabularyURL: string;
FileViewersConfigURL: string;
WelcomePageHTML: string;
+ InactivePageHTML: string;
+ SiteName: string;
};
Login: {
LoginCluster: string;
VocabularyURL: "",
FileViewersConfigURL: "",
WelcomePageHTML: "",
+ InactivePageHTML: "",
+ SiteName: "",
},
Login: {
LoginCluster: "",
buildInfo?: string;
children?: ReactNode;
uuidPrefix: string;
+ siteBanner: string;
}
export type MainAppBarProps = MainAppBarDataProps & WithStyles<CssRules>;
<Grid container item xs={3} direction="column" justify="center">
<Typography variant='h6' color="inherit" noWrap>
<Link to={Routes.ROOT} className={props.classes.link}>
- arvados workbench ({props.uuidPrefix})
+ <span dangerouslySetInnerHTML={{ __html: props.siteBanner }} /> ({props.uuidPrefix})
</Link>
</Typography>
<Typography variant="caption" color="inherit">{props.buildInfo}</Typography>
import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
import { ArvadosTheme } from '~/common/custom-theme';
import { navigateToLinkAccount } from '~/store/navigation/navigation-action';
-
+import { RootState } from '~/store/store';
type CssRules = 'root' | 'ontop' | 'title';
}
});
-type InactivePanelProps = WithStyles<CssRules> & InactivePanelActionProps;
+export interface InactivePanelStateProps {
+ inactivePageText: string;
+}
+
+type InactivePanelProps = WithStyles<CssRules> & InactivePanelActionProps & InactivePanelStateProps;
-export const InactivePanel = connect(null, mapDispatchToProps)(withStyles(styles)((({ classes, startLinking }: InactivePanelProps) =>
- <Grid container justify="center" alignItems="center" direction="column" spacing={24}
- className={classes.root}
- style={{ marginTop: 56, height: "100%" }}>
- <Grid item>
- <Typography variant='h6' align="center" className={classes.title}>
- Hi! You're logged in, but...
- </Typography>
- </Grid>
- <Grid item>
- <Typography align="center">
- Your account is inactive. An administrator must activate your account before you can get any further.
- </Typography>
- </Grid>
- <Grid item>
- <Typography align="center">
- If you would like to use this login to access another account click "Link Account".
- </Typography>
- </Grid>
- <Grid item>
- <Button className={classes.ontop} color="primary" variant="contained" onClick={() => startLinking()}>
- Link Account
- </Button>
- </Grid>
- </Grid >
- )));
+export const InactivePanel = connect((state: RootState) => ({
+ inactivePageText: state.config.clusterConfig.Workbench.InactivePageHTML
+}), mapDispatchToProps)(withStyles(styles)((({ classes, startLinking, inactivePageText }: InactivePanelProps) =>
+ <Grid container justify="center" alignItems="center" direction="column" spacing={24}
+ className={classes.root}
+ style={{ marginTop: 56, height: "100%" }}>
+ <Grid item>
+ <Typography>
+ <div dangerouslySetInnerHTML={{ __html: inactivePageText }} style={{ margin: "1em" }} />
+ </Typography>
+ </Grid>
+ <Grid item>
+ <Typography align="center">
+ If you would like to use this login to access another account click "Link Account".
+ </Typography>
+ </Grid>
+ <Grid item>
+ <Button className={classes.ontop} color="primary" variant="contained" onClick={() => startLinking()}>
+ Link Account
+ </Button>
+ </Grid>
+ </Grid >
+)));
uuidPrefix: string;
isNotLinking: boolean;
isLinkingPath: boolean;
+ siteBanner: string;
}
type MainPanelRootProps = MainPanelRootDataProps & WithStyles<CssRules>;
export const MainPanelRoot = withStyles(styles)(
- ({ classes, loading, working, user, buildInfo, uuidPrefix, isNotLinking, isLinkingPath }: MainPanelRootProps) =>
+ ({ classes, loading, working, user, buildInfo, uuidPrefix,
+ isNotLinking, isLinkingPath, siteBanner }: MainPanelRootProps) =>
loading
? <WorkbenchLoadingScreen />
: <>
- { isNotLinking && <MainAppBar
+ {isNotLinking && <MainAppBar
user={user}
buildInfo={buildInfo}
- uuidPrefix={uuidPrefix}>
+ uuidPrefix={uuidPrefix}
+ siteBanner={siteBanner}>
{working ? <LinearProgress color="secondary" /> : null}
- </MainAppBar> }
+ </MainAppBar>}
<Grid container direction="column" className={classes.root}>
- { user ? (user.isActive || (!user.isActive && isLinkingPath) ? <WorkbenchPanel isNotLinking={isNotLinking} isUserActive={user.isActive} /> : <InactivePanel />) : <LoginPanel /> }
+ {user ? (user.isActive || (!user.isActive && isLinkingPath) ? <WorkbenchPanel isNotLinking={isNotLinking} isUserActive={user.isActive} /> : <InactivePanel />) : <LoginPanel />}
</Grid>
</>
);
buildInfo: state.appInfo.buildInfo,
uuidPrefix: state.auth.localCluster,
isNotLinking: state.linkAccountPanel.status === LinkAccountPanelStatus.NONE || state.linkAccountPanel.status === LinkAccountPanelStatus.INITIAL,
- isLinkingPath: state.router.location ? matchLinkAccountRoute(state.router.location.pathname) !== null : false
+ isLinkingPath: state.router.location ? matchLinkAccountRoute(state.router.location.pathname) !== null : false,
+ siteBanner: state.config.clusterConfig.Workbench.SiteName
};
};