delete popup rate card from settings

This commit is contained in:
Gabriel Bazán 2016-11-15 17:38:48 -03:00
parent 511730ecd3
commit 8e7e950eb2
10 changed files with 92 additions and 69 deletions

View File

@ -6,10 +6,6 @@ angular.module('copayApp.controllers').controller('rateCardController', function
$scope.score = 0;
$scope.goFeedbackFlow = function() {
if ($scope.isModal) {
$scope.rateModal.hide();
$scope.rateModal.remove();
}
if ($scope.isCordova && $scope.score == 5) {
$state.go('feedback.rateApp', {
score: $scope.score
@ -46,21 +42,16 @@ angular.module('copayApp.controllers').controller('rateCardController', function
};
$scope.hideCard = function() {
if ($scope.isModal) {
$scope.rateModal.hide();
$scope.rateModal.remove();
} else {
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = JSON.parse(info);
feedbackInfo.sent = true;
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {
$scope.showRateCard.value = false;
});
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = JSON.parse(info);
feedbackInfo.sent = true;
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {
$scope.showRateCard.value = false;
$timeout(function() {
$scope.$apply();
}, 100);
});
}
$timeout(function() {
$scope.$apply();
}, 100);
});
}
});

View File

@ -1,29 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $stateParams, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) {
$scope.score = parseInt($stateParams.score);
switch ($scope.score) {
case 1:
$scope.reaction = gettextCatalog.getString("Ouch!");
$scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong.") + ' ' + gettextCatalog.getString("How could we improve your experience?");
break;
case 2:
$scope.reaction = gettextCatalog.getString("Oh no!");
$scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong.") + ' ' + gettextCatalog.getString("How could we improve your experience?");
break;
case 3:
$scope.reaction = gettextCatalog.getString("Hmm...");
$scope.comment = gettextCatalog.getString("We'd love to do better.") + ' ' + gettextCatalog.getString("How could we improve your experience?");
break;
case 4:
$scope.reaction = gettextCatalog.getString("Thanks!");
$scope.comment = gettextCatalog.getString("That's exciting to hear. We'd love to earn that fifth star from you how could we improve your experience?");
break;
case 5:
$scope.reaction = gettextCatalog.getString("Thank you!");
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet.") + ' ' + gettextCatalog.getString("Is there anything we could do better?");
break;
}
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess) {
$scope.sendFeedback = function(feedback, skip) {
@ -32,7 +9,7 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
var dataSrc = {
"Email": lodash.values(config.emailFor)[0] || ' ',
"Feedback": skip ? ' ' : feedback,
"Score": $stateParams.score
"Score": $stateParams.score || ' '
};
ongoingProcess.set('sendingFeedback', true);
@ -42,6 +19,14 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send feedback'));
return;
}
if (!$stateParams.score) {
popupService.showAlert(gettextCatalog.getString('Thank you!'), gettextCatalog.getString('A member of the team will review your feedback as soon as possible.'));
$scope.feedback.value = '';
$timeout(function() {
$scope.$apply();
});
return;
}
$state.go('feedback.complete', {
score: $stateParams.score,
skipped: skip
@ -49,4 +34,36 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
});
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.score = parseInt($stateParams.score);
$scope.feedback = {};
switch ($scope.score) {
case 1:
$scope.reaction = gettextCatalog.getString("Ouch!");
$scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong.") + ' ' + gettextCatalog.getString("How could we improve your experience?");
break;
case 2:
$scope.reaction = gettextCatalog.getString("Oh no!");
$scope.comment = gettextCatalog.getString("There's obviously something we're doing wrong.") + ' ' + gettextCatalog.getString("How could we improve your experience?");
break;
case 3:
$scope.reaction = gettextCatalog.getString("Hmm...");
$scope.comment = gettextCatalog.getString("We'd love to do better.") + ' ' + gettextCatalog.getString("How could we improve your experience?");
break;
case 4:
$scope.reaction = gettextCatalog.getString("Thanks!");
$scope.comment = gettextCatalog.getString("That's exciting to hear. We'd love to earn that fifth star from you how could we improve your experience?");
break;
case 5:
$scope.reaction = gettextCatalog.getString("Thank you!");
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet.") + ' ' + gettextCatalog.getString("Is there anything we could do better?");
break;
default:
$scope.reaction = gettextCatalog.getString("Feedback!");
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve BitPay wallet. How could we improve your experience?");
break;
}
});
});

View File

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('searchController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $ionicNavBarDelegate, $state, $stateParams, $ionicScrollDelegate, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService) {
angular.module('copayApp.controllers').controller('searchController', function($scope, $rootScope, $interval, $timeout, $filter, $log, $ionicModal, $ionicPopover, $state, $stateParams, $ionicScrollDelegate, bwcError, profileService, lodash, configService, gettext, gettextCatalog, platformInfo, walletService) {
var HISTORY_SHOW_LIMIT = 10;
var currentTxHistoryPage = 0;

View File

@ -32,15 +32,4 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
updateConfig();
});
$scope.openRateModal = function() {
$scope.isModal = true;
$ionicModal.fromTemplateUrl('views/feedback/rateCard.html', {
scope: $scope,
backdropClickToClose: false,
hardwareBackButtonClose: false
}).then(function(modal) {
$scope.rateModal = modal;
$scope.rateModal.show();
});
}
});

View File

@ -722,7 +722,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
/*
*
* Feedback
* Feedback from home
*
*/
@ -758,11 +758,32 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
}
})
/*
*
* Buy or Sell Bitcoin
*
*/
/*
*
* Feedback from settings
*
*/
.state('tabs.settings.feedback', {
url: '/feedback',
abstract: true,
template: '<ion-nav-view name="feedback"></ion-nav-view>'
})
.state('tabs.settings.feedback.send', {
url: '/send',
views: {
'tab-settings@tabs': {
controller: 'sendController',
templateUrl: 'views/feedback/send.html'
}
}
})
/*
*
* Buy or Sell Bitcoin
*
*/
.state('tabs.buyandsell', {
url: '/buyandsell',

View File

@ -1,10 +1,10 @@
#rate-card {
.item-heading {
font-weight: 700;
}
.row {
border: none;
}
.row.row-margin{
margin: 20px 0px 20px 0px;
}
.item-icon-right {
margin: 0;
}

View File

@ -1,10 +1,11 @@
#send-feedback {
background-color: #ffffff;
.row {
padding: 20px;
border: none;
}
.skip {
margin: 20px 20px 10px;
margin: 8px 20px 10px;
color: #667;
text-decoration: none;
}

View File

@ -1,4 +1,4 @@
<div class="card" id="rate-card" ng-class="{'popup-modal': isModal}" ng-controller="rateCardController">
<div class="card" id="rate-card" ng-controller="rateCardController">
<div class="item item-icon-right item-heading">
<span translate>How do you like BitPay Wallet?</span>
<a ng-click="hideCard()" ><i class="icon ion-ios-close-empty close-home-tip"></i></a>

View File

@ -1,4 +1,8 @@
<ion-view id="send-feedback">
<ion-nav-bar class="bar-royal" ng-show="!score">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<a class="right skip" ng-click="sendFeedback(null,true)" href translate>Skip</a>
<ion-content class="has-header" scroll="false">
<div class="row item item-sub">
@ -24,9 +28,9 @@
<span translate>{{comment}}</span>
</div>
<div>
<textarea ng-model="feedback" placeholder="Your ideas, feedback, or comments" row="40"></textarea>
<textarea ng-model="feedback.value" placeholder="Your ideas, feedback, or comments" row="40"></textarea>
</div>
<button ng-disabled="!feedback" type="submit" class="button button-full button-primary" ng-click="sendFeedback(feedback, false)" translate>
<button ng-disabled="!feedback.value" type="submit" class="button button-full button-primary" ng-click="sendFeedback(feedback.value, false)" translate>
Send
</button>
</ion-content>

View File

@ -29,7 +29,7 @@
<img src="img/icon-link.svg" class="bg just-a-hint"/>
</i>
</a>
<a class="item item-icon-left item-icon-right" ng-click="openRateModal()">
<a class="item item-icon-left item-icon-right" ui-sref="tabs.settings.feedback.send">
<i class="icon big-icon-svg">
<img src="img/icon-send-feedback.svg" class="bg"/>
</i>