update code formatting based on feedback

This commit is contained in:
John Mitchell
2018-03-07 11:56:43 -05:00
parent 2b4a53147e
commit 8b10d64d73
2 changed files with 22 additions and 21 deletions

View File

@@ -13,9 +13,9 @@ export default
function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment, function(Wait, $state, $scope, $rootScope, ProcessErrors, CheckLicense, moment,
$window, ConfigService, FeaturesService, pendoService, i18n, config) { $window, ConfigService, FeaturesService, pendoService, i18n, config) {
var calcDaysRemaining = function(seconds) { const calcDaysRemaining = function(seconds) {
// calculate the number of days remaining on the license // calculate the number of days remaining on the license
var duration = moment.duration(seconds, 'seconds').asDays(); let duration = moment.duration(seconds, 'seconds').asDays();
duration = Math.floor(duration); duration = Math.floor(duration);
if(duration < 0){ if(duration < 0){
@@ -27,16 +27,16 @@ export default
return duration; return duration;
}; };
var calcExpiresOn = function(seconds) { const calcExpiresOn = function(seconds) {
// calculate the expiration date of the license // calculate the expiration date of the license
return moment.unix(seconds).calendar(); return moment.unix(seconds).calendar();
}; };
var reset = function() { const reset = function() {
document.getElementById('License-form').reset(); document.getElementById('License-form').reset();
}; };
var init = function(config) { const init = function(config) {
// license/license.partial.html compares fileName // license/license.partial.html compares fileName
$scope.fileName = N_("No file selected."); $scope.fileName = N_("No file selected.");
@@ -64,7 +64,7 @@ export default
// Mimic HTML5 spec, show filename // Mimic HTML5 spec, show filename
$scope.fileName = event.target.files[0].name; $scope.fileName = event.target.files[0].name;
// Grab the key from the raw license file // Grab the key from the raw license file
var raw = new FileReader(); const raw = new FileReader();
// readAsFoo runs async // readAsFoo runs async
raw.onload = function() { raw.onload = function() {
try { try {
@@ -116,18 +116,18 @@ export default
if ($rootScope.licenseMissing === true) { if ($rootScope.licenseMissing === true) {
$state.go('dashboard', { $state.go('dashboard', {
licenseMissing: false licenseMissing: false
}); });
} else { } else {
init(config); init(config);
$scope.success = true; $scope.success = true;
$rootScope.licenseMissing = false; $rootScope.licenseMissing = false;
// for animation purposes // for animation purposes
var successTimeout = setTimeout(function() { const successTimeout = setTimeout(function() {
$scope.success = false; $scope.success = false;
clearTimeout(successTimeout); clearTimeout(successTimeout);
}, 4000); }, 4000);
} }
}); });
}); });
}; };

View File

@@ -50,7 +50,7 @@ export default ['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', '$q', 'Con
}, },
setRole: function(options) { setRole: function(options) {
var deferred = $q.defer(); const deferred = $q.defer();
if ($rootScope.current_user.is_superuser === true) { if ($rootScope.current_user.is_superuser === true) {
options.visitor.role = 'admin'; options.visitor.role = 'admin';
@@ -91,9 +91,10 @@ export default ['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', '$q', 'Con
}, },
issuePendoIdentity: function () { issuePendoIdentity: function () {
var options, const c = ConfigService.get();
c = ConfigService.get(),
config = c.license_info; let options;
let config = c.license_info;
config.analytics_status = c.analytics_status; config.analytics_status = c.analytics_status;
config.version = c.version; config.version = c.version;