From 07bf7b8f973655ddcf6aaada6b9a439488e645b1 Mon Sep 17 00:00:00 2001 From: Gustavo Maximiliano Cortez Date: Tue, 8 Sep 2015 12:04:27 -0300 Subject: [PATCH] Unconfirmed accounts --- bower.json | 2 +- public/views/glidera.html | 50 +++++++++++++++++++++---------- src/js/controllers/buyGlidera.js | 2 +- src/js/controllers/glidera.js | 12 ++++++-- src/js/controllers/index.js | 9 ++++-- src/js/services/glideraService.js | 3 +- 6 files changed, 55 insertions(+), 23 deletions(-) diff --git a/bower.json b/bower.json index 4a2bf2acf..d9ad490ab 100644 --- a/bower.json +++ b/bower.json @@ -17,7 +17,7 @@ "ng-lodash": "~0.2.0", "angular-moment": "0.10.1", "moment": "2.10.3", - "angular-bitcore-wallet-client": "0.1.4", + "angular-bitcore-wallet-client": "0.1.2", "angular-ui-router": "~0.2.13", "qrcode-decoder-js": "*", "fastclick": "*", diff --git a/public/views/glidera.html b/public/views/glidera.html index 50a0de4ac..806ae8678 100644 --- a/public/views/glidera.html +++ b/public/views/glidera.html @@ -25,7 +25,7 @@
- +
@@ -43,7 +43,7 @@
-
@@ -78,41 +78,61 @@
-
+
-
{{index.glideraEmail}}
+
+ {{index.glideraEmail}} + (Unconfirmed) +
{{index.glideraPersonalInfo.firstName}} {{index.glideraPersonalInfo.lastName}} + ({{index.glideraStatus.personalInfoState}}) +
+ +
+ You need to setup a phone number +
+
+ You need to setup a bank account +
+
+ Bank account state: {{index.glideraStatus.bankAccountState}}
- - -
    -
  • +
      +
    • Buy
    • -
    • +
    • Sell
    • +
    • + Preferences + + + +

    Activity

    -
    No activity in your account
    diff --git a/src/js/controllers/buyGlidera.js b/src/js/controllers/buyGlidera.js index 63ac06939..e8d2b88ea 100644 --- a/src/js/controllers/buyGlidera.js +++ b/src/js/controllers/buyGlidera.js @@ -7,7 +7,7 @@ angular.module('copayApp.controllers').controller('buyGlideraController', this.show2faCodeInput = null; this.error = null; this.success = null; - this.loading = null; + this.loading = null; this.getBuyPrice = function(token, price) { var self = this; diff --git a/src/js/controllers/glidera.js b/src/js/controllers/glidera.js index 0c63b6ef3..8d66d9583 100644 --- a/src/js/controllers/glidera.js +++ b/src/js/controllers/glidera.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('glideraController', - function($scope, $timeout, $modal, applicationService, profileService, configService, storageService, glideraService) { + function($scope, $timeout, $modal, applicationService, profileService, configService, storageService, glideraService, isChromeApp) { var config = configService.getSync().wallet.settings; @@ -34,6 +34,14 @@ angular.module('copayApp.controllers').controller('glideraController', }, 100); }; + // DISABLE ANIMATION ON CHROMEAPP + if (isChromeApp) { + var animatedSlideRight = 'full'; + } + else { + var animatedSlideRight = 'full animated slideInRight'; + } + this.openTxModal = function(token, tx) { var self = this; var fc = profileService.focusedClient; @@ -54,7 +62,7 @@ angular.module('copayApp.controllers').controller('glideraController', var modalInstance = $modal.open({ templateUrl: 'views/modals/glidera-tx-details.html', - windowClass: 'full animated slideInRight', + windowClass: animatedSlideRight, controller: ModalInstanceCtrl, }); diff --git a/src/js/controllers/index.js b/src/js/controllers/index.js index 8704c9456..8b4e6e29f 100644 --- a/src/js/controllers/index.js +++ b/src/js/controllers/index.js @@ -113,7 +113,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r self.pendingTxProposalsCountForUs = null; self.setSpendUnconfirmed(); - self.glideraCredentials = null; self.glideraToken = null; self.glideraError = null; self.glideraPermissions = null; @@ -840,7 +839,7 @@ console.log('[index.js:395]',txps); //TODO self.initGlidera = function(accessToken) { if (self.isShared) return; - self.glideraCredentials = glideraService.init(self.network); + glideraService.setCredentials(self.network); var getToken = function(cb) { if (accessToken) { @@ -871,6 +870,12 @@ console.log('[index.js:395]',txps); //TODO self.updateGlidera = function(accessToken, permissions) { if (!accessToken || !permissions) return; + + self.glideraStatusLoaded = false; + glideraService.getStatus(accessToken, function(err, data) { + self.glideraStatusLoaded = true; + self.glideraStatus = data; + }); if (permissions.view_email_address) { self.glideraLoadingEmail = gettext('Getting Glidera Email...'); diff --git a/src/js/services/glideraService.js b/src/js/services/glideraService.js index 653c1291c..2fa48275a 100644 --- a/src/js/services/glideraService.js +++ b/src/js/services/glideraService.js @@ -4,7 +4,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l var root = {}; var credentials = {}; - root.init = function(network) { + root.setCredentials = function(network) { if (network == 'testnet') { credentials.HOST = 'https://sandbox.glidera.io'; credentials.REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'; @@ -17,7 +17,6 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l credentials.CLIENT_ID = ''; credentials.CLIENT_SECRET = ''; }; - return credentials; }; root.getOauthCodeUrl = function() {