[ARVADOS-WORKBENCH2] created: 1.3.0-78-g2805a87
Git user
git at public.curoverse.com
Mon Dec 10 06:56:07 EST 2018
at 2805a871de97f42abb8b729ae3f683f4e6b315b8 (commit)
commit 2805a871de97f42abb8b729ae3f683f4e6b315b8
Merge: 078cf7f ad52089
Author: Pawel Kromplewski <pawel.kromplewski at contractors.roche.com>
Date: Mon Dec 10 12:55:54 2018 +0100
Merge branch 'master' into 13936-template-for-first-login-dialog
refs #13936
Arvados-DCO-1.1-Signed-off-by: Pawel Kromplewski <pawel.kromplewski at contractors.roche.com>
diff --cc src/common/config.ts
index b3aa309,b7b89bd..9d5a251
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@@ -49,15 -49,9 +49,16 @@@ export interface Config
version: string;
websocketUrl: string;
workbenchUrl: string;
+ vocabularyUrl: string;
}
+export const fetchFirstLoginTemplate = ({ config, apiHost }: any) => {
+ return Axios
+ .get<any>('https://localhost:3000/test.html')
+ .then(response => ({ config, apiHost, firstLoginTemplate: response.data }))
+ .catch(() => ({ config, apiHost, firstLoginTemplate: null }));
+};
+
export const fetchConfig = () => {
return Axios
.get<ConfigJSON>(CONFIG_URL + "?nocache=" + (new Date()).getTime())
diff --cc src/index.tsx
index 2a8392b,8f702af..2f7f9e9
--- a/src/index.tsx
+++ b/src/index.tsx
@@@ -10,26 -10,26 +10,26 @@@ import '~/index.css'
import { Route, Switch } from 'react-router';
import createBrowserHistory from "history/createBrowserHistory";
import { History } from "history";
- import { configureStore, RootStore } from './store/store';
+ import { configureStore, RootStore } from '~/store/store';
import { ConnectedRouter } from "react-router-redux";
- import { ApiToken } from "./views-components/api-token/api-token";
- import { initAuth } from "./store/auth/auth-action";
- import { createServices } from "./services/services";
+ import { ApiToken } from "~/views-components/api-token/api-token";
+ import { initAuth } from "~/store/auth/auth-action";
+ import { createServices } from "~/services/services";
import { MuiThemeProvider } from '@material-ui/core/styles';
- import { CustomTheme } from './common/custom-theme';
- import {fetchConfig, fetchFirstLoginTemplate} from './common/config';
- import { addMenuActionSet, ContextMenuKind } from './views-components/context-menu/context-menu';
- import { rootProjectActionSet } from "./views-components/context-menu/action-sets/root-project-action-set";
- import { projectActionSet } from "./views-components/context-menu/action-sets/project-action-set";
- import { resourceActionSet } from './views-components/context-menu/action-sets/resource-action-set';
- import { favoriteActionSet } from "./views-components/context-menu/action-sets/favorite-action-set";
- import { collectionFilesActionSet } from './views-components/context-menu/action-sets/collection-files-action-set';
- import { collectionFilesItemActionSet } from './views-components/context-menu/action-sets/collection-files-item-action-set';
- import { collectionFilesNotSelectedActionSet } from './views-components/context-menu/action-sets/collection-files-not-selected-action-set';
- import { collectionActionSet } from './views-components/context-menu/action-sets/collection-action-set';
- import { collectionResourceActionSet } from './views-components/context-menu/action-sets/collection-resource-action-set';
- import { processActionSet } from './views-components/context-menu/action-sets/process-action-set';
- import { loadWorkbench } from './store/workbench/workbench-actions';
+ import { CustomTheme } from '~/common/custom-theme';
-import { fetchConfig } from '~/common/config';
++import {fetchConfig, fetchFirstLoginTemplate} from '~/common/config';
+ import { addMenuActionSet, ContextMenuKind } from '~/views-components/context-menu/context-menu';
+ import { rootProjectActionSet } from "~/views-components/context-menu/action-sets/root-project-action-set";
+ import { projectActionSet } from "~/views-components/context-menu/action-sets/project-action-set";
+ import { resourceActionSet } from '~/views-components/context-menu/action-sets/resource-action-set';
+ import { favoriteActionSet } from "~/views-components/context-menu/action-sets/favorite-action-set";
+ import { collectionFilesActionSet } from '~/views-components/context-menu/action-sets/collection-files-action-set';
+ import { collectionFilesItemActionSet } from '~/views-components/context-menu/action-sets/collection-files-item-action-set';
+ import { collectionFilesNotSelectedActionSet } from '~/views-components/context-menu/action-sets/collection-files-not-selected-action-set';
+ import { collectionActionSet } from '~/views-components/context-menu/action-sets/collection-action-set';
+ import { collectionResourceActionSet } from '~/views-components/context-menu/action-sets/collection-resource-action-set';
+ import { processActionSet } from '~/views-components/context-menu/action-sets/process-action-set';
+ import { loadWorkbench } from '~/store/workbench/workbench-actions';
import { Routes } from '~/routes/routes';
import { trashActionSet } from "~/views-components/context-menu/action-sets/trash-action-set";
import { ServiceRepository } from '~/services/services';
@@@ -48,7 -48,14 +48,15 @@@ import { getBuildInfo } from '~/common/
import { DragDropContextProvider } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import { initAdvanceFormProjectsTree } from '~/store/search-bar/search-bar-actions';
+ import { repositoryActionSet } from '~/views-components/context-menu/action-sets/repository-action-set';
+ import { sshKeyActionSet } from '~/views-components/context-menu/action-sets/ssh-key-action-set';
+ import { keepServiceActionSet } from '~/views-components/context-menu/action-sets/keep-service-action-set';
+ import { loadVocabulary } from '~/store/vocabulary/vocabulary-actions';
+ import { virtualMachineActionSet } from '~/views-components/context-menu/action-sets/virtual-machine-action-set';
+ import { userActionSet } from '~/views-components/context-menu/action-sets/user-action-set';
+ import { computeNodeActionSet } from '~/views-components/context-menu/action-sets/compute-node-action-set';
+ import { apiClientAuthorizationActionSet } from '~/views-components/context-menu/action-sets/api-client-authorization-action-set';
+import { FirstLoginDialog } from "~/views-components/first-login-dialog/first-login-dialog";
console.log(`Starting arvados [${getBuildInfo()}]`);
@@@ -65,11 -72,16 +73,18 @@@ addMenuActionSet(ContextMenuKind.TRASHE
addMenuActionSet(ContextMenuKind.PROCESS, processActionSet);
addMenuActionSet(ContextMenuKind.PROCESS_RESOURCE, processResourceActionSet);
addMenuActionSet(ContextMenuKind.TRASH, trashActionSet);
+ addMenuActionSet(ContextMenuKind.REPOSITORY, repositoryActionSet);
+ addMenuActionSet(ContextMenuKind.SSH_KEY, sshKeyActionSet);
+ addMenuActionSet(ContextMenuKind.VIRTUAL_MACHINE, virtualMachineActionSet);
+ addMenuActionSet(ContextMenuKind.KEEP_SERVICE, keepServiceActionSet);
+ addMenuActionSet(ContextMenuKind.USER, userActionSet);
+ addMenuActionSet(ContextMenuKind.NODE, computeNodeActionSet);
+ addMenuActionSet(ContextMenuKind.API_CLIENT_AUTHORIZATION, apiClientAuthorizationActionSet);
fetchConfig()
- .then(({ config, apiHost }) => {
+ .then(fetchFirstLoginTemplate)
+ .then(({ config, apiHost, firstLoginTemplate }) => {
+ console.log(firstLoginTemplate);
const history = createBrowserHistory();
const services = createServices(config, {
progressFn: (id, working) => {
@@@ -87,13 -99,10 +102,14 @@@
store.dispatch(setBuildInfo());
store.dispatch(setCurrentTokenDialogApiHost(apiHost));
store.dispatch(setUuidPrefix(config.uuidPrefix));
+ store.dispatch(loadVocabulary);
+ // TODO: change to proper property
+ const userFirstLogin = true;
+
const TokenComponent = (props: any) => <ApiToken authService={services.authService} {...props} />;
- const MainPanelComponent = (props: any) => <MainPanel {...props} />;
+ const MainPanelComponent = (props: any) =>
+ userFirstLogin ? <FirstLoginDialog customHTML={firstLoginTemplate} /> : <MainPanel {...props} />;
const App = () =>
<MuiThemeProvider theme={CustomTheme}>
commit 078cf7fac6352eb765746b7dfcd4014dcf1cf1e8
Author: Pawel Kromplewski <pawel.kromplewski at contractors.roche.com>
Date: Mon Nov 26 09:44:30 2018 +0100
Use test html template
Feature #13936
Arvados-DCO-1.1-Signed-off-by: Pawel Kromplewski <pawel.kromplewski at contractors.roche.com>
diff --git a/public/test.html b/public/test.html
new file mode 100644
index 0000000..bc1c5aa
--- /dev/null
+++ b/public/test.html
@@ -0,0 +1 @@
+<div>Test HTML</div>
\ No newline at end of file
diff --git a/src/common/config.ts b/src/common/config.ts
index 1ab7329..b3aa309 100644
--- a/src/common/config.ts
+++ b/src/common/config.ts
@@ -51,6 +51,13 @@ export interface Config {
workbenchUrl: string;
}
+export const fetchFirstLoginTemplate = ({ config, apiHost }: any) => {
+ return Axios
+ .get<any>('https://localhost:3000/test.html')
+ .then(response => ({ config, apiHost, firstLoginTemplate: response.data }))
+ .catch(() => ({ config, apiHost, firstLoginTemplate: null }));
+};
+
export const fetchConfig = () => {
return Axios
.get<ConfigJSON>(CONFIG_URL + "?nocache=" + (new Date()).getTime())
diff --git a/src/index.tsx b/src/index.tsx
index efe3a57..2a8392b 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -17,7 +17,7 @@ import { initAuth } from "./store/auth/auth-action";
import { createServices } from "./services/services";
import { MuiThemeProvider } from '@material-ui/core/styles';
import { CustomTheme } from './common/custom-theme';
-import { fetchConfig } from './common/config';
+import {fetchConfig, fetchFirstLoginTemplate} from './common/config';
import { addMenuActionSet, ContextMenuKind } from './views-components/context-menu/context-menu';
import { rootProjectActionSet } from "./views-components/context-menu/action-sets/root-project-action-set";
import { projectActionSet } from "./views-components/context-menu/action-sets/project-action-set";
@@ -48,6 +48,7 @@ import { getBuildInfo } from '~/common/app-info';
import { DragDropContextProvider } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import { initAdvanceFormProjectsTree } from '~/store/search-bar/search-bar-actions';
+import { FirstLoginDialog } from "~/views-components/first-login-dialog/first-login-dialog";
console.log(`Starting arvados [${getBuildInfo()}]`);
@@ -66,7 +67,9 @@ addMenuActionSet(ContextMenuKind.PROCESS_RESOURCE, processResourceActionSet);
addMenuActionSet(ContextMenuKind.TRASH, trashActionSet);
fetchConfig()
- .then(({ config, apiHost }) => {
+ .then(fetchFirstLoginTemplate)
+ .then(({ config, apiHost, firstLoginTemplate }) => {
+ console.log(firstLoginTemplate);
const history = createBrowserHistory();
const services = createServices(config, {
progressFn: (id, working) => {
@@ -85,8 +88,12 @@ fetchConfig()
store.dispatch(setCurrentTokenDialogApiHost(apiHost));
store.dispatch(setUuidPrefix(config.uuidPrefix));
+ // TODO: change to proper property
+ const userFirstLogin = true;
+
const TokenComponent = (props: any) => <ApiToken authService={services.authService} {...props} />;
- const MainPanelComponent = (props: any) => <MainPanel {...props} />;
+ const MainPanelComponent = (props: any) =>
+ userFirstLogin ? <FirstLoginDialog customHTML={firstLoginTemplate} /> : <MainPanel {...props} />;
const App = () =>
<MuiThemeProvider theme={CustomTheme}>
diff --git a/src/views/main-panel/main-panel-root.tsx b/src/views/main-panel/main-panel-root.tsx
index cc06633..2395fea 100644
--- a/src/views/main-panel/main-panel-root.tsx
+++ b/src/views/main-panel/main-panel-root.tsx
@@ -36,9 +36,6 @@ export const MainPanelRoot = withStyles(styles)(
if (loading) {
return <WorkbenchLoadingScreen />;
}
- if (1) {
- return <FirstLoginDialog />;
- }
return (
<>
<MainAppBar
commit 0f387f465f4ac891d928d99e483f7d1da698c663
Author: Pawel Kromplewski <pawel.kromplewski at contractors.roche.com>
Date: Tue Nov 20 13:10:41 2018 +0100
Template for first login dialog
Feature #13936
Arvados-DCO-1.1-Signed-off-by: Pawel Kromplewski <pawel.kromplewski at contractors.roche.com>
diff --git a/src/views-components/first-login-dialog/first-login-dialog.tsx b/src/views-components/first-login-dialog/first-login-dialog.tsx
new file mode 100644
index 0000000..14d1962
--- /dev/null
+++ b/src/views-components/first-login-dialog/first-login-dialog.tsx
@@ -0,0 +1,87 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import Paper from '@material-ui/core/Paper';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { Button, Grid, Typography } from '@material-ui/core';
+import { connect, DispatchProp } from "react-redux";
+
+type CssRules = 'root' | 'center' | 'title' | 'subtitle' | 'button' | 'container';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ root: {
+ ...theme.mixins.gutters(),
+ paddingTop: theme.spacing.unit * 2,
+ paddingBottom: theme.spacing.unit * 2,
+ marginTop: 200,
+ width: 500
+ },
+ center: {
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center'
+ },
+ container: {
+ display: 'flex',
+ flexFlow: 'column'
+ },
+ title: {
+ marginBottom: theme.spacing.unit * 2,
+ color: theme.palette.grey["800"]
+ },
+ subtitle: {
+ fontWeight: 600,
+ marginBottom: theme.spacing.unit * 2,
+ },
+ button: {
+ alignSelf: 'flex-end',
+ marginTop: theme.spacing.unit
+ }
+});
+
+interface FirstLoginDialogData {
+ customHTML?: string;
+}
+
+type FirstLoginDialogProps = FirstLoginDialogData & DispatchProp<any> & WithStyles<CssRules>;
+
+const createMarkup = (customHTML: any) => ({
+ __html: customHTML
+});
+
+export const FirstLoginDialog = withStyles(styles)(connect()(
+ ({ classes, customHTML, dispatch }: FirstLoginDialogProps) =>
+ customHTML ?
+ <div dangerouslySetInnerHTML={createMarkup(customHTML)} /> :
+ <div className={classes.center}>
+ <Paper className={classes.root} elevation={1}>
+ <Grid container direction="column" item xs justify="center">
+ <Grid item className={classes.container}>
+ <Typography variant="title" className={classes.title}>
+ Arvados - Steps for Registration
+ </Typography>
+ <Typography variant="body1" className={classes.subtitle}>
+ Please follow this step stated below in order to register for Arvados.
+ </Typography>
+ <Typography>
+ 1. Complete the Arvados User Training. <a href="#">Click here to go to the training</a><br />
+ 2. After the completion, please send an email with your training certificate
+ to <a href="#">glomgn_arvadosadmin at msxdl.roche.com</a> to request the activation of your account.<br />
+ 3. After the activation, you can login into Arvados with your Roche email and password.
+ </Typography>
+ <Button
+ className={classes.button}
+ variant="contained"
+ color="primary"
+ size="small"
+ >
+ Refresh
+ </Button>
+ </Grid>
+ </Grid>
+ </Paper>
+ </div>
+));
\ No newline at end of file
diff --git a/src/views/main-panel/main-panel-root.tsx b/src/views/main-panel/main-panel-root.tsx
index 15149dc..cc06633 100644
--- a/src/views/main-panel/main-panel-root.tsx
+++ b/src/views/main-panel/main-panel-root.tsx
@@ -10,6 +10,7 @@ import { WorkbenchPanel } from '~/views/workbench/workbench';
import { LoginPanel } from '~/views/login-panel/login-panel';
import { WorkbenchLoadingScreen } from '~/views/workbench/workbench-loading-screen';
import { MainAppBar } from '~/views-components/main-app-bar/main-app-bar';
+import { FirstLoginDialog } from "~/views-components/first-login-dialog/first-login-dialog";
type CssRules = 'root';
@@ -31,10 +32,15 @@ export interface MainPanelRootDataProps {
type MainPanelRootProps = MainPanelRootDataProps & WithStyles<CssRules>;
export const MainPanelRoot = withStyles(styles)(
- ({ classes, loading, working, user, buildInfo }: MainPanelRootProps) =>
- loading
- ? <WorkbenchLoadingScreen />
- : <>
+ ({ classes, loading, working, user, buildInfo }: MainPanelRootProps) => {
+ if (loading) {
+ return <WorkbenchLoadingScreen />;
+ }
+ if (1) {
+ return <FirstLoginDialog />;
+ }
+ return (
+ <>
<MainAppBar
user={user}
buildInfo={buildInfo}>
@@ -44,4 +50,5 @@ export const MainPanelRoot = withStyles(styles)(
{user ? <WorkbenchPanel /> : <LoginPanel />}
</Grid>
</>
-);
\ No newline at end of file
+ );
+ });
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list