From beac601e2691e7d553e0bee240cbb922f56cd2ca Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 2 Oct 2018 08:59:27 +0200 Subject: [PATCH] Login Button Enabled --- Spaces/TopSpace.js | 10 +++++----- TopSpace/CurrentBot.js | 2 +- TopSpace/CurrentProcess.js | 2 +- TopSpace/CurrentStartMode.js | 3 ++- TopSpace/DevTeam.js | 3 ++- TopSpace/EndUser.js | 2 +- TopSpace/Login.js | 37 +++++++++++++++++++++++------------- index.html | 1 + 8 files changed, 37 insertions(+), 23 deletions(-) diff --git a/Spaces/TopSpace.js b/Spaces/TopSpace.js index 9f69a1691..f259a5f99 100644 --- a/Spaces/TopSpace.js +++ b/Spaces/TopSpace.js @@ -58,8 +58,8 @@ function newTopSpace() { thisObject.currentStartMode = newCurrentStartMode(); thisObject.currentStartMode.initialize(sharedStatus); - //thisObject.login = newLogin(); - //thisObject.login.initialize(); + thisObject.login = newLogin(); + thisObject.login.initialize(); thisObject.playStopButton = newPlayStopButton(); thisObject.playStopButton.initialize(); @@ -88,8 +88,8 @@ function newTopSpace() { container = thisObject.currentStartMode.getContainer(point); if (container !== undefined) { return container; } - //container = thisObject.login.getContainer(point); - //if (container !== undefined) { return container; } + container = thisObject.login.getContainer(point); + if (container !== undefined) { return container; } container = thisObject.playStopButton.getContainer(point); if (container !== undefined) { return container; } @@ -111,7 +111,7 @@ function newTopSpace() { thisObject.currentBot.draw(); thisObject.currentProcess.draw(); thisObject.currentStartMode.draw(); - //thisObject.login.draw(); + thisObject.login.draw(); thisObject.playStopButton.draw(); } diff --git a/TopSpace/CurrentBot.js b/TopSpace/CurrentBot.js index d43661848..3bfece3a2 100644 --- a/TopSpace/CurrentBot.js +++ b/TopSpace/CurrentBot.js @@ -15,7 +15,7 @@ function newCurrentBot() { thisObject.container.frame.width = 200; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 3; + container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 4; container.frame.position.y = 0; container.isDraggeable = false; diff --git a/TopSpace/CurrentProcess.js b/TopSpace/CurrentProcess.js index 735cf43e5..bbbe4ff33 100644 --- a/TopSpace/CurrentProcess.js +++ b/TopSpace/CurrentProcess.js @@ -15,7 +15,7 @@ function newCurrentProcess() { thisObject.container.frame.width = 200; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 2; + container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 3; container.frame.position.y = 0; container.isDraggeable = false; diff --git a/TopSpace/CurrentStartMode.js b/TopSpace/CurrentStartMode.js index 5fe469d03..fe98f3a4c 100644 --- a/TopSpace/CurrentStartMode.js +++ b/TopSpace/CurrentStartMode.js @@ -15,7 +15,7 @@ function newCurrentStartMode() { thisObject.container.frame.width = 200; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 1; + container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 2; container.frame.position.y = 0; container.isDraggeable = false; @@ -53,6 +53,7 @@ function newCurrentStartMode() { break; } } + } function getContainer(point) { diff --git a/TopSpace/DevTeam.js b/TopSpace/DevTeam.js index 70a7d090a..a43ceb911 100644 --- a/TopSpace/DevTeam.js +++ b/TopSpace/DevTeam.js @@ -15,7 +15,7 @@ function newDevTeam() { thisObject.container.frame.width = 200; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 4; + container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 5; container.frame.position.y = 0; container.isDraggeable = false; @@ -61,6 +61,7 @@ function newDevTeam() { sharedStatus.eventHandler.raiseEvent("devTeam Changed"); return; } + } function getContainer(point) { diff --git a/TopSpace/EndUser.js b/TopSpace/EndUser.js index 602c3cf42..a89ea6acb 100644 --- a/TopSpace/EndUser.js +++ b/TopSpace/EndUser.js @@ -15,7 +15,7 @@ function newEndUser() { thisObject.container.frame.width = 200; thisObject.container.frame.height = TOP_SPACE_HEIGHT; - container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 5; + container.frame.position.x = viewPort.visibleArea.topRight.x - thisObject.container.frame.width * 6; container.frame.position.y = 0; container.isDraggeable = false; diff --git a/TopSpace/Login.js b/TopSpace/Login.js index 769aedc62..adb37c5cf 100644 --- a/TopSpace/Login.js +++ b/TopSpace/Login.js @@ -97,21 +97,32 @@ function newLogin() { }); */ - let graphQLQuery = { query: '{ getTeamByOwner(owner: 4) {id name slug owner avatar}} ' }; + const apolloClient = new Apollo.lib.ApolloClient({ + networkInterface: Apollo.lib.createNetworkInterface({ - let fechtParam1 = 'https://api.algocommunity.org/graphql'; - let fechtParam2 = { - method: 'POST', - headers: { - 'Content-Type': 'application/json'//, - //'Authorization': 'Bearer ' - }, - body: JSON.stringify(graphQLQuery), - } + uri: 'https://users-api.advancedalgos.net/graphql', + transportBatching: true, + }), + connectToDevTools: true, + }) - fetch(fechtParam1, fechtParam2) - .then(res => res.json()) - .then(res => console.log(res.data)); + const POSTS_QUERY = Apollo.gql` + query{ + users { + id + alias + firstName + middleName + lastName + } + } + ` + + apolloClient.query({ + query: POSTS_QUERY + }) + .then(data => console.log("apolloClient data", data)) + .catch(error => console.error("apolloClient error", error)); } else { diff --git a/index.html b/index.html index 693ec1db4..2bf2cd52e 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ Advanced Algos +