Merge pull request #2 from algorithms-anonymous/develop

Develop to Master >> Once accept PR please merge
This commit is contained in:
Uros Radovanovic authored and GitHub committed 2018-11-19 18:19:31 +01:00
commit cde76fe48d
22 files changed
+5354 -4899

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
[ignore]
node_modules
[libs]
flow-typed
[lints]
[options]
module.name_mapper='.*\(.scss\)' -> 'empty/object'
module.name_mapper='.*\(.css\)' -> 'empty/object'
module.name_mapper='^src/\(.*\)$' -> '<PROJECT_ROOT>/src/\1'
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
[strict]
+3 -3
View File
@@ -13,8 +13,8 @@
<link rel="shortcut icon" type="image/png/ico" href="/favicon.ico" />
<script src="https://unpkg.com/apollo-client-browser@1.7.0"></script>
<script type="text/javascript" src="https://develop.advancedalgos.net/Scripts/Require.js"></script>
<script type="text/javascript" src="https://develop.advancedalgos.net/Scripts/AppPreLoader.js"></script>
<script type="text/javascript" src="https://charts-dev.advancedalgos.net/Scripts/require.js"></script>
<script type="text/javascript" src="https://charts-dev.advancedalgos.net/Scripts/AppPreLoader.js"></script>
<script type="text/javascript">
function loadCanvas(){
@@ -25,7 +25,7 @@
executingAt: 'Master App',
visible: false,
topMargin: 130,
urlPrefix: 'https://develop.advancedalgos.net/' , /* 'http://localhost:1337/' */ /* 'https://develop.advancedalgos.net/' */
urlPrefix: 'https://charts-dev.advancedalgos.net/' , /* 'http://localhost:1337/' */ /* 'https://charts-dev.advancedalgos.net/' */
graphQL: {
masterAppApiUrl: 'https://app-api.advancedalgos.net/graphql'
},
+5177 -4820
View File
File diff suppressed because it is too large. Load diff
+14 -6
View File
@@ -8,7 +8,11 @@
"build": "NODE_ENV=production webpack --mode production --config ./webpack.config.js",
"dev_win": "webpack-dev-server --hot --port 3100 --config ./webpack.config.js",
"build_win": "webpack --mode production --config ./webpack.config.js",
"lint": "prettier-standard 'src/**/*.js'"
"lint": "prettier-standard 'src/**/*.js'",
"flow-coverage": "npm run flow-coverage:build && npm run flow-coverage:open",
"flow-coverage:build": "flow-coverage-report --strict-coverage ",
"flow-coverage:open": "concurrently \"cd flow-coverage && http-server -c-1 \" \"open http://127.0.0.1:8080\"",
"flow": "flow"
},
"repository": {
"type": "git",
@@ -21,11 +25,12 @@
},
"homepage": "https://github.com/Algoteers/MasterApp#readme",
"devDependencies": {
"@advancedalgos/events-client": "^0.0.4",
"@advancedalgos/key-vault-client": "^0.0.21",
"@advancedalgos/teams-client": "^0.0.27",
"@advancedalgos/users-client": "^0.0.22",
"@advancedalgos/web-components": "0.0.13",
"@advancedalgos/events-client": "0.0.4",
"@advancedalgos/financial-beings-client": "0.0.4",
"@advancedalgos/key-vault-client": "0.0.24",
"@advancedalgos/teams-client": "0.0.29",
"@advancedalgos/users-client": "0.0.24",
"@advancedalgos/web-components": "0.0.15",
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
@@ -34,6 +39,7 @@
"@babel/preset-react": "^7.0.0",
"autoprefixer": "^9.2.0",
"babel-loader": "^8.0.4",
"babel-preset-flow": "6.23.0",
"connect-history-api-fallback": "^1.5.0",
"css-loader": "^1.0.0",
"debug": "^4.1.0",
@@ -41,12 +47,14 @@
"eslint": "^5.7.0",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-react": "^7.0.2",
"eslint-plugin-flowtype": "^2.42.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-standard": "^4.0.0",
"file-loader": "^2.0.0",
"flow-bin": "0.79.1",
"html-webpack-harddisk-plugin": "^0.2.0",
"html-webpack-plugin": "^3.2.0",
"koa-connect": "^2.0.1",
+14 -2
View File
@@ -18,13 +18,16 @@ import Users from '@advancedalgos/users-client'
import Teams from '@advancedalgos/teams-client'
import Events from '@advancedalgos/events-client'
import KeyVault from '@advancedalgos/key-vault-client'
import FinancialBeings from '@advancedalgos/financial-beings-client'
import { FINANCIAL_BEINGS } from './constants/routes'
export const auth = new Auth(
result => console.log('Authentication successful.'),
client
)
export const MasterApp = (props) => (
export const MasterApp = props => (
<BrowserRouter>
<ApolloProvider client={client}>
<MuiThemeProvider theme={theme}>
@@ -43,7 +46,12 @@ export const MasterApp = (props) => (
path='/email-verification'
render={props => {
console.log(props.location)
return <EmailSignupConfirm {...props} tokenParam={props.location.search} />
return (
<EmailSignupConfirm
{...props}
tokenParam={props.location.search}
/>
)
}}
/>
<Route
@@ -62,6 +70,10 @@ export const MasterApp = (props) => (
path='/events'
render={props => <Events {...props} auth={auth} />}
/>
<Route
path={FINANCIAL_BEINGS}
render={props => <FinancialBeings {...props} auth={auth} />}
/>
<Route
path='/key-vault'
render={props => <KeyVault {...props} auth={auth} />}
+1
View File
@@ -0,0 +1 @@
export const FINANCIAL_BEINGS = '/financial-beings'
+6 -1
View File
@@ -12,4 +12,9 @@ if (process.env.NODE_ENV !== 'production') {
window.localStorage.setItem('debug', 'advanced-algos:*')
}
ReactDOM.render(<Provider store={store}><MasterApp /></Provider>, document.getElementById('masterApp'))
ReactDOM.render(
<Provider store={store}>
<MasterApp />
</Provider>,
document.getElementById('masterApp')
)
+8 -1
View File
@@ -44,7 +44,8 @@ $advanced-algos-red: rgb(245,88,88);
}
body{
overflow-y:scroll;
padding-right: 0 !important;
overflow-y: scroll;
&::-webkit-scrollbar-track {
border: 1px solid #000;
@@ -235,6 +236,9 @@ header.menu{
&:hover{
color: $advanced-algos-red;
}
svg{
padding-top: 10px;
}
}
ul.subMenu{
display: none;
@@ -293,6 +297,9 @@ header.menu{
&.selected{
color: $advanced-algos-red;
}
svg{
padding-top: 10px;
}
}
ul.subMenu{
display: none;
+1 -1
View File
@@ -6,7 +6,7 @@ const Callback = () => <BannerTopBar
size='big'
title=''
text='Authenticating...'
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
/>
export default Callback
+13 -6
View File
@@ -44,23 +44,30 @@ class Charts extends Component {
size='medium'
title=''
text='Charts loading...'
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
/>
)
}
}
const mapStateToProps = (state) => {
const mapStateToProps = state => {
return {
context: state.context
}
}
const mapDispatchToProps = (dispatch) => {
const mapDispatchToProps = dispatch => {
return {
hideFooter: () => { dispatch({ type: 'HIDE_FOOTER' }) },
showFooter: () => { dispatch({ type: 'SHOW_FOOTER' }) }
hideFooter: () => {
dispatch({ type: 'HIDE_FOOTER' })
},
showFooter: () => {
dispatch({ type: 'SHOW_FOOTER' })
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(withStyles(styles)(Charts))
export default connect(
mapStateToProps,
mapDispatchToProps
)(withStyles(styles)(Charts))
@@ -2,17 +2,18 @@ import React from 'react'
import PropTypes from 'prop-types'
import Typography from '@material-ui/core/Typography'
const BannerTopBar = ({
size,
backgroundUrl,
title,
text,
children
}) => (
<div className={`bannerTopBar ${size}`} style={backgroundUrl ? { backgroundImage: `url(${backgroundUrl})` } : {}}>
const BannerTopBar = ({ size, backgroundUrl, title, text, children }) => (
<div
className={`bannerTopBar ${size}`}
style={backgroundUrl ? { backgroundImage: `url(${backgroundUrl})` } : {}}
>
<div className='caption'>
<Typography className='title' variant='h1' align='center'>{title}</Typography>
<Typography className='text' variant='h2' align='center'>{text}</Typography>
<Typography className='title' variant='h1' align='center'>
{title}
</Typography>
<Typography className='text' variant='h2' align='center'>
{text}
</Typography>
{children}
</div>
</div>
@@ -8,7 +8,7 @@ export class SignupVerifyResponse extends React.Component {
componentDidMount () {
const { mutate } = this.props
mutate()
};
}
render () {
const { loading, error, data } = this.props
@@ -17,7 +17,10 @@ export class SignupVerifyResponse extends React.Component {
let displayForm = false
console.log('SignupVerifyResponse:', loading, error, data)
if (error) {
if (error.message === 'GraphQL error: Error: Token Expired. Please resubmit email address.') {
if (
error.message ===
'GraphQL error: Error: Token Expired. Please resubmit email address.'
) {
BannerText = [
<strong key='EmailSignupConfirm-error-b1'>
Newsletter Signup Error: Verification Token Expired
@@ -29,19 +32,27 @@ export class SignupVerifyResponse extends React.Component {
]
displayForm = true
} else {
BannerText = ['Newsletter Signup Error: ', <br key='EmailSignupConfirm-error-br' />, error.message]
BannerText = [
'Newsletter Signup Error: ',
<br key='EmailSignupConfirm-error-br' />,
error.message
]
}
return (
<BannerTopBar
size='big'
title={BannerTitle}
text={BannerText}
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
/>
)
}
if (loading && !error) {
BannerText = ['Processing newsletter sign-up...', <br key='EmailSignupConfirm-br' />, 'Thank you for opting-in to recieve updates about the Advanced Algos project!']
BannerText = [
'Processing newsletter sign-up...',
<br key='EmailSignupConfirm-br' />,
'Thank you for opting-in to recieve updates about the Advanced Algos project!'
]
}
if (data !== undefined && data !== null) {
console.log(data)
@@ -52,7 +63,7 @@ export class SignupVerifyResponse extends React.Component {
size='big'
title='Mailing Sign-Up Complete!'
text='We look forward to keeping you up-to-date on the Advanced Algos project.'
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
>
{displayForm && <SignupForm alignCenter />}
</BannerTopBar>
@@ -65,7 +76,7 @@ export class SignupVerifyResponse extends React.Component {
size='big'
title='Processing...'
text=''
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
/>
)
}
+3 -7
View File
@@ -27,16 +27,13 @@ export const EmailSignupConfirm = ({ tokenParam }) => {
size='big'
title=''
text={BannerText}
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
/>
)
}
console.log(token)
return (
<Mutation
mutation={NEWSLETTER_SIGNUP_VERIFY}
variables={{ token: token }}
>
<Mutation mutation={NEWSLETTER_SIGNUP_VERIFY} variables={{ token: token }}>
{(NewsletterSignupVerify, { loading, error, data }) => {
return (
<SignupVerifyResponse
@@ -46,8 +43,7 @@ export const EmailSignupConfirm = ({ tokenParam }) => {
data={data}
/>
)
}
}
}}
</Mutation>
)
}
+3 -3
View File
@@ -9,12 +9,12 @@ class Home extends Component {
<BannerTopBar
size='big'
title='Advanced Algos Platform'
text='Enabling the evolutionary race towards the emergence of superalgos'
backgroundUrl='https://aacorporatesitedevelop.azurewebsites.net/img/photos/superalgos-platform.jpg'
text='People and machines working together to create Superalgos'
backgroundUrl='https://advancedalgos.net/img/photos/superalgos-platform.jpg'
/>
<div className='homePage container'>
<Typography variant='h1' align='center' className='title'>Welcome to the Advanced Algos Platform!</Typography>
<Typography variant='h2' align='center' className='subtitle'>CO-CREATE >> COMPETE >> EVOLVE</Typography>
<Typography variant='h2' align='center' className='subtitle'>Enabling the evolutionary race towards the emergence of superalgos</Typography>
<div className='column'>
<Typography align='justify'>
Before you begin, please be aware <strong>this is a development environment in pre-alpha stage</strong>.
+1 -1
View File
@@ -41,7 +41,7 @@ class Footer extends Component {
<Typography className={classNames(classes.textLight, classes.descriptionText)} ><strong>Advanced Algos Ltd.</strong></Typography>
<Typography className={classNames(classes.textLight, classes.descriptionText)} gutterBottom>Ground Floor, Palace Court, Church Street,<br />St. Julians&nbsp;STJ3049, Malta</Typography>
<Typography className={classNames(classes.textLight, classes.descriptionText)}>
<Link to='legal-privacy-statement.shtml' className={classNames(classes.textLight, classes.descriptionText)}>Privacy Statement</Link> | <a href='legal-terms-of-service.shtml' className={classes.linkLight}>Terms of Service</a>
<a href='legal-privacy-statement.shtml' className={classes.linkLight}>Privacy Statement</a> | <a href='legal-terms-of-service.shtml' className={classes.linkLight}>Terms of Service</a>
</Typography>
<Typography variant='body2' className={classNames(classes.textLight, classes.copyright)} gutterBottom>&copy; Advanced Algos, Ltd. 2018 | All Rights Reserved.</Typography>
</Grid>
+1 -1
View File
@@ -42,7 +42,7 @@ const styles = theme => ({
footer: {
borderTop: `4px solid ${theme.palette.secondary.light}`,
padding: `${theme.spacing.unit * 6}px 0`,
backgroundColor: '#19191C', /* #29292c */
backgroundColor: '#19191C' /* #29292c */,
color: theme.palette.primary.light
},
footerContainer: {
+6 -4
View File
@@ -19,9 +19,10 @@ export const LoggedIn = props => {
displayName = user.firstName
}
if (isDefined(user.firstName) && isDefined(user.lastName)) {
displayName = user.firstName + ' ' + user.lastName
}
displayName = displayName.split('-')[0]
displayName = displayName.split('.')[0]
displayName = displayName.split('_')[0]
displayName = displayName.split(' ')[0]
return (
@@ -32,8 +33,9 @@ export const LoggedIn = props => {
>
<Link to='/users/user' onClick={() => toggleMenuOpen(42, true)}> {displayName} </Link>
<ul className='subMenu'>
<li><Link to='/users/user' onClick={() => closeAll()}> Profile </Link></li>
<li><Link to='/users/user' onClick={() => closeAll()}> Your Profile </Link></li>
<li><a href='#' onClick={() => auth.logout()}> Logout </a></li>
<li><a href='https://www.advancedalgos.net'> Exit Platform </a></li>
</ul>
</li>
)
+21 -7
View File
@@ -13,6 +13,8 @@ import {
AddCircleOutline
} from '@material-ui/icons'
import { FINANCIAL_BEINGS } from '../../../constants/routes'
const usersMenus = {
title: 'Users',
to: '/users',
@@ -21,7 +23,7 @@ const usersMenus = {
{ title: 'Your Profile', to: '/users/user', icon: People, authenticated: true },
{ title: 'Directory', to: '/users/browse', icon: ImportContacts },
{ title: 'Search', to: '/users/search', icon: Search },
{ title: 'Report', to: 'https://github.com/AdvancedAlgos/UsersModule/issues/new', icon: BugReport, externalLink: true }
{ title: 'Report a Bug', to: 'https://github.com/AdvancedAlgos/UsersModule/issues/new', icon: BugReport, externalLink: true }
]
}
@@ -33,8 +35,7 @@ const teamsMenus = {
{ title: 'Explore teams', to: '/teams/explore', icon: Search },
{ title: 'Your teams', to: '/teams/manage-teams', icon: Group, authenticated: true },
{ title: 'Team members', to: '/teams/team-members', icon: People, authenticated: true },
{ title: 'Financial beings', to: '/teams/financial-beings', icon: Adb, authenticated: true },
{ title: 'Report', to: 'https://github.com/AdvancedAlgos/TeamsModule/issues/new', icon: BugReport, externalLink: true }
{ title: 'Report a Bug', to: 'https://github.com/AdvancedAlgos/TeamsModule/issues/new', icon: BugReport, externalLink: true }
]
}
@@ -47,7 +48,7 @@ const eventsMenus = {
{ title: 'Your events', to: '/events/my', icon: GamepadRounded, authenticated: true },
{ title: 'Your hosted events', to: '/events/host', icon: AccessibilityNew, authenticated: true },
{ title: 'Host an event', to: '/events/create', icon: LibraryAdd, authenticated: true },
{ title: 'Report', to: 'https://github.com/AdvancedAlgos/UsersModule/issues/new', icon: BugReport, externalLink: true }
{ title: 'Report a Bug', to: 'https://github.com/AdvancedAlgos/UsersModule/issues/new', icon: BugReport, externalLink: true }
]
}
@@ -57,12 +58,25 @@ const keyvaultMenus = {
icon: Home,
authenticated: true,
submenus: [
{ title: 'Manage keys', to: '/key-vault/browse', icon: VpnKey },
{ title: 'Your keys', to: '/key-vault/browse', icon: VpnKey },
{ title: 'Add key', to: '/key-vault/addKey', icon: AddCircleOutline },
{ title: 'Report', to: 'https://github.com/AdvancedAlgos/KeyVaultModule/issues/new', icon: BugReport, externalLink: true }
{ title: 'Report a Bug', to: 'https://github.com/AdvancedAlgos/KeyVaultModule/issues/new', icon: BugReport, externalLink: true }
]
}
const allMenus = [ usersMenus, teamsMenus, eventsMenus, keyvaultMenus ]
const financialBeingsMenus = {
title: 'Financial beings',
to: FINANCIAL_BEINGS,
authenticated: false,
submenus: []
}
const allMenus = [
usersMenus,
teamsMenus,
eventsMenus,
financialBeingsMenus,
keyvaultMenus
]
export default allMenus
+2 -2
View File
@@ -98,7 +98,7 @@ class Header extends Component {
<ul className='subMenu'>
{ bigScreen
? ''
: <li key={index + 'home'}><a href={to}> <Icon /> Homepage </a></li>
: <li key={index + 'home'}><Link to={to}> <Icon /> Module Home Page </Link></li>
}
{
submenus.map(({ icon: SubIcon, to: subTo, title: subTitle, externalLink, authenticated: subAuthenticated }, subindex) => {
@@ -107,7 +107,7 @@ class Header extends Component {
}
if (externalLink) {
return (
<li key={subindex}><a href={subTo}> <SubIcon /> {subTitle} </a></li>
<li key={subindex}><a href={subTo} target='_blank'> <SubIcon /> {subTitle} </a></li>
)
}
return (
+1 -3
View File
@@ -11,9 +11,7 @@ class Index extends React.Component {
return (
<div className={this.props.classes.layout}>
<Header auth={this.props.auth} />
<div>
{this.props.children}
</div>
<div>{this.props.children}</div>
<Footer />
</div>
)
+4 -1
View File
@@ -20,5 +20,8 @@ dist/
# Visual Studio Code
.vscode
#Mac specific files
# Mac specific files
.DS_Store
# JetBrains
.idea
+27 -13
View File
@@ -43,22 +43,32 @@ async function getUserId (authId) {
}
async function run () {
const transformedTeamsSchema = await createTransformedRemoteSchema(
'teams_',
process.env.TEAMS_API_URL,
process.env.TEAMS_API_PRESHARED)
const transformedUsersSchema = await createTransformedRemoteSchema(
'users_',
process.env.USERS_API_URL,
process.env.USERS_API_PRESHARED)
const transformedEventsSchema = await createTransformedRemoteSchema(
'events_',
process.env.EVENTS_API_URL,
process.env.EVENTS_API_PRESHARED)
logger.info('About to create schemas')
const transformedKeyVaultSchema = await createTransformedRemoteSchema(
'keyVault_',
process.env.KEYVAULT_API_URL,
process.env.KEYVAULT_API_PRESHARED)
logger.info('KeyVault schema created')
const transformedTeamsSchema = await createTransformedRemoteSchema(
'teams_',
process.env.TEAMS_API_URL,
process.env.TEAMS_API_PRESHARED)
logger.info('Teams schema created')
const transformedUsersSchema = await createTransformedRemoteSchema(
'users_',
process.env.USERS_API_URL,
process.env.USERS_API_PRESHARED)
logger.info('Users schema created')
const transformedEventsSchema = await createTransformedRemoteSchema(
'events_',
process.env.EVENTS_API_URL,
process.env.EVENTS_API_PRESHARED)
logger.info('Events schema created')
const transformedFinancialBeingsSchema = await createTransformedRemoteSchema(
'financialBeings_',
process.env.FINANCIAL_BEINGS_API_URL,
process.env.FINANCIAL_BEINGS_API_PRESHARED)
logger.info('FINANCIAL_BEINGS schema created')
var schemas = [masterSchema]
var resolvers = {}
@@ -84,7 +94,10 @@ async function run () {
if (transformedKeyVaultSchema) {
schemas.push(transformedKeyVaultSchema)
}
if (transformedFinancialBeingsSchema) {
schemas.push(transformedFinancialBeingsSchema)
}
const schema = mergeSchemas({
schemas,
resolvers
@@ -171,6 +184,7 @@ async function run () {
}
try {
logger.info('About to run main run method')
run()
} catch (e) {
logger.error(`An general error occured while running the app: ${e}, details: ${e.message}, stack: ${e.stack}`)