Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Luis Fernando Molina committed 2018-11-22 20:49:10 +01:00
commit edb58b7999
17 files changed
+296 -186

No files matched your search

+10 -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
+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')
)
+12 -5
View File
@@ -50,17 +50,24 @@ class Charts extends Component {
}
}
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,7 +32,11 @@ 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
@@ -41,7 +48,11 @@ export class SignupVerifyResponse extends React.Component {
)
}
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)
+2 -6
View File
@@ -33,10 +33,7 @@ export const EmailSignupConfirm = ({ tokenParam }) => {
}
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>
)
}
+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: {
+16 -1
View File
@@ -13,6 +13,8 @@ import {
AddCircleOutline
} from '@material-ui/icons'
import { FINANCIAL_BEINGS } from '../../../constants/routes'
const usersMenus = {
title: 'Users',
to: '/users',
@@ -62,6 +64,19 @@ const keyvaultMenus = {
]
}
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
+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>
)