diff --git a/client/package.json b/client/package.json index c0907e711..a3f97354c 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@superalgos/operations-client", - "version": "0.0.8", + "version": "0.0.11", "description": "Superalgos Operations client-side web app", "main": "src/index.js", "dependencies": { diff --git a/client/src/GraphQL/Calls/teams.js b/client/src/GraphQL/Calls/teams.js index 7329d3e07..0a27afd3c 100644 --- a/client/src/GraphQL/Calls/teams.js +++ b/client/src/GraphQL/Calls/teams.js @@ -1,8 +1,8 @@ import gql from 'graphql-tag'; export const GET_ALL_TEAMS_QUERY = gql` - query Teams_FbByTeamMember { - teams_FbByTeamMember { + query { + teams_TeamsByOwner { id name slug diff --git a/client/src/GraphQL/models.js b/client/src/GraphQL/models.js index 474df1fcf..50dd8a322 100644 --- a/client/src/GraphQL/models.js +++ b/client/src/GraphQL/models.js @@ -1,8 +1,21 @@ const types = [ 'Live', 'Competition', 'Backtest' ] -const startModes = [ 'All Months', 'One Month', 'No Time' ] const availableMonths = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] +const startModes = [ + { + name: 'All Months', + value: 'allMonths' + }, + { + name: 'One Month', + value: 'oneMonth' + }, + { + name: 'No Time', + value: 'noTime' + } +] const exchanges = [ { id: '1', diff --git a/client/src/views/Clone/Add/index.js b/client/src/views/Clone/Add/index.js index 54d42e0a8..0a90f3fcb 100644 --- a/client/src/views/Clone/Add/index.js +++ b/client/src/views/Clone/Add/index.js @@ -119,7 +119,7 @@ class AddClone extends Component { ) } - if(!isDefined(data.teams_FbByTeamMember)){ + if(!isDefined(data.teams_TeamsByOwner)){ return ( ) } else{ - this.teams = data.teams_FbByTeamMember + this.teams = data.teams_TeamsByOwner } return ( @@ -145,10 +145,12 @@ class AddClone extends Component { onChange={e => this.setSelectedBot(e.target.value)} > { - data.teams_FbByTeamMember.fb.map(financialBeing => ( - - {data.teams_FbByTeamMember.name + '/' + financialBeing.name} - + data.teams_TeamsByOwner.map(team => ( + team.fb.map(financialBeing => ( + + {team.name + '/' + financialBeing.name} + + )) )) } @@ -289,8 +291,8 @@ class AddClone extends Component { fullWidth > {startModes.map(option => ( - - {option} + + {option.name} ))} @@ -371,7 +373,7 @@ class AddClone extends Component { - You will your clone information under Active Clones until it finishes the execution, then it will moved to the History. + You will be able to query your clone information under Active Clones until it finishes the execution, then it will moved to the History. @@ -410,11 +412,13 @@ class AddClone extends Component { setSelectedBot(botId){ if(isDefined(this.teams)){ - for (var i = 0; i < this.teams.fb.length; i++) { - if(this.teams.fb[i].id === botId){ - this.setState({selectedBot:this.teams.fb[i]}) - this.setState({teamId:this.teams.id}) - return + for (var j = 0; j < this.teams.length; j++) { + for (var i = 0; i < this.teams[j].fb.length; i++) { + if(this.teams[j].fb[i].id === botId){ + this.setState({selectedBot:this.teams[j].fb[i]}) + this.setState({teamId:this.teams[j].id}) + return + } } } } diff --git a/server/src/schema/cloneDetails.js b/server/src/schema/cloneDetails.js index ec4ee89e2..74849e583 100644 --- a/server/src/schema/cloneDetails.js +++ b/server/src/schema/cloneDetails.js @@ -17,7 +17,7 @@ const cloneDetails = async(authId, team, clone) => { clone.kind = selectedBot.kind clone.teamSlug = team.slug clone.botSlug = selectedBot.slug - clone.cloneName = clone.teamSlug + '-' + clone.botSlug + '-' + clone.mode.toLowerCase() + clone.cloneName = (clone.teamSlug + '-' + clone.botSlug + '-' + clone.mode).toLowerCase() clone.teamName = team.name clone.botName = selectedBot.name clone.botAvatar = selectedBot.avatar