adding send feedback option in settings
This commit is contained in:
parent
db8f16c362
commit
80888f63a1
14 changed files with 132 additions and 102 deletions
61
src/js/controllers/feedback/rateCard.js
Normal file
61
src/js/controllers/feedback/rateCard.js
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
angular.module('copayApp.controllers').controller('rateCardController', function($scope, $state, $timeout, gettextCatalog, storageService) {
|
||||||
|
|
||||||
|
$scope.goFeedbackFlow = function() {
|
||||||
|
if ($scope.isModal) {
|
||||||
|
$scope.rateModal.hide();
|
||||||
|
$scope.rateModal.remove();
|
||||||
|
}
|
||||||
|
if ($scope.isCordova && $scope.score == 5) {
|
||||||
|
$state.go('feedback.rateAppStore', {
|
||||||
|
score: $scope.score
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$state.go('feedback.sendFeedback', {
|
||||||
|
score: $scope.score
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.setScore = function(score) {
|
||||||
|
$scope.score = score;
|
||||||
|
switch ($scope.score) {
|
||||||
|
case 1:
|
||||||
|
$scope.button_title = gettextCatalog.getString("I think this app is terrible");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$scope.button_title = gettextCatalog.getString("I don't like it");
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$scope.button_title = gettextCatalog.getString("Meh - it's alright");
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$scope.button_title = gettextCatalog.getString("I like the app");
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
$scope.button_title = gettextCatalog.getString("This app is fantastic");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$apply();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.cancel = function() {};
|
||||||
|
|
||||||
|
$scope.hideCard = function() {
|
||||||
|
if ($scope.isModal) {
|
||||||
|
$scope.rateModal.hide();
|
||||||
|
$scope.rateModal.remove();
|
||||||
|
} else {
|
||||||
|
storageService.setRateCardFlag('true', function() {
|
||||||
|
$scope.hideRateCard.value = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$apply();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
@ -26,12 +26,12 @@ angular.module('copayApp.controllers').controller('sendFeedbackController', func
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.sendFeedback = function(feedback) {
|
$scope.sendFeedback = function(feedback, skip) {
|
||||||
|
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
var dataSrc = {
|
var dataSrc = {
|
||||||
"entry.490635314": lodash.values(config.emailFor)[0] || 'no email setted',
|
"entry.490635314": lodash.values(config.emailFor)[0] || 'no email setted',
|
||||||
"entry.1447064148": feedback,
|
"entry.1447064148": skip ? '-' : feedback,
|
||||||
"entry.2142850951": $stateParams.score
|
"entry.2142850951": $stateParams.score
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -39,11 +39,14 @@ angular.module('copayApp.controllers').controller('sendFeedbackController', func
|
||||||
$log.info("SUCCESS: Feedback sent");
|
$log.info("SUCCESS: Feedback sent");
|
||||||
$state.go('feedback.thanks', {
|
$state.go('feedback.thanks', {
|
||||||
score: $stateParams.score,
|
score: $stateParams.score,
|
||||||
skipped: false
|
skipped: skip
|
||||||
});
|
});
|
||||||
}, function(data) {
|
}, function(data) {
|
||||||
$log.info("Could not send feedback");
|
$log.info("ERROR: Feedback sent anyway.");
|
||||||
popupService.showAlert(gettextCatalog.getString("Error"), gettextCatalog.getString("Could not send feedback, try again please"));
|
$state.go('feedback.thanks', {
|
||||||
|
score: $stateParams.score,
|
||||||
|
skipped: skip
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -58,11 +61,4 @@ angular.module('copayApp.controllers').controller('sendFeedbackController', func
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.skip = function() {
|
|
||||||
$state.go('feedback.thanks', {
|
|
||||||
score: $scope.score,
|
|
||||||
skipped: true
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,10 @@ angular.module('copayApp.controllers').controller('thanksController', function($
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
|
storageService.setRateCardFlag('true', function() {});
|
||||||
if (!$scope.isCordova) return;
|
if (!$scope.isCordova) return;
|
||||||
|
|
||||||
window.plugins.socialsharing.available(function(isAvailable) {
|
window.plugins.socialsharing.available(function(isAvailable) {
|
||||||
storageService.setRateCardFlag('true', function() {});
|
|
||||||
// the boolean is only false on iOS < 6
|
// the boolean is only false on iOS < 6
|
||||||
$scope.socialsharing = isAvailable;
|
$scope.socialsharing = isAvailable;
|
||||||
if (isAvailable) {
|
if (isAvailable) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
$scope.isAndroid = platformInfo.isAndroid;
|
$scope.isAndroid = platformInfo.isAndroid;
|
||||||
$scope.isNW = platformInfo.isNW;
|
$scope.isNW = platformInfo.isNW;
|
||||||
|
$scope.hideRateCard = {};
|
||||||
|
|
||||||
$scope.$on("$ionicView.afterEnter", function() {
|
$scope.$on("$ionicView.afterEnter", function() {
|
||||||
startupService.ready();
|
startupService.ready();
|
||||||
|
|
@ -37,7 +38,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
}
|
}
|
||||||
|
|
||||||
storageService.getRateCardFlag(function(error, value) {
|
storageService.getRateCardFlag(function(error, value) {
|
||||||
$scope.hideRateCard = (value == 'true') ? true : false;
|
$scope.hideRateCard.value = (value == 'true') ? true : false;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
@ -108,51 +109,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
||||||
externalLinkService.open(url, optIn, title, message, okText, cancelText);
|
externalLinkService.open(url, optIn, title, message, okText, cancelText);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.hideCard = function() {
|
|
||||||
storageService.setRateCardFlag('true', function() {
|
|
||||||
$scope.hideRateCard = true;
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$scope.setScore = function(score) {
|
|
||||||
$scope.score = score;
|
|
||||||
switch ($scope.score) {
|
|
||||||
case 1:
|
|
||||||
$scope.button_title = gettextCatalog.getString("I think this app is terrible");
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$scope.button_title = gettextCatalog.getString("I don't like it");
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$scope.button_title = gettextCatalog.getString("Meh - it's alright");
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$scope.button_title = gettextCatalog.getString("I like the app");
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$scope.button_title = gettextCatalog.getString("This app is fantastic");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.goFeedbackFlow = function() {
|
|
||||||
if ($scope.isCordova && $scope.score == 5) {
|
|
||||||
$state.go('feedback.rateAppStore', {
|
|
||||||
score: $scope.score
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$state.go('feedback.sendFeedback', {
|
|
||||||
score: $scope.score
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.openNotificationModal = function(n) {
|
$scope.openNotificationModal = function(n) {
|
||||||
wallet = profileService.getWallet(n.walletId);
|
wallet = profileService.getWallet(n.walletId);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $window, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService) {
|
angular.module('copayApp.controllers').controller('tabSettingsController', function($scope, $window, $ionicModal, uxLanguage, platformInfo, profileService, feeService, configService, externalLinkService) {
|
||||||
|
|
||||||
var updateConfig = function() {
|
var updateConfig = function() {
|
||||||
|
|
||||||
|
|
@ -32,4 +32,15 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
|
||||||
updateConfig();
|
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();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
22
src/sass/views/feedback/rateCard.scss
Normal file
22
src/sass/views/feedback/rateCard.scss
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
#rate-card {
|
||||||
|
.stars {
|
||||||
|
display: flex;
|
||||||
|
border-bottom: none;
|
||||||
|
.button {
|
||||||
|
background-color: #fff;
|
||||||
|
outline: none;
|
||||||
|
border: none;
|
||||||
|
height:10px;
|
||||||
|
width:10px;
|
||||||
|
}
|
||||||
|
.gold {
|
||||||
|
color: #ffd700;
|
||||||
|
}
|
||||||
|
.subtle-gray {
|
||||||
|
color: $subtle-gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.feedback-flow-button {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#send-feedback {
|
#send-feedback {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
.skip {
|
.skip {
|
||||||
margin: 10px;
|
margin: 20px 20px 10px;
|
||||||
color: #667;
|
color: #667;
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
.item-heading {
|
.item-heading {
|
||||||
border-style: none;
|
border-style: none;
|
||||||
margin-top: 5px;
|
margin-top: 10px;
|
||||||
a {
|
a {
|
||||||
color: $dark-gray;
|
color: $dark-gray;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,24 +118,4 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.stars {
|
|
||||||
display: flex;
|
|
||||||
border-bottom: none;
|
|
||||||
.button {
|
|
||||||
background-color: #fff;
|
|
||||||
outline: none;
|
|
||||||
border: none;
|
|
||||||
height:10px;
|
|
||||||
width:10px;
|
|
||||||
}
|
|
||||||
.gold {
|
|
||||||
color: #ffd700;
|
|
||||||
}
|
|
||||||
.subtle-gray {
|
|
||||||
color: $subtle-gray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.feedback-flow-button {
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
@import "wallet-backup-phrase";
|
@import "wallet-backup-phrase";
|
||||||
@import "zero-state";
|
@import "zero-state";
|
||||||
@import "onboarding/onboarding";
|
@import "onboarding/onboarding";
|
||||||
|
@import "feedback/rateCard";
|
||||||
@import "feedback/sendFeedback";
|
@import "feedback/sendFeedback";
|
||||||
@import "feedback/thanks";
|
@import "feedback/thanks";
|
||||||
@import "feedback/rateAppStore";
|
@import "feedback/rateAppStore";
|
||||||
|
|
|
||||||
18
www/views/feedback/rateCard.html
Normal file
18
www/views/feedback/rateCard.html
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div id="rate-card" ng-class="{'popup-modal': isModal}" 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>
|
||||||
|
</div>
|
||||||
|
<div class="stars item item-sub">
|
||||||
|
<button class="button icon ion-android-star" ng-click="setScore(1)" ng-class="{'gold': 1 <= score, 'subtle-gray': 1 > score}"></button>
|
||||||
|
<button class="button icon ion-android-star" ng-click="setScore(2)" ng-class="{'gold': 2 <= score, 'subtle-gray': 2 > score}"></button>
|
||||||
|
<button class="button icon ion-android-star" ng-click="setScore(3)" ng-class="{'gold': 3 <= score, 'subtle-gray': 3 > score}"></button>
|
||||||
|
<button class="button icon ion-android-star" ng-click="setScore(4)" ng-class="{'gold': 4 <= score, 'subtle-gray': 4 > score}"></button>
|
||||||
|
<button class="button icon ion-android-star" ng-click="setScore(5)" ng-class="{'gold': 5 == score, 'subtle-gray': 5 > score}"></button>
|
||||||
|
</div>
|
||||||
|
<div class="feedback-flow-button" ng-if="button_title">
|
||||||
|
<button type="submit" class="button button-standard button-primary" ng-click="goFeedbackFlow()">
|
||||||
|
<span>{{button_title}}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<ion-view id="send-feedback">
|
<ion-view id="send-feedback">
|
||||||
<ion-content scroll="false">
|
<ion-content scroll="false">
|
||||||
<a class="right skip" ng-click="skip()">Skip</a>
|
<a class="right skip" ng-click="sendFeedback(null,true)">Skip</a>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-40 title">
|
<div class="col col-40 title">
|
||||||
<span>{{reaction}}</span>
|
<span>{{reaction}}</span>
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
<textarea ng-model="feedback" placeholder="Is there anything we could do to improve your experience?" row="40"></textarea>
|
<textarea ng-model="feedback" placeholder="Is there anything we could do to improve your experience?" row="40"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="padding">
|
<div class="padding">
|
||||||
<button ng-disabled="!feedback" type="submit" class="button button-full button-primary" ng-click="sendFeedback(feedback)" translate>
|
<button ng-disabled="!feedback" type="submit" class="button button-full button-primary" ng-click="sendFeedback(feedback, false)" translate>
|
||||||
Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,23 +13,8 @@
|
||||||
<div class="release ng-hide" ng-show="newRelease" ng-click="openExternalLink('https://github.com/bitpay/copay/releases/latest', true, 'Update Available', 'An update to this app is available. For your security, please update to the latest version.', 'View Update', 'Go Back')">
|
<div class="release ng-hide" ng-show="newRelease" ng-click="openExternalLink('https://github.com/bitpay/copay/releases/latest', true, 'Update Available', 'An update to this app is available. For your security, please update to the latest version.', 'View Update', 'Go Back')">
|
||||||
<span translate>An update to this app is available</span><span><i class="icon bp-arrow-right"></i></span>
|
<span translate>An update to this app is available</span><span><i class="icon bp-arrow-right"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="list card ng-hide" ng-show="!hideRateCard">
|
<div class="list card ng-hide" ng-show="!hideRateCard.value">
|
||||||
<div class="item item-icon-right item-heading">
|
<span ng-include="'views/feedback/rateCard.html'"></span>
|
||||||
<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>
|
|
||||||
</div>
|
|
||||||
<div class="stars item item-sub">
|
|
||||||
<button class="button icon ion-android-star" ng-click="setScore(1)" ng-class="{'gold': 1 <= score, 'subtle-gray': 1 > score}"></button>
|
|
||||||
<button class="button icon ion-android-star" ng-click="setScore(2)" ng-class="{'gold': 2 <= score, 'subtle-gray': 2 > score}"></button>
|
|
||||||
<button class="button icon ion-android-star" ng-click="setScore(3)" ng-class="{'gold': 3 <= score, 'subtle-gray': 3 > score}"></button>
|
|
||||||
<button class="button icon ion-android-star" ng-click="setScore(4)" ng-class="{'gold': 4 <= score, 'subtle-gray': 4 > score}"></button>
|
|
||||||
<button class="button icon ion-android-star" ng-click="setScore(5)" ng-class="{'gold': 5 == score, 'subtle-gray': 5 > score}"></button>
|
|
||||||
</div>
|
|
||||||
<div class="feedback-flow-button" ng-if="button_title">
|
|
||||||
<button type="submit" class="button button-standard button-primary" ng-click="goFeedbackFlow()">
|
|
||||||
<span>{{button_title}}</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="list card homeTip" ng-if="homeTip">
|
<div class="list card homeTip" ng-if="homeTip">
|
||||||
<div class="item item-icon-right item-heading">
|
<div class="item item-icon-right item-heading">
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
<img src="img/icon-link.svg" class="bg just-a-hint"/>
|
<img src="img/icon-link.svg" class="bg just-a-hint"/>
|
||||||
</i>
|
</i>
|
||||||
</a>
|
</a>
|
||||||
<a class="ng-hide item item-icon-left item-icon-right" ng-hide="true">
|
<a class="ng-hide item item-icon-left item-icon-right" ng-show="true" ng-click="openRateModal()">
|
||||||
<i class="icon big-icon-svg">
|
<i class="icon big-icon-svg">
|
||||||
<img src="img/icon-send-feedback.svg" class="bg"/>
|
<img src="img/icon-send-feedback.svg" class="bg"/>
|
||||||
</i>
|
</i>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue