diff --git a/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js b/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js index 9b94a1641..5e7fa533c 100644 --- a/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js +++ b/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js @@ -31,18 +31,18 @@ scope.close = function() { scope.toggleAlert = false; - } + }; scope.$on('raiseAlert', function(e, val) { console.log('received raiseAlert:' + angular.toJson(val)); if(val.show) { scope.message = val.message; scope.toggleAlert = true; }else{ - scope.message = '' + scope.message = ''; scope.toggleAlert = false; } }); } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/element-height/element-height.inspector.js b/static/resources/js/components/element-height/element-height.inspector.js index 769f2f068..40d638adf 100644 --- a/static/resources/js/components/element-height/element-height.inspector.js +++ b/static/resources/js/components/element-height/element-height.inspector.js @@ -36,10 +36,10 @@ return {'h' : w.height()}; }; - if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110; - if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32; - if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226; - if(!angular.isDefined(scope.subsTblBody)) scope.subsTblBody = 40; + if(!angular.isDefined(scope.subsHeight)) {scope.subsHeight = 110;} + if(!angular.isDefined(scope.subsSection)) {scope.subsSection = 32;} + if(!angular.isDefined(scope.subsSubPane)) {scope.subsSubPane = 226;} + if(!angular.isDefined(scope.subsTblBody)) {scope.subsTblBody = 40;} scope.$watch(scope.getDimension, function(current) { if(current) { @@ -59,4 +59,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/modal-dialog/modal-dialog.directive.js b/static/resources/js/components/modal-dialog/modal-dialog.directive.js index dc1722049..7557f5fe9 100644 --- a/static/resources/js/components/modal-dialog/modal-dialog.directive.js +++ b/static/resources/js/components/modal-dialog/modal-dialog.directive.js @@ -51,12 +51,12 @@ if(current) { ctrl.contentType = current; } - }) + }); scope.$watch('confirmOnly', function(current) { if(current) { ctrl.confirmOnly = current; } - }) + }); scope.$watch('vm.modalMessage', function(current) { if(current) { @@ -87,4 +87,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/project-member/add-project-member.directive.js b/static/resources/js/components/project-member/add-project-member.directive.js index 1f6251492..a872ba04b 100644 --- a/static/resources/js/components/project-member/add-project-member.directive.js +++ b/static/resources/js/components/project-member/add-project-member.directive.js @@ -71,7 +71,7 @@ vm.hasError = true; vm.errorMessage = 'failed_to_add_member'; } - if(status === 409 && pm.username != '') { + if(status === 409 && pm.username !== '') { vm.hasError = true; vm.errorMessage = 'username_already_exist'; } diff --git a/static/resources/js/components/project-member/project-member.config.js b/static/resources/js/components/project-member/project-member.config.js index a63acc2ad..9c0438e2e 100644 --- a/static/resources/js/components/project-member/project-member.config.js +++ b/static/resources/js/components/project-member/project-member.config.js @@ -38,11 +38,10 @@ for(var i = 0; i < r.length; i++) { var role = r[i]; - if(query.key === 'roleName' && role.roleName === query.value - || query.key === 'roleId' && role.id === String(query.value)) { + if(query.key === 'roleName' && role.roleName === query.value || query.key === 'roleId' && role.id === String(query.value)) { return role; } } } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/project/add-project.directive.js b/static/resources/js/components/project/add-project.directive.js index 226eff3ad..3ecf4ac60 100644 --- a/static/resources/js/components/project/add-project.directive.js +++ b/static/resources/js/components/project/add-project.directive.js @@ -55,13 +55,13 @@ function addProjectFailed(data, status) { vm.hasError = true; - if(status === 400 && vm0.projectName!= '' && vm0.projectName.length < 4) { + if(status === 400 && vm0.projectName !== '' && vm0.projectName.length < 4) { vm.errorMessage = 'project_name_is_too_short'; } if(status === 400 && vm0.projectName.length > 30) { vm.errorMessage = 'project_name_is_too_long'; } - if(status === 409 && vm0.projectName != '') { + if(status === 409 && vm0.projectName !== '') { vm.errorMessage = 'project_already_exist'; } console.log('Failed to add project:' + status); diff --git a/static/resources/js/components/replication/create-policy.directive.js b/static/resources/js/components/replication/create-policy.directive.js index e802b4f24..ae1e5c7bb 100644 --- a/static/resources/js/components/replication/create-policy.directive.js +++ b/static/resources/js/components/replication/create-policy.directive.js @@ -256,7 +256,7 @@ vm0.name = replicationPolicy.name; vm0.description = replicationPolicy.description; - vm0.enabled = (replicationPolicy.enabled == 1); + vm0.enabled = (replicationPolicy.enabled === 1); angular.forEach(vm.destinations, function(item) { if(item.id === vm.targetId) { @@ -431,4 +431,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/replication/list-replication.directive.js b/static/resources/js/components/replication/list-replication.directive.js index 28e8560ea..87151245e 100644 --- a/static/resources/js/components/replication/list-replication.directive.js +++ b/static/resources/js/components/replication/list-replication.directive.js @@ -34,7 +34,7 @@ {'key': 'finished', 'value':$filter('tr')('finished')}, {'key': 'canceled', 'value': $filter('tr')('canceled')} ]; - } + }; } ListReplicationController.$inject = ['$scope', 'getParameterByName', '$location', 'ListReplicationPolicyService', 'ToggleReplicationPolicyService', 'ListReplicationJobService', '$window', '$filter', 'trFilter', 'jobStatus']; @@ -134,6 +134,7 @@ case 'operation': case 'status': item[key] = $filter('tr')(value); + break; default: break; } @@ -143,7 +144,7 @@ $scope.$emit('raiseAlert', alertInfo); vm.searchJobTIP = false; vm.refreshJobTIP = false; - }searchReplicationJob + } function listReplicationJobFailed(data, status) { console.log('Failed to list replication job:' + data); @@ -186,7 +187,7 @@ 'contentType': 'text/html', 'confirmOnly': false, 'action': vm.togglePolicy - } + }; $scope.$emit('raiseInfo', emitInfo); } @@ -319,4 +320,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/repository/list-tag.directive.js b/static/resources/js/components/repository/list-tag.directive.js index c856512f5..fde155265 100644 --- a/static/resources/js/components/repository/list-tag.directive.js +++ b/static/resources/js/components/repository/list-tag.directive.js @@ -64,7 +64,7 @@ function getTagFailed(data) { $scope.$emit('modalTitle', $filter('tr')('error')); - $scope.$emit('modalMessage', $filter('tr')('failed_to_get_tag') + response); + $scope.$emit('modalMessage', $filter('tr')('failed_to_get_tag') + data); $scope.$emit('raiseError', true); console.log('Failed to get tag:' + data); } @@ -97,4 +97,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/system-management/replication.directive.js b/static/resources/js/components/system-management/replication.directive.js index a66da4e55..923bf85f1 100644 --- a/static/resources/js/components/system-management/replication.directive.js +++ b/static/resources/js/components/system-management/replication.directive.js @@ -77,7 +77,7 @@ 'contentType': 'text/html', 'confirmOnly': false, 'action': vm.togglePolicy - } + }; $scope.$emit('raiseInfo', emitInfo); } @@ -127,4 +127,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/user-log/user-log.directive.js b/static/resources/js/components/user-log/user-log.directive.js index b735b00ef..8869c7854 100644 --- a/static/resources/js/components/user-log/user-log.directive.js +++ b/static/resources/js/components/user-log/user-log.directive.js @@ -30,7 +30,7 @@ .error(listIntegratedLogFailed); function listIntegratedLogSuccess(data) { - vm.integratedLogs = data || [] + vm.integratedLogs = data || []; } function listIntegratedLogFailed(data, status) { @@ -54,4 +54,4 @@ return directive; } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/user/toggle-admin.directive.js b/static/resources/js/components/user/toggle-admin.directive.js index 09424b499..f4eb5e5b7 100644 --- a/static/resources/js/components/user/toggle-admin.directive.js +++ b/static/resources/js/components/user/toggle-admin.directive.js @@ -25,7 +25,7 @@ function ToggleAdminController($scope, ToggleAdminService, $filter, trFilter) { var vm = this; - vm.isAdmin = (vm.hasAdminRole == 1) ? true : false; + vm.isAdmin = (vm.hasAdminRole === 1) ? true : false; vm.enabled = vm.isAdmin ? 0 : 1; vm.toggle = toggle; @@ -77,4 +77,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/validator/project-name.validator.js b/static/resources/js/components/validator/project-name.validator.js index 3c36c5827..a2fcff132 100644 --- a/static/resources/js/components/validator/project-name.validator.js +++ b/static/resources/js/components/validator/project-name.validator.js @@ -20,7 +20,7 @@ .module('harbor.validator') .directive('projectName', projectName); - projectName.$inject = ['PROJECT_REGEXP'] + projectName.$inject = ['PROJECT_REGEXP']; function projectName(PROJECT_REGEXP) { var directive = { @@ -38,4 +38,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/harbor.config.js b/static/resources/js/harbor.config.js index 026a96fb2..95327b6cc 100644 --- a/static/resources/js/harbor.config.js +++ b/static/resources/js/harbor.config.js @@ -106,7 +106,7 @@ function filter(input, pattern) { var d = new Date(input || ''); - if(d.getTime() <= 0) return '-'; + if(d.getTime() <= 0) {return '-';} return moment(d).format(pattern); } } @@ -130,4 +130,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/layout/admin-option/admin-option.controller.js b/static/resources/js/layout/admin-option/admin-option.controller.js index f383407c3..2a362fa01 100644 --- a/static/resources/js/layout/admin-option/admin-option.controller.js +++ b/static/resources/js/layout/admin-option/admin-option.controller.js @@ -69,7 +69,7 @@ vm.action = function() { val.action(); $scope.$broadcast('showDialog', false); - } + }; vm.contentType = val.contentType; vm.confirmOnly = val.confirmOnly; @@ -91,4 +91,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/layout/change-password/change-password.controller.js b/static/resources/js/layout/change-password/change-password.controller.js index f3c4244af..457874f9e 100644 --- a/static/resources/js/layout/change-password/change-password.controller.js +++ b/static/resources/js/layout/change-password/change-password.controller.js @@ -95,7 +95,7 @@ var message; $scope.$emit('modalTitle', $filter('tr')('error')); console.log('Failed to change password:' + data); - if(data == 'old_password_is_not_correct') { + if(data === 'old_password_is_not_correct') { message = $filter('tr')('old_password_is_incorrect'); }else{ message = $filter('tr')('failed_to_change_password'); diff --git a/static/resources/js/layout/details/details.controller.js b/static/resources/js/layout/details/details.controller.js index c891c8e87..1cd8c355d 100644 --- a/static/resources/js/layout/details/details.controller.js +++ b/static/resources/js/layout/details/details.controller.js @@ -60,7 +60,7 @@ vm.action = function() { val.action(); $scope.$broadcast('showDialog', false); - } + }; vm.contentType = val.contentType; vm.confirmOnly = val.confirmOnly; @@ -73,4 +73,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/layout/index/index.controller.js b/static/resources/js/layout/index/index.controller.js index a0dc20eb5..ef483513e 100644 --- a/static/resources/js/layout/index/index.controller.js +++ b/static/resources/js/layout/index/index.controller.js @@ -92,7 +92,7 @@ vm.action = function() { val.action(); $scope.$broadcast('showDialog', false); - } + }; vm.contentType = val.contentType; vm.confirmOnly = val.confirmOnly; @@ -102,4 +102,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/services/destination/services.create-destination.js b/static/resources/js/services/destination/services.create-destination.js index 8a2c1f3ad..4104da3cc 100644 --- a/static/resources/js/services/destination/services.create-destination.js +++ b/static/resources/js/services/destination/services.create-destination.js @@ -35,4 +35,4 @@ } } -})() \ No newline at end of file +})(); diff --git a/static/resources/js/services/destination/services.list-destination.js b/static/resources/js/services/destination/services.list-destination.js index eb8a3f7c0..14ba9d9b8 100644 --- a/static/resources/js/services/destination/services.list-destination.js +++ b/static/resources/js/services/destination/services.list-destination.js @@ -34,4 +34,4 @@ } } -})() \ No newline at end of file +})(); diff --git a/static/resources/js/services/replication-policy/services.create-replication-policy.js b/static/resources/js/services/replication-policy/services.create-replication-policy.js index 96e7c1c77..40236c2cd 100644 --- a/static/resources/js/services/replication-policy/services.create-replication-policy.js +++ b/static/resources/js/services/replication-policy/services.create-replication-policy.js @@ -35,8 +35,8 @@ 'description': policy.description, 'cron_str': policy.cronStr, 'start_time': policy.startTime - }) + }); } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/services/user/services.is-admin.js b/static/resources/js/services/user/services.is-admin.js deleted file mode 100644 index 8375f2f14..000000000 --- a/static/resources/js/services/user/services.is-admin.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (c) 2016 VMware, Inc. All Rights Reserved. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -(function() { - - 'use strict'; - - angular - .module('harbor.services.user') - .factory('IsAdminService', IsAdminService); - - IsAdminService.$inject = ['$http', '$log']; - - function IsAdminService($http, $log) { - - return IsAdmin; - - function IsAdmin() { - - } - - } - -}) \ No newline at end of file