made onboarding shorter and removed unused files

This commit is contained in:
Kadir Sekha 2018-02-02 12:19:42 -04:00
commit 508d358e86
9 changed files with 1 additions and 317 deletions

View file

@ -1,41 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, $ionicConfig, popupService, gettextCatalog) {
$scope.bchWalletId = $stateParams.bchWalletId;
$scope.btcWalletId = $stateParams.btcWalletId;
$scope.$on("$ionicView.enter", function() {
$ionicConfig.views.swipeBackEnabled(false);
});
$scope.$on("$ionicView.beforeLeave", function() {
$ionicConfig.views.swipeBackEnabled(true);
});
$scope.openPopup = function() {
var title = gettextCatalog.getString('Watch out!');
var message = gettextCatalog.getString('If this device is replaced or this app is deleted, neither you nor Bitcoin.com can recover your funds without a backup.');
var okText = gettextCatalog.getString('I understand');
var cancelText = gettextCatalog.getString('Go back');
popupService.showConfirm(title, message, okText, cancelText, function(val) {
if (val) {
var title = gettextCatalog.getString('Are you sure you want to skip it?');
var message = gettextCatalog.getString('You can create a backup later from your wallet settings.');
var okText = gettextCatalog.getString('Yes, skip');
var cancelText = gettextCatalog.getString('Go back');
popupService.showConfirm(title, message, okText, cancelText, function(val) {
if (val) {
$state.go('onboarding.disclaimer', {
bchWalletId: $scope.bchWalletId,
btcWalletId: $scope.btcWalletId,
backedUp: false
});
}
});
}
});
}
});

View file

@ -1,55 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('backupWarningController', function($scope, $state, $timeout, $stateParams, $ionicModal) {
if ($stateParams.from == 'onboarding') {
$scope.bchWalletId = $stateParams.bchWalletId;
$scope.btcWalletId = $stateParams.btcWalletId;
$scope.fromState = $stateParams.from + '.backupRequest' ;
} else {
$scope.walletId = $stateParams.walletId;
$scope.fromState = $stateParams.from;
}
$scope.toState = $stateParams.from + '.backup';
$scope.openPopup = function() {
$ionicModal.fromTemplateUrl('views/includes/screenshotWarningModal.html', {
scope: $scope,
backdropClickToClose: true,
hardwareBackButtonClose: true
}).then(function(modal) {
$scope.warningModal = modal;
$scope.warningModal.show();
});
$scope.close = function() {
$scope.warningModal.remove();
$timeout(function() {
if ($stateParams.from == 'onboarding') {
$state.go($scope.toState, {
bchWalletId: $scope.bchWalletId,
btcWalletId: $scope.btcWalletId
});
} else {
$state.go($scope.toState, {
walletId: $scope.walletId
});
}
}, 200);
};
}
$scope.goBack = function() {
if ($stateParams.from == 'onboarding') {
$state.go($scope.fromState, {
bchWalletId: $scope.bchWalletId,
btcWalletId: $scope.btcWalletId
});
} else {
$state.go($scope.fromState, {
walletId: $scope.walletId
});
}
};
});

View file

@ -73,10 +73,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
};
$scope.goNextView = function() {
$state.go('onboarding.backupRequest', {
bchWalletId: bchWalletId,
btcWalletId: btcWalletId
});
$state.go('tabs.home');
};
$scope.confirm = function(emailForm) {

View file

@ -1,55 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, $ionicConfig, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope, firebaseEventsService) {
$scope.$on("$ionicView.afterEnter", function() {
startupService.ready();
});
$scope.$on("$ionicView.beforeEnter", function() {
$scope.lang = uxLanguage.currentLanguage;
$scope.terms = {};
$scope.accepted = {};
$scope.accepted.first = $scope.accepted.second = $scope.accepted.third = false;
$scope.backedUp = $stateParams.backedUp == 'false' ? false : true;
$scope.resume = $stateParams.resume || false;
$scope.shrinkView = false;
});
$scope.$on("$ionicView.enter", function() {
if ($scope.backedUp || $scope.resume) $ionicConfig.views.swipeBackEnabled(false);
});
$scope.$on("$ionicView.beforeLeave", function() {
$ionicConfig.views.swipeBackEnabled(true);
});
$scope.confirm = function() {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
else {
firebaseEventsService.logEvent('completed_onboarding');
$state.go('tabs.home', {
fromOnboarding: true
});
}
});
};
$scope.openExternalLink = function(url, target) {
externalLinkService.open(url, target);
};
$scope.openTerms = function() {
$scope.shrinkView = !$scope.shrinkView;
}
$scope.goBack = function() {
$state.go('onboarding.backupRequest', {
bchWalletId: $stateParams.bchWalletId,
btcWalletId: $stateParams.btcWalletId
});
}
});

View file

@ -1,27 +0,0 @@
'use strict';
angular.module('copayApp.controllers').controller('termsController', function($scope, $log, $state, appConfigService, uxLanguage, profileService, externalLinkService, gettextCatalog) {
$scope.lang = uxLanguage.currentLanguage;
$scope.confirm = function() {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
else {
$state.go('tabs.home', {
fromOnboarding: true
});
}
});
};
$scope.openExternalLink = function() {
var url = appConfigService.disclaimerUrl;
var optIn = true;
var title = gettextCatalog.getString('View Terms of Service');
var message = gettextCatalog.getString('The official English Terms of Service are available on the BitPay website.');
var okText = gettextCatalog.getString('Open Website');
var cancelText = gettextCatalog.getString('Go Back');
externalLinkService.open(url, optIn, title, message, okText, cancelText);
};
});

View file

@ -782,51 +782,6 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
.state('onboarding.backupRequest', {
url: '/backupRequest/:bchWalletId/:btcWalletId',
views: {
'onboarding': {
templateUrl: 'views/onboarding/backupRequest.html',
controller: 'backupRequestController'
}
}
})
.state('onboarding.backupWarning', {
url: '/backupWarning/:from/:walletId/:bchWalletId/:btcWalletId',
views: {
'onboarding': {
templateUrl: 'views/backupWarning.html',
controller: 'backupWarningController'
}
}
})
.state('onboarding.backup', {
url: '/backup/:walletId/:bchWalletId/:btcWalletId',
views: {
'onboarding': {
templateUrl: 'views/backup.html',
controller: 'backupController'
}
}
})
.state('onboarding.disclaimer', {
url: '/disclaimer/:bchWalletId/:btcWalletId/:backedUp/:resume',
views: {
'onboarding': {
templateUrl: 'views/onboarding/disclaimer.html',
controller: 'disclaimerController'
}
}
})
.state('onboarding.terms', {
url: '/terms',
views: {
'onboarding': {
templateUrl: 'views/onboarding/terms.html',
controller: 'termsController'
}
}
})
.state('onboarding.import', {
url: '/import',
views: {

View file

@ -1,15 +0,0 @@
<ion-view id="onboarding-backup-request" class="onboarding">
<ion-content scroll="false">
<div id="warning">
<img class="svg" src="img/onboarding-warning.svg" id="alert-icon">
<div class="onboarding-topic" translate>No backup, no bitcoin.</div>
<div class="onboarding-description" id="backup-description" translate>Since only you control your money, youll need to save your backup phrase in case this app is deleted.</div>
</div>
<div class="cta-buttons">
<i class="ion-ios-arrow-thin-down" id="arrow-down"></i>
<div class="onboarding-tldr" id="backup-tldr" translate>Your wallet is never saved to cloud storage or standard device backups.</div>
<button class="button button-standard button-primary" ui-sref="onboarding.backupWarning({from: 'onboarding', bchWalletId: bchWalletId, btcWalletId: btcWalletId})" translate>Backup wallet</button>
<button class="button button-standard button-secondary" ng-click="openPopup()" translate>Do it later</button>
</div>
</ion-content>
</ion-view>

View file

@ -1,47 +0,0 @@
<ion-pane class="pane-onboarding">
<ion-view id="onboarding-disclaimer" class="onboarding" ng-class="{'shrink': shrinkView}">
<ion-nav-bar class="bar-stable" ng-if="!backedUp">
<ion-nav-title></ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button back-button button-clear" ng-click="goBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content scroll="false" ng-class="{'has-header': !backedUp}">
<div id="onboarding-disclaimer-container">
<div ng-show="resume" class="onboarding-topic" id="disclaimer-topic" translate>Quick review!</div>
<div ng-show="!resume" class="onboarding-topic" id="disclaimer-topic" translate>Almost done! Let's review.</div>
<div class="onboarding-description" id="disclaimer-description" translate>Bitcoin is different &ndash; it cannot be safely held with a bank or web service.</div>
<ion-list>
<ion-checkbox ng-model="accepted.first">
<span translate>I understand that my funds are held securely on this device, not by a company.</span>
</ion-checkbox>
<ion-checkbox ng-model="accepted.second">
<span translate>I understand that if this app is moved to another device or deleted, my bitcoin can only be recovered with the backup phrase.</span>
</ion-checkbox>
</ion-list>
</div>
</ion-content>
</ion-view>
<div id="terms-of-use" ng-class="{'slideUp': shrinkView}">
<ion-nav-bar>
<ion-nav-title>{{'Terms of Use' | translate}}</ion-nav-title>
<ion-nav-buttons side="primary">
<button class="button no-border" ng-click="openTerms()">
<i class="ion-ios-arrow-down"></i>
</button>
</ion-nav-buttons>
</ion-nav-bar>
<div class="has-header">
<div ng-include="'views/includes/terms.html'" direction="y"></div>
</div>
</div>
<div id="agree-to-terms" ng-if="accepted.first && accepted.second" ng-class="{'header-present': !backedUp}">
<div id="agree-to-terms-content" class="center-block">
<ion-checkbox ng-model="terms.accepted"></ion-checkbox>
<p translate>I have read, understood, and agree to the <a ng-click="openTerms()" translate>Terms of Use</a>.</p>
<button ng-disabled="!accepted.first || !accepted.second || !terms.accepted" class="button button-block button-primary" ng-click="confirm()" translate>Confirm &amp; Finish</button>
</div>
</div>
</ion-pane>

View file

@ -13,34 +13,6 @@
</ion-nav-buttons>
</ion-nav-bar>
<ion-slides class="slides" options="options" slider="data.slider">
<ion-slide-page>
<ion-content id="onboard-tour-secure" scroll="false">
<div class="onboarding-topic" translate>Bitcoin is secure,<br/>digital money.</div>
<div class="onboarding-description" translate>You can spend bitcoin at millions of websites and stores worldwide.</div>
<div class="onboarding-illustration-secure"></div>
<div class="cta-buttons">
<div class="onboarding-tldr" translate>Just scan the code to pay.</div>
<button class="button button-standard button-secondary" ng-click="slideNext()" translate>
Got it
</button>
</div>
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content id="onboard-tour-currency" scroll="false">
<div class="onboarding-topic" translate>Bitcoin is a currency.</div>
<div class="onboarding-description" translate>You can trade it for other currencies like US Dollars, Euros, or Pounds.</div>
<div class="onboarding-illustration-currency">
<div id="onboarding-illustration-currency-exchange-rate">1 BTC = {{localCurrencySymbol}}{{localCurrencyPerBtc}}</div>
</div>
<div class="cta-buttons">
<div class="onboarding-tldr" translate>The exchange rate changes with the market.</div>
<button class="button button-standard button-secondary" ng-click="slideNext()" translate>
Makes sense
</button>
</div>
</ion-content>
</ion-slide-page>
<ion-slide-page>
<ion-content id="onboard-tour-control" scroll="false">
<div class="onboarding-topic" translate>You control your bitcoin.</div>