[ARVADOS-WORKBENCH2] created: 1.4.1-49-gbadcb86f
Git user
git at public.curoverse.com
Thu Oct 10 15:08:55 UTC 2019
at badcb86fb7d0e2ab87c7dcef230072db2e2ae95e (commit)
commit badcb86fb7d0e2ab87c7dcef230072db2e2ae95e
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Oct 10 11:07:56 2019 -0400
15424: Incorporate contents of WelcomePageHTML in login panel
diff --git a/src/common/config.ts b/src/common/config.ts
index 496b0b78..1f668292 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -44,6 +44,7 @@ export interface ClusterConfigJSON {
ArvadosDocsite: string;
VocabularyURL: string;
FileViewersConfigURL: string;
+ WelcomePageHTML: string;
};
}
@@ -60,6 +61,7 @@ export class Config {
workbench2Url: string;
vocabularyUrl: string;
fileViewersConfigUrl: string;
+ clusterConfig: ClusterConfigJSON;
}
export const fetchConfig = () => {
@@ -111,6 +113,7 @@ remove the entire ${varName} entry from ${WORKBENCH_CONFIG_URL}`);
config.workbench2Url = clusterConfigJSON.Services.Workbench2.ExternalURL;
config.workbenchUrl = clusterConfigJSON.Services.Workbench1.ExternalURL;
config.keepWebServiceUrl = clusterConfigJSON.Services.WebDAV.ExternalURL;
+ config.clusterConfig = clusterConfigJSON;
mapRemoteHosts(clusterConfigJSON, config);
return { config, apiHost: workbenchConfig.API_HOST };
@@ -125,6 +128,25 @@ export const mapRemoteHosts = (clusterConfigJSON: ClusterConfigJSON, config: Con
delete config.remoteHosts["*"];
};
+export const mockClusterConfigJSON = (config: Partial<ClusterConfigJSON>): ClusterConfigJSON => ({
+ ClusterID: "",
+ RemoteClusters: {},
+ Services: {
+ Controller: { ExternalURL: "" },
+ Workbench1: { ExternalURL: "" },
+ Workbench2: { ExternalURL: "" },
+ Websocket: { ExternalURL: "" },
+ WebDAV: { ExternalURL: "" },
+ },
+ Workbench: {
+ ArvadosDocsite: "",
+ VocabularyURL: "",
+ FileViewersConfigURL: "",
+ WelcomePageHTML: "",
+ },
+ ...config
+});
+
export const mockConfig = (config: Partial<Config>): Config => ({
baseUrl: "",
keepWebServiceUrl: "",
@@ -135,7 +157,9 @@ export const mockConfig = (config: Partial<Config>): Config => ({
workbenchUrl: "",
workbench2Url: "",
vocabularyUrl: "",
- fileViewersConfigUrl: ""
+ fileViewersConfigUrl: "",
+ clusterConfig: mockClusterConfigJSON({}),
+ ...config
});
const getDefaultConfig = (): WorkbenchConfig => {
@@ -157,4 +181,4 @@ const getDefaultConfig = (): WorkbenchConfig => {
export const ARVADOS_API_PATH = "arvados/v1";
export const CLUSTER_CONFIG_URL = "arvados/v1/config";
-export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_URL}?nocache=${(new Date()).getTime()}`;
\ No newline at end of file
+export const getClusterConfigURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${CLUSTER_CONFIG_URL}?nocache=${(new Date()).getTime()}`;
diff --git a/src/views/login-panel/login-panel.tsx b/src/views/login-panel/login-panel.tsx
index debede12..092e5007 100644
--- a/src/views/login-panel/login-panel.tsx
+++ b/src/views/login-panel/login-panel.tsx
@@ -9,7 +9,7 @@ import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/st
import { login, authActions } from '~/store/auth/auth-action';
import { ArvadosTheme } from '~/common/custom-theme';
import { RootState } from '~/store/store';
-import * as classNames from 'classnames';
+// import * as classNames from 'classnames';
type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button';
@@ -24,7 +24,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
left: 0,
bottom: 0,
right: 0,
- background: 'url("arvados-logo-big.png") no-repeat center center',
+ // background: 'url("arvados-logo-big.png") no-repeat center center',
opacity: 0.2,
}
},
@@ -52,36 +52,24 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules> & {
remoteHosts: { [key: string]: string },
homeCluster: string,
- uuidPrefix: string
+ uuidPrefix: string,
+ welcomePage: string
};
export const LoginPanel = withStyles(styles)(
connect((state: RootState) => ({
remoteHosts: state.auth.remoteHosts,
homeCluster: state.auth.homeCluster,
- uuidPrefix: state.auth.localCluster
- }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix }: LoginPanelProps) =>
+ uuidPrefix: state.auth.localCluster,
+ welcomePage: state.config.clusterConfig.Workbench.WelcomePageHTML
+ }))(({ classes, dispatch, remoteHosts, homeCluster, uuidPrefix, welcomePage }: LoginPanelProps) =>
<Grid container justify="center" alignItems="center"
className={classes.root}
style={{ marginTop: 56, overflowY: "auto", height: "100%" }}>
<Grid item className={classes.container}>
- <Typography variant='h6' align="center" className={classes.title}>
- Welcome to the Arvados Workbench
- </Typography>
- <Typography className={classes.content}>
- 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.
- </Typography>
- <Typography className={classes.content}>
- If you have never used Arvados Workbench before, logging in for the first time will automatically create a new account.
- </Typography>
- <Typography variant='body1' className={classNames(classes.content, classes.content__bolder)}>
- IMPORTANT: Please keep in mind to store exploratory data only but not any information used for clinical decision making.
- </Typography>
- <Typography className={classes.content}>
- Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google.
- </Typography>
-
+ <Typography>
+ <div dangerouslySetInnerHTML={{ __html: welcomePage }} />
+ </Typography>
{Object.keys(remoteHosts).length > 1 &&
<Typography component="div" align="right">
<label>Please select the cluster that hosts your user account:</label>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list