Use eslint on ui/lib and ui/features code

This commit is contained in:
gconsidine
2017-09-15 17:40:59 -04:00
parent 6b7126ab6b
commit cec9507504
53 changed files with 525 additions and 562 deletions

View File

@@ -1,13 +1,13 @@
const templateUrl = require('@components/layout/layout.partial.html');
const templateUrl = require('~components/layout/layout.partial.html');
function AtLayoutController ($scope, strings) {
let vm = this || {};
const vm = this || {};
$scope.$on('$stateChangeSuccess', function(event, next) {
$scope.$on('$stateChangeSuccess', (event, next) => {
vm.currentState = next.name;
});
$scope.$watch('$root.current_user', function(val) {
$scope.$watch('$root.current_user', (val) => {
vm.isLoggedIn = val && val.username;
if (val) {
vm.isSuperUser = $scope.$root.user_is_superuser || $scope.$root.user_is_system_auditor;
@@ -16,19 +16,19 @@ function AtLayoutController ($scope, strings) {
}
});
$scope.$watch('$root.socketStatus', function(newStatus) {
$scope.$watch('$root.socketStatus', (newStatus) => {
vm.socketState = newStatus;
vm.socketIconClass = "icon-socket-" + $scope.socketStatus;
vm.socketIconClass = `icon-socket-${$scope.socketStatus}`;
});
$scope.$watch('$root.licenseMissing', function(licenseMissing) {
$scope.$watch('$root.licenseMissing', (licenseMissing) => {
vm.licenseIsMissing = licenseMissing;
});
vm.getString = function(string) {
vm.getString = string => {
try {
return strings.get(`layout.${string}`);
} catch(err) {
} catch (err) {
return strings.get(string);
}
};
@@ -44,8 +44,7 @@ function atLayout () {
templateUrl,
controller: AtLayoutController,
controllerAs: 'vm',
scope: {
}
scope: {}
};
}

View File

@@ -1,18 +1,16 @@
const templateUrl = require('@components/layout/side-nav-item.partial.html');
const templateUrl = require('~components/layout/side-nav-item.partial.html');
function atSideNavItemLink (scope, element, attrs, ctrl) {
scope.navVm = ctrl[0];
scope.layoutVm = ctrl[1];
[scope.navVm, scope.layoutVm] = ctrl;
}
function AtSideNavItemController ($state, $scope, strings) {
let vm = this || {};
const vm = this || {};
$scope.$watch('layoutVm.currentState', function(current) {
$scope.$watch('layoutVm.currentState', current => {
if ($scope.name === 'portal mode') {
vm.isRoute = (current && current.indexOf('portalMode') === 0);
} else {
if (current && current.indexOf($scope.route) === 0) {
} else if (current && current.indexOf($scope.route) === 0) {
if (current.indexOf('jobs.schedules') === 0 && $scope.route === 'jobs') {
vm.isRoute = false;
} else {
@@ -21,12 +19,11 @@ function AtSideNavItemController ($state, $scope, strings) {
} else {
vm.isRoute = false;
}
}
});
vm.go = function() {
$state.go($scope.route, {}, {reload: true});
}
vm.go = () => {
$state.go($scope.route, {}, { reload: true });
};
vm.tooltip = {
popover: {
@@ -36,7 +33,7 @@ function AtSideNavItemController ($state, $scope, strings) {
position: 'right',
arrowHeight: 18
}
}
};
}
AtSideNavItemController.$inject = ['$state', '$scope', 'ComponentsStrings'];

View File

@@ -1,17 +1,17 @@
const templateUrl = require('@components/layout/side-nav.partial.html');
const templateUrl = require('~components/layout/side-nav.partial.html');
function atSideNavLink (scope, element, attrs, ctrl) {
scope.layoutVm = ctrl;
}
function AtSideNavController () {
let vm = this || {};
const vm = this || {};
vm.isExpanded = false;
vm.toggleExpansion = () => {
vm.isExpanded = !vm.isExpanded;
}
};
}
function atSideNav () {

View File

@@ -1,14 +1,14 @@
const templateUrl = require('@components/layout/top-nav-item.partial.html');
const templateUrl = require('~components/layout/top-nav-item.partial.html');
function atTopNavItemLink (scope, element, attrs, ctrl) {
scope.layoutVm = ctrl;
scope.isHidden = false;
var shownWhen = attrs.isShown;
const shownWhen = attrs.isShown;
if (shownWhen !== 'missingLicense') {
scope.$watch('layoutVm.licenseIsMissing', function(val) {
scope.$watch('layoutVm.licenseIsMissing', (val) => {
scope.isHidden = val;
});
}