diff --git a/client/.flowconfig b/client/.flowconfig new file mode 100644 index 000000000..a8cd5ce7f --- /dev/null +++ b/client/.flowconfig @@ -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/\(.*\)$' -> '/src/\1' + +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue +suppress_type=$FlowIssue +suppress_type=$FlowFixMe +suppress_type=$FixMe + +[strict] diff --git a/client/package.json b/client/package.json index 47abb758e..e0ed6f6b3 100644 --- a/client/package.json +++ b/client/package.json @@ -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", diff --git a/client/src/App.js b/client/src/App.js index 58d5f4ec7..f855b1c50 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -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 => ( @@ -43,7 +46,12 @@ export const MasterApp = (props) => ( path='/email-verification' render={props => { console.log(props.location) - return + return ( + + ) }} /> ( path='/events' render={props => } /> + } + /> } diff --git a/client/src/constants/routes.js b/client/src/constants/routes.js new file mode 100644 index 000000000..25c3c9dc1 --- /dev/null +++ b/client/src/constants/routes.js @@ -0,0 +1 @@ +export const FINANCIAL_BEINGS = '/financial-beings' diff --git a/client/src/index.js b/client/src/index.js index ea6f56c0a..acbab7067 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -12,4 +12,9 @@ if (process.env.NODE_ENV !== 'production') { window.localStorage.setItem('debug', 'advanced-algos:*') } -ReactDOM.render(, document.getElementById('masterApp')) +ReactDOM.render( + + + , + document.getElementById('masterApp') +) diff --git a/client/src/views/charts/index.js b/client/src/views/charts/index.js index 38eec4e9e..a2969e27d 100644 --- a/client/src/views/charts/index.js +++ b/client/src/views/charts/index.js @@ -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)) diff --git a/client/src/views/common/components/BannerTopBar.js b/client/src/views/common/components/BannerTopBar.js index 823877f72..e7d1fc719 100644 --- a/client/src/views/common/components/BannerTopBar.js +++ b/client/src/views/common/components/BannerTopBar.js @@ -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 -}) => ( -
+const BannerTopBar = ({ size, backgroundUrl, title, text, children }) => ( +
- {title} - {text} + + {title} + + + {text} + {children}
diff --git a/client/src/views/email-verification/components/SignupVerifyResponse.js b/client/src/views/email-verification/components/SignupVerifyResponse.js index fca6419d6..525cee3a9 100644 --- a/client/src/views/email-verification/components/SignupVerifyResponse.js +++ b/client/src/views/email-verification/components/SignupVerifyResponse.js @@ -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 = [ Newsletter Signup Error: Verification Token Expired @@ -29,7 +32,11 @@ export class SignupVerifyResponse extends React.Component { ] displayForm = true } else { - BannerText = ['Newsletter Signup Error: ',
, error.message] + BannerText = [ + 'Newsletter Signup Error: ', +
, + error.message + ] } return ( , 'Thank you for opting-in to recieve updates about the Advanced Algos project!'] + BannerText = [ + 'Processing newsletter sign-up...', +
, + 'Thank you for opting-in to recieve updates about the Advanced Algos project!' + ] } if (data !== undefined && data !== null) { console.log(data) diff --git a/client/src/views/email-verification/index.js b/client/src/views/email-verification/index.js index dd71bc7ae..3fd36d320 100644 --- a/client/src/views/email-verification/index.js +++ b/client/src/views/email-verification/index.js @@ -33,10 +33,7 @@ export const EmailSignupConfirm = ({ tokenParam }) => { } console.log(token) return ( - + {(NewsletterSignupVerify, { loading, error, data }) => { return ( { data={data} /> ) - } - } + }} ) } diff --git a/client/src/views/layout/footer/styles.js b/client/src/views/layout/footer/styles.js index 4bc6469fa..92e48d4cc 100644 --- a/client/src/views/layout/footer/styles.js +++ b/client/src/views/layout/footer/styles.js @@ -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: { diff --git a/client/src/views/layout/header/imports.js b/client/src/views/layout/header/imports.js index 613c8e1c1..e4b32a9c3 100644 --- a/client/src/views/layout/header/imports.js +++ b/client/src/views/layout/header/imports.js @@ -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 diff --git a/client/src/views/layout/index.js b/client/src/views/layout/index.js index 7b7c2fb7b..fab1f1093 100644 --- a/client/src/views/layout/index.js +++ b/client/src/views/layout/index.js @@ -11,9 +11,7 @@ class Index extends React.Component { return (
-
- {this.props.children} -
+
{this.props.children}
) diff --git a/server/.gitignore b/server/.gitignore index 0e2d8768a..58c1b2f3d 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -20,5 +20,8 @@ dist/ # Visual Studio Code .vscode -#Mac specific files +# Mac specific files .DS_Store + +# JetBrains +.idea diff --git a/server/src/index.js b/server/src/index.js index 635bce622..75ebfebc0 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -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