Removed all references to the rating card & feedback
This commit is contained in:
parent
e8f2f2d188
commit
9396c7c97f
19 changed files with 17 additions and 652 deletions
|
|
@ -1,53 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('rateAppController', function($scope, $state, $stateParams, $window, lodash, externalLinkService, configService, platformInfo, feedbackService, ongoingProcess, popupService, appConfigService) {
|
||||
$scope.score = parseInt($stateParams.score);
|
||||
$scope.appName = appConfigService.nameCase;
|
||||
var isAndroid = platformInfo.isAndroid;
|
||||
var isIOS = platformInfo.isIOS;
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
$scope.skip = function() {
|
||||
var dataSrc = {
|
||||
"Email": lodash.values(config.emailFor)[0] || ' ',
|
||||
"Feedback": ' ',
|
||||
"Score": $stateParams.score,
|
||||
"AppVersion": $window.version,
|
||||
"Platform": ionic.Platform.platform(),
|
||||
"DeviceVersion": ionic.Platform.version()
|
||||
};
|
||||
feedbackService.send(dataSrc, function(err) {
|
||||
if (err) {
|
||||
// try to send, but not essential, since the user didn't add a message
|
||||
$log.warn('Could not send feedback.');
|
||||
}
|
||||
});
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score,
|
||||
skipped: true
|
||||
});
|
||||
};
|
||||
|
||||
$scope.sendFeedback = function() {
|
||||
$state.go('tabs.rate.send', {
|
||||
score: $scope.score
|
||||
});
|
||||
};
|
||||
|
||||
$scope.goAppStore = function() {
|
||||
var defaults = configService.getDefaults();
|
||||
var url;
|
||||
if (isAndroid)
|
||||
url = defaults.rateApp.bitcoincom.android;
|
||||
if (isIOS)
|
||||
url = defaults.rateApp.bitcoincom.ios;
|
||||
|
||||
externalLinkService.open(url);
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score,
|
||||
skipped: true,
|
||||
rated: true
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('rateCardController', function($scope, $state, $timeout, $log, gettextCatalog, platformInfo, storageService, appConfigService) {
|
||||
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.score = 0;
|
||||
$scope.appName = appConfigService.nameCase;
|
||||
|
||||
$scope.goFeedbackFlow = function() {
|
||||
$scope.hideCard();
|
||||
if ($scope.isCordova && $scope.score == 5) {
|
||||
$state.go('tabs.rate.rateApp', {
|
||||
score: $scope.score
|
||||
});
|
||||
} else {
|
||||
$state.go('tabs.rate.send', {
|
||||
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.hideCard = function() {
|
||||
$log.debug('Feedback card dismissed.')
|
||||
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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('sendController', function($scope, $state, $log, $timeout, $stateParams, $ionicNavBarDelegate, $ionicHistory, $ionicConfig, $window, gettextCatalog, popupService, configService, lodash, feedbackService, ongoingProcess, platformInfo, appConfigService) {
|
||||
|
||||
$scope.sendFeedback = function(feedback, goHome) {
|
||||
|
||||
var config = configService.getSync();
|
||||
|
||||
var dataSrc = {
|
||||
"Email": lodash.values(config.emailFor)[0] || ' ',
|
||||
"Feedback": goHome ? ' ' : feedback,
|
||||
"Score": $stateParams.score || ' ',
|
||||
"AppVersion": $window.version,
|
||||
"Platform": ionic.Platform.platform(),
|
||||
"DeviceVersion": ionic.Platform.version()
|
||||
};
|
||||
|
||||
if (!goHome) ongoingProcess.set('sendingFeedback', true);
|
||||
feedbackService.send(dataSrc, function(err) {
|
||||
if (goHome) return;
|
||||
ongoingProcess.set('sendingFeedback', false);
|
||||
if (err) {
|
||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Feedback could not be submitted. Please try again later.'));
|
||||
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.'), function() {
|
||||
$scope.feedback.value = '';
|
||||
$ionicHistory.nextViewOptions({
|
||||
disableAnimate: false,
|
||||
historyRoot: true
|
||||
});
|
||||
$ionicHistory.goBack();
|
||||
}, gettextCatalog.getString('Finish'));
|
||||
return;
|
||||
}
|
||||
$state.go('tabs.rate.complete', {
|
||||
score: $stateParams.score
|
||||
});
|
||||
});
|
||||
if (goHome) $state.go('tabs.home');
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeLeave", function(event, data) {
|
||||
$ionicConfig.views.swipeBackEnabled(true);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
if ($scope.score)
|
||||
$ionicConfig.views.swipeBackEnabled(false);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
||||
$scope.feedback = {};
|
||||
|
||||
switch ($scope.score) {
|
||||
case 1:
|
||||
$scope.reaction = "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 = "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 {{appName}}.", {
|
||||
appName: appConfigService.nameCase
|
||||
}) + ' ' + gettextCatalog.getString("Is there anything we could do better?");
|
||||
break;
|
||||
default:
|
||||
$scope.justFeedback = true;
|
||||
$scope.comment = gettextCatalog.getString("We're always looking for ways to improve {{appName}}. How could we improve your experience?", {
|
||||
appName: appConfigService.nameCase
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.afterEnter", function() {
|
||||
$scope.showForm = true;
|
||||
});
|
||||
|
||||
$scope.goBack = function() {
|
||||
$ionicHistory.nextViewOptions({
|
||||
disableAnimate: false,
|
||||
historyRoot: true
|
||||
});
|
||||
$ionicHistory.goBack();
|
||||
};
|
||||
|
||||
});
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, $ionicNavBarDelegate, $ionicConfig, platformInfo, configService, storageService, lodash, appConfigService, gettextCatalog) {
|
||||
angular.module('copayApp.controllers').controller('shareAppController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, $ionicNavBarDelegate, $ionicConfig, platformInfo, configService, storageService, lodash, appConfigService, gettextCatalog) {
|
||||
$scope.isCordova = platformInfo.isCordova;
|
||||
$scope.title = gettextCatalog.getString("Share {{appName}}", {
|
||||
appName: appConfigService.nameCase
|
||||
|
|
@ -57,28 +57,8 @@ angular.module('copayApp.controllers').controller('completeController', function
|
|||
$ionicConfig.views.swipeBackEnabled(true);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.enter", function() {
|
||||
if (!$scope.fromSettings)
|
||||
$ionicConfig.views.swipeBackEnabled(false);
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
||||
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
|
||||
$scope.rated = (data.stateParams && data.stateParams.rated) ? true : false;
|
||||
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
|
||||
|
||||
if (!$scope.fromSettings) {
|
||||
$ionicNavBarDelegate.showBackButton(false);
|
||||
} else {
|
||||
$ionicNavBarDelegate.showBackButton(true);
|
||||
}
|
||||
|
||||
storageService.getFeedbackInfo(function(error, info) {
|
||||
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;
|
||||
feedbackInfo.sent = true;
|
||||
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {});
|
||||
});
|
||||
$ionicNavBarDelegate.showBackButton(true);
|
||||
|
||||
if (!$scope.isCordova) return;
|
||||
$scope.animate = true;
|
||||
|
|
@ -133,13 +113,4 @@ angular.module('copayApp.controllers').controller('completeController', function
|
|||
}
|
||||
}, 100);
|
||||
});
|
||||
|
||||
$scope.close = function() {
|
||||
$ionicHistory.nextViewOptions({
|
||||
disableAnimate: false,
|
||||
historyRoot: true
|
||||
});
|
||||
if ($scope.score == 5) $ionicHistory.goBack(-3);
|
||||
else $ionicHistory.goBack(-2);
|
||||
};
|
||||
});
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('tabHomeController',
|
||||
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, feedbackService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) {
|
||||
function($rootScope, $timeout, $scope, $state, $stateParams, $ionicModal, $ionicScrollDelegate, $window, gettextCatalog, lodash, popupService, ongoingProcess, externalLinkService, latestReleaseService, profileService, walletService, configService, $log, platformInfo, storageService, txpModalService, appConfigService, startupService, addressbookService, bwcError, nextStepsService, buyAndSellService, homeIntegrationsService, bitpayCardService, pushNotificationsService, timeService, bitcoincomService, pricechartService, firebaseEventsService, servicesService, shapeshiftService, $ionicNavBarDelegate, signVerifyMessageService) {
|
||||
var wallet;
|
||||
var listeners = [];
|
||||
var notifications = [];
|
||||
|
|
@ -14,7 +14,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
$scope.isAndroid = platformInfo.isAndroid;
|
||||
$scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
|
||||
$scope.isNW = platformInfo.isNW;
|
||||
$scope.showRateCard = {};
|
||||
$scope.showServices = false;
|
||||
|
||||
$scope.$on("$ionicView.afterEnter", function() {
|
||||
|
|
@ -42,43 +41,6 @@ angular.module('copayApp.controllers').controller('tabHomeController',
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
storageService.getFeedbackInfo(function(error, info) {
|
||||
|
||||
if ($scope.isWindowsPhoneApp) {
|
||||
$scope.showRateCard.value = false;
|
||||
return;
|
||||
}
|
||||
if (!info) {
|
||||
initFeedBackInfo();
|
||||
} else {
|
||||
var feedbackInfo = JSON.parse(info);
|
||||
//Check if current version is greater than saved version
|
||||
var currentVersion = $scope.version;
|
||||
var savedVersion = feedbackInfo.version;
|
||||
var isVersionUpdated = feedbackService.isVersionUpdated(currentVersion, savedVersion);
|
||||
if (!isVersionUpdated) {
|
||||
initFeedBackInfo();
|
||||
return;
|
||||
}
|
||||
var now = moment().unix();
|
||||
var timeExceeded = (now - feedbackInfo.time) >= 24 * 7 * 60 * 60;
|
||||
$scope.showRateCard.value = timeExceeded && !feedbackInfo.sent;
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function initFeedBackInfo() {
|
||||
var feedbackInfo = {};
|
||||
feedbackInfo.time = moment().unix();
|
||||
feedbackInfo.version = $scope.version;
|
||||
feedbackInfo.sent = false;
|
||||
storageService.setFeedbackInfo(JSON.stringify(feedbackInfo), function() {
|
||||
$scope.showRateCard.value = false;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
|
|
|
|||
|
|
@ -796,46 +796,14 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
},
|
||||
})
|
||||
.state('tabs.shareApp', {
|
||||
url: '/shareApp/:score/:skipped/:fromSettings',
|
||||
url: '/shareApp',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'completeController',
|
||||
templateUrl: 'views/feedback/complete.html'
|
||||
controller: 'shareAppController',
|
||||
templateUrl: 'views/shareApp.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.rate', {
|
||||
url: '/rate',
|
||||
abstract: true
|
||||
})
|
||||
.state('tabs.rate.send', {
|
||||
url: '/send/:score',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
templateUrl: 'views/feedback/send.html',
|
||||
controller: 'sendController'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.rate.complete', {
|
||||
url: '/complete/:score/:skipped',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
controller: 'completeController',
|
||||
templateUrl: 'views/feedback/complete.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
.state('tabs.rate.rateApp', {
|
||||
url: '/rateApp/:score',
|
||||
views: {
|
||||
'tab-home@tabs': {
|
||||
controller: 'rateAppController',
|
||||
templateUrl: 'views/feedback/rateApp.html'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
*
|
||||
* Buy or Sell Bitcoin
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.services').factory('feedbackService', function($http, $log, $httpParamSerializer, configService) {
|
||||
var root = {};
|
||||
// var URL = "https://script.google.com/macros/s/1pWGRxVSUX9CxPqNAKZTppWHtDvyVtZv9HteY_TRQbWc/exec";
|
||||
var URL = "https://wallet-data.bitcoin.com/feedback.php";
|
||||
|
||||
root.send = function(dataSrc, cb) {
|
||||
$http(_post(dataSrc)).then(function() {
|
||||
$log.info("SUCCESS: Feedback sent");
|
||||
return cb();
|
||||
}, function(err) {
|
||||
$log.info("ERROR: Feedback sent anyway.");
|
||||
return cb(err);
|
||||
});
|
||||
};
|
||||
|
||||
var _post = function(dataSrc) {
|
||||
return {
|
||||
method: 'POST',
|
||||
url: URL,
|
||||
headers: {
|
||||
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
|
||||
},
|
||||
data: $httpParamSerializer(dataSrc)
|
||||
};
|
||||
};
|
||||
|
||||
root.isVersionUpdated = function(currentVersion, savedVersion) {
|
||||
|
||||
if (!verifyTagFormat(currentVersion))
|
||||
return 'Cannot verify the format of version tag: ' + currentVersion;
|
||||
if (!verifyTagFormat(savedVersion))
|
||||
return 'Cannot verify the format of the saved version tag: ' + savedVersion;
|
||||
|
||||
var current = formatTagNumber(currentVersion);
|
||||
var saved = formatTagNumber(savedVersion);
|
||||
if (saved.major > current.major || (saved.major == current.major && saved.minor > current.minor))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
function verifyTagFormat(tag) {
|
||||
var regex = /^v?\d+\.\d+\.\d+$/i;
|
||||
return regex.exec(tag);
|
||||
};
|
||||
|
||||
function formatTagNumber(tag) {
|
||||
var formattedNumber = tag.replace(/^v/i, '').split('.');
|
||||
return {
|
||||
major: +formattedNumber[0],
|
||||
minor: +formattedNumber[1],
|
||||
patch: +formattedNumber[2]
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
return root;
|
||||
});
|
||||
|
|
@ -250,14 +250,6 @@ angular.module('copayApp.services')
|
|||
});
|
||||
};
|
||||
|
||||
root.setFeedbackInfo = function(feedbackValues, cb) {
|
||||
storage.set('feedback', feedbackValues, cb);
|
||||
};
|
||||
|
||||
root.getFeedbackInfo = function(cb) {
|
||||
storage.get('feedback', cb);
|
||||
};
|
||||
|
||||
root.storeFocusedWalletId = function(id, cb) {
|
||||
storage.set('focusedWalletId', id || '', cb);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue