Bug fixes for deployment
This commit is contained in:
1 parent
c98455d5b8
commit
9f09f33b8c
12 files changed
+2528
-4351
No files matched your search
@@ -1,9 +1,9 @@
|
||||
version: '3'
|
||||
services:
|
||||
api:
|
||||
image: advancedalgosteamsmodule/teammodule-api:v2
|
||||
env_file: ./.env.prod
|
||||
container_name: aateamapi
|
||||
image: advancedalgosteamsmodule/teammodule-api:v5
|
||||
env_file: ./.env
|
||||
container_name: aateamapi-imagetest
|
||||
tty: true
|
||||
stdin_open: true
|
||||
volumes:
|
||||
|
||||
+31
-14
@@ -152,27 +152,44 @@ const resolvers = {
|
||||
async createTeam(parent, { name, slug, botName, botSlug }, ctx, info) {
|
||||
console.log('createTeam ctx:', ctx.request.user)
|
||||
const authId = ctx.request.user.sub
|
||||
const encodedAuthId = encodeURI(authId)
|
||||
const getUserModuleUser = await axios.get(`https://users-api.advancedalgos.net/graphql?query=%7B%0A%20%20userByAuthId(authId%3A%22${encodedAuthId}%22)%7B%0A%20%20%20%20id%0A%09%09email%0A%20%20%20%20alias%0A%20%20%7D%0A%7D`)
|
||||
const encodedAuthId = encodeURI(`:"${authId}"`)
|
||||
const encodedURL = `https://users-api.advancedalgos.net/graphql?query=%7B%0A%20%20userByAuthId(authId${encodedAuthId})%7B%0A%20%20%20%20id%0A%09%09email%0A%20%20%20%20alias%0A%20%20%7D%0A%7D`
|
||||
const decodedURL = decodeURI(encodedURL)
|
||||
console.log('decoded URL: ', decodedURL)
|
||||
const getUserModuleUser = await axios.get(encodedURL)
|
||||
.then((result) => {
|
||||
console.log('getUserModuleUser:', result)
|
||||
return result
|
||||
})
|
||||
.catch(err =>{
|
||||
console.log('getUserModuleUser err:', err)
|
||||
})
|
||||
|
||||
console.log('getUserModuleUser:', await getUserModuleUser)
|
||||
const alias = await getUserModuleUser.data.data.userByAuthId.alias
|
||||
const email = getUserModuleUser.data.data.userByAuthId.email
|
||||
const avatar = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-avatar-default.png'
|
||||
const banner = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-banner-default.png'
|
||||
/*
|
||||
const createTeamUrl = encodeURI(`${slug}/${name}/${alias}/${botSlug}`)
|
||||
const platformUrl = 'https://develop.advancedalgos.net/AABrowserAPI/teamSetup/'
|
||||
// const platformUrl = 'http://localhost:1337/AABrowserAPI/teamSetup/'
|
||||
|
||||
const createTeamUrl = encodeURI(`${slug}/${name}/${alias}/${botSlug}/${authId}`)
|
||||
// const platformUrl = 'https://develop.advancedalgos.net/AABrowserAPI/teamSetup/'
|
||||
const platformUrl = 'http://localhost:1337/AABrowserAPI/teamSetup/'
|
||||
const createPlatformTeam = await axios.get(`${platformUrl}${createTeamUrl}`)
|
||||
.then((result) => {
|
||||
console.log('createPlatformTeam:', result)
|
||||
if(result.data.message === 'Team Name already taken'){
|
||||
throw new Error(result.data.message)
|
||||
}
|
||||
return result
|
||||
})
|
||||
.catch(err =>{
|
||||
console.log('createPlatformTeam err:', err)
|
||||
throw new Error(err)
|
||||
})
|
||||
console.log('createPlatformTeam: ', await createPlatformTeam)
|
||||
|
||||
// const sessionToken = getUserModuleUser.data.data.userByAuthId.id
|
||||
update session token on user module
|
||||
const updateUserSession = await axios.post('https://users-api.advancedalgos.net/graphql', {
|
||||
query: 'mutation { language }'
|
||||
})
|
||||
|
||||
*/
|
||||
if(createPlatformTeam === 'Error: Team Name already taken'){
|
||||
return createPlatformTeam
|
||||
}
|
||||
const createTeam = await ctx.db.mutation.createTeam({ data: {name: name, slug: slug, owner: authId, members: {create: {member: {connect: {authId: authId}}, role: 'OWNER'}}, profile: {create: {avatar: avatar, banner: banner}}, fb: {create: {name: botName, slug: botSlug, kind:'TRADER', avatar: avatar, status: {create: {status: 'ACTIVE', reason: "Cloned on team creation"}}}}, status: {create: {status: 'ACTIVE', reason:"Team created"}}} }, TEAMS_FRAGMENT)
|
||||
.catch((err) => {
|
||||
console.log('createTeam error: ', err)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
src
|
||||
build
|
||||
node_modules
|
||||
html
|
||||
tools/docker
|
||||
tools/webpack
|
||||
.env
|
||||
.env.prod
|
||||
.env.sample
|
||||
.eslintrc
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
postcss.config.js
|
||||
webpack.config.js
|
||||
.DS_Store
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AlgoCommunity</title>
|
||||
<title>Advanced Algos Teams</title>
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="The AlgoCommunity is a collaborative setting for developing, competing and evolving Advanced Algos financial beings">
|
||||
|
||||
Generated
+2373
-4265
File diff suppressed because it is too large.
Load diff
+35
-32
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"name": "aateam-client",
|
||||
"version": "0.0.1",
|
||||
"name": "@advancedalgos/teams-client",
|
||||
"version": "0.0.8",
|
||||
"description": "Advanced Algos Team client-side web app",
|
||||
"main": "src/index.js",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"dev": "NODE_ENV=development PORT=3001 webpack-serve --config ./webpack.config.js",
|
||||
"build": "NODE_ENV=production webpack --mode production --config ./webpack.config.js",
|
||||
"prepublish": "npx babel src --out-dir dist --copy-files --source-maps",
|
||||
"lint": "prettier-standard 'src/**/*.js'",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
@@ -18,9 +19,10 @@
|
||||
"author": "Barry Low <bearcanrun@gmail.com>",
|
||||
"license": "AGPL-3.0",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.1.2",
|
||||
"@babel/core": "^7.1.2",
|
||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
||||
"@babel/preset-env": "^7.1.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"autoprefixer": "^8.6.5",
|
||||
"babel-core": "^7.0.0-bridge.0",
|
||||
@@ -33,14 +35,14 @@
|
||||
"babel-plugin-transform-react-jsx": "^6.24.1",
|
||||
"connect-history-api-fallback": "^1.5.0",
|
||||
"css-loader": "^0.28.11",
|
||||
"eslint": "^5.5.0",
|
||||
"eslint-config-prettier": "^3.0.1",
|
||||
"eslint": "^5.6.1",
|
||||
"eslint-config-prettier": "^3.1.0",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
"eslint-config-standard-react": "^7.0.2",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.1.2",
|
||||
"eslint-plugin-node": "^7.0.1",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"eslint-plugin-prettier": "^2.7.0",
|
||||
"eslint-plugin-promise": "^4.0.1",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
@@ -48,39 +50,39 @@
|
||||
"html-webpack-harddisk-plugin": "^0.2.0",
|
||||
"html-webpack-plugin": "^3.2.0",
|
||||
"koa-connect": "^2.0.1",
|
||||
"mini-css-extract-plugin": "^0.4.2",
|
||||
"minilog": "^3.1.0",
|
||||
"mini-css-extract-plugin": "^0.4.3",
|
||||
"node-sass": "^4.9.3",
|
||||
"optimize-css-assets-webpack-plugin": "^4.0.3",
|
||||
"postcss-loader": "^2.1.6",
|
||||
"prettier": "^1.14.2",
|
||||
"prettier": "^1.14.3",
|
||||
"prettier-standard": "^8.0.1",
|
||||
"sass-loader": "^6.0.7",
|
||||
"script-ext-html-webpack-plugin": "^2.0.1",
|
||||
"style-loader": "^0.21.0",
|
||||
"uglifyjs-webpack-plugin": "^1.3.0",
|
||||
"webpack": "^4.20.2",
|
||||
"webpack-cli": "^3.1.1",
|
||||
"webpack-bundle-analyzer": "^3.0.2",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-hot-client": "^4.1.1",
|
||||
"webpack-merge": "^4.1.4",
|
||||
"webpack-serve": "^1.0.4",
|
||||
"workbox-build": "^3.4.1",
|
||||
"workbox-cli": "^3.4.1"
|
||||
"workbox-build": "^3.6.2",
|
||||
"workbox-cli": "^3.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@advancedalgos/web-components": "0.0.5",
|
||||
"@azure/storage-blob": "^10.0.0-preview",
|
||||
"@material-ui/core": "^3.0.3",
|
||||
"@material-ui/core": "^3.2.0",
|
||||
"@material-ui/icons": "^3.0.1",
|
||||
"apollo-cache-inmemory": "^1.2.9",
|
||||
"apollo-client": "^2.4.1",
|
||||
"apollo-link": "^1.2.2",
|
||||
"apollo-link-context": "^1.0.8",
|
||||
"apollo-link-error": "^1.1.0",
|
||||
"apollo-link-http": "^1.5.4",
|
||||
"apollo-link-ws": "^1.0.8",
|
||||
"apollo-utilities": "^1.0.20",
|
||||
"auth0-lock": "^11.9.0",
|
||||
"apollo-cache-inmemory": "^1.3.5",
|
||||
"apollo-client": "^2.4.2",
|
||||
"apollo-link": "^1.2.3",
|
||||
"apollo-link-context": "^1.0.9",
|
||||
"apollo-link-error": "^1.1.1",
|
||||
"apollo-link-http": "^1.5.5",
|
||||
"apollo-link-ws": "^1.0.9",
|
||||
"apollo-utilities": "^1.0.21",
|
||||
"auth0-lock": "^11.10.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"blob-util": "^2.0.2",
|
||||
"browser-image-resizer": "^1.2.0",
|
||||
@@ -88,18 +90,19 @@
|
||||
"cross-fetch": "^2.2.2",
|
||||
"dotenv-webpack": "^1.5.7",
|
||||
"graphql": "^0.13.2",
|
||||
"graphql-tag": "^2.9.2",
|
||||
"graphql-tag": "^2.10.0",
|
||||
"minilog": "^3.1.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"query-string": "^6.1.0",
|
||||
"react": "^16.5.0",
|
||||
"react-apollo": "^2.1.11",
|
||||
"react-dom": "^16.5.0",
|
||||
"react-dropzone": "^5.1.0",
|
||||
"query-string": "^6.2.0",
|
||||
"react": "^16.5.2",
|
||||
"react-apollo": "^2.2.4",
|
||||
"react-dom": "^16.5.2",
|
||||
"react-dropzone": "^5.1.1",
|
||||
"react-image-cropper": "^1.3.0",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"recompose": "^0.30.0",
|
||||
"sharp": "^0.20.8",
|
||||
"subscriptions-transport-ws": "^0.9.14"
|
||||
"subscriptions-transport-ws": "^0.9.15"
|
||||
},
|
||||
"standard": {
|
||||
"parser": "babel-eslint",
|
||||
|
||||
+30
-33
@@ -1,5 +1,4 @@
|
||||
import { ApolloClient } from 'apollo-client'
|
||||
import { ApolloProvider } from 'react-apollo'
|
||||
import { HttpLink } from 'apollo-link-http'
|
||||
import { InMemoryCache } from 'apollo-cache-inmemory'
|
||||
import { ApolloLink, split, Observable } from 'apollo-link'
|
||||
@@ -150,38 +149,36 @@ class App extends Component {
|
||||
render () {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<ApolloProvider client={client}>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
<div className='App'>
|
||||
<NavBar auth={auth} />
|
||||
<Switch>
|
||||
<Route exact path='/' component={Home} />
|
||||
<Route exact path='/about' component={About} />
|
||||
<Route exact path='/teams' component={Teams} />
|
||||
<Route exact path='/teams/:slug' component={Teams} />
|
||||
<Route
|
||||
exact
|
||||
path='/(dashboard|manage-teams|team-members|financial-beings|settings)/'
|
||||
render={props => <Dashboard {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/callback'
|
||||
render={props => {
|
||||
auth.handleAuthentication(props)
|
||||
return <Callback {...props} />
|
||||
}}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path='/activate-team-membership'
|
||||
render={props => <AcceptTeamInvite {...props} auth={auth} />}
|
||||
/>
|
||||
</Switch>
|
||||
<Footer />
|
||||
</div>
|
||||
</MuiThemeProvider>
|
||||
</ApolloProvider>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
<div className='App'>
|
||||
<NavBar auth={auth} />
|
||||
<Switch>
|
||||
<Route exact path='/' component={Home} />
|
||||
<Route exact path='/about' component={About} />
|
||||
<Route exact path='/teams' component={Teams} />
|
||||
<Route exact path='/teams/:slug' component={Teams} />
|
||||
<Route
|
||||
exact
|
||||
path='/(dashboard|manage-teams|team-members|financial-beings|settings)/'
|
||||
render={props => <Dashboard {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/callback'
|
||||
render={props => {
|
||||
auth.handleAuthentication(props)
|
||||
return <Callback {...props} />
|
||||
}}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path='/activate-team-membership'
|
||||
render={props => <AcceptTeamInvite {...props} auth={auth} />}
|
||||
/>
|
||||
</Switch>
|
||||
<Footer />
|
||||
</div>
|
||||
</MuiThemeProvider>
|
||||
</BrowserRouter>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -24,3 +24,5 @@ if (process.env.NODE_ENV === 'development') {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default App
|
||||
@@ -209,7 +209,7 @@ export class CreateTeamDialog extends Component {
|
||||
e.preventDefault()
|
||||
console.log('createTeam submit: ', name, botName)
|
||||
const slug = this.slugify(name)
|
||||
const botSlug = this.slugify(name)
|
||||
const botSlug = this.slugify(botName)
|
||||
await createTeam({ variables: { name, slug, botName, botSlug } })
|
||||
this.setState({ name: '', open: false })
|
||||
}
|
||||
|
||||
@@ -125,12 +125,12 @@ export class ManageTeamEdit extends Component {
|
||||
}
|
||||
|
||||
let avatar = null
|
||||
if (this.state.avatar !== null) avatar = this.state.avatar
|
||||
if (team.profile !== null && team.profile.avatar !== undefined && team.profile.avatar !== null) avatar = team.profile.avatar
|
||||
if (this.state.avatar !== null) avatar = this.state.avatar
|
||||
if (this.state.avatar === null && team.profile !== null && team.profile.avatar === undefined) avatar = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-avatar-default.png'
|
||||
let banner = null
|
||||
if (this.state.banner !== null) banner = this.state.banner
|
||||
if (team.profile !== null && team.profile.banner !== undefined && team.profile.banner !== null) banner = team.profile.banner
|
||||
if (this.state.banner !== null) banner = this.state.banner
|
||||
if (this.state.banner === null && team.profile !== null && team.profile.banner === undefined) banner = 'https://algobotcommstorage.blob.core.windows.net/aateammodule/aa-banner-default.png'
|
||||
console.log('team images: ', avatar, banner)
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
const path = require('path')
|
||||
const nodeExternals = require('webpack-node-externals')
|
||||
|
||||
module.exports = {
|
||||
entry: path.resolve(__dirname, './src/lib/index.js'),
|
||||
output: {
|
||||
path: path.resolve(__dirname, './dist/lib'),
|
||||
filename: 'index.js',
|
||||
library: '',
|
||||
libraryTarget: 'commonjs'
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
presets: ['@babel/preset-env', '@babel/preset-react']
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: ['style-loader', 'css-loader']
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
|
||||
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
|
||||
const Dotenv = require('dotenv-webpack')
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
||||
.BundleAnalyzerPlugin
|
||||
|
||||
module.exports = merge(commonConfig, {
|
||||
mode: 'production',
|
||||
@@ -54,6 +56,10 @@ module.exports = merge(commonConfig, {
|
||||
new HtmlWebpackHarddiskPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('production')
|
||||
}),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
reportFilename: 'report.html'
|
||||
})
|
||||
],
|
||||
module: {
|
||||
|
||||
Reference in new issue
Block a user