Merge pull request #1 from algorithms-anonymous/feature/financial-beings

Feature/financial beings
This commit is contained in:
V authored and GitHub committed 2018-11-19 17:22:31 +01:00
commit 05442c0d3d
14 files changed
+120 -37

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]
+9 -2
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",
@@ -58,7 +62,10 @@
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.9",
"webpack-merge": "^4.1.4"
"webpack-merge": "^4.1.4",
"flow-bin": "0.79.1",
"babel-preset-flow": "6.23.0",
"eslint-plugin-flowtype": "^2.42.0"
},
"standard": {
"parser": "babel-eslint",
+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')
)
+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>
)
+4 -1
View File
@@ -20,5 +20,8 @@ dist/
# Visual Studio Code
.vscode
#Mac specific files
# Mac specific files
.DS_Store
# JetBrains
.idea
+9 -1
View File
@@ -64,6 +64,11 @@ async function run () {
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 = {}
@@ -89,7 +94,10 @@ async function run () {
if (transformedKeyVaultSchema) {
schemas.push(transformedKeyVaultSchema)
}
if (transformedFinancialBeingsSchema) {
schemas.push(transformedFinancialBeingsSchema)
}
const schema = mergeSchemas({
schemas,
resolvers