Fix eslint errors

This patch fixes eslint errors except warnings for TODO.

Change-Id: I4024dfdd326c058c73a28b0655c0197bbffda075
Closes-Bug: #1622475
This commit is contained in:
Shu Muto 2016-09-12 19:12:54 +09:00
parent 4264fc3858
commit f6784a2879
14 changed files with 100 additions and 41 deletions

View File

@ -34,7 +34,15 @@
/**
* @ngDoc factory
* @name horizon.dashboard.project.queues.actions.createQueueService
* @Description A service to open the queues wizard.
* @param {Object} meta
* @param {Object} policy
* @param {Object} events
* @param {Object} createQueueWorkflow
* @param {Object} zaqar
* @param {Object} wizard
* @param {Object} toast
* @returns {Object} service
* @description A service to open the queues wizard.
*/
function createQueueService(meta, policy, events, createQueueWorkflow, zaqar, wizard, toast) {
@ -89,7 +97,7 @@
}
function allowed() {
return policy.ifAllowed({ rules: [['queue', 'add_queue']] });;
return policy.ifAllowed({ rules: [['queue', 'add_queue']] });
}
function submit() {

View File

@ -30,6 +30,10 @@
/**
* @ngdoc factory
* @name horizon.dashboard.project.queues.actions.createQueueWorkflow
* @param {Object} workflowService
* @param {Object} basePath
* @param {Object} gettext
* @returns {Object} create queue workflow service
* @description A workflow for the create queue action.
*/
function createQueueWorkflow(workflowService, basePath, gettext) {

View File

@ -36,7 +36,16 @@
/**
* @ngDoc factory
* @name horizon.dashboard.project.queues.actions.createSubscriptionService
* @Description A service to open the subscriptions wizard.
* @param {Object} $q
* @param {Object} meta
* @param {Object} policy
* @param {Object} events
* @param {Object} createSubWorkflow
* @param {Object} zaqar
* @param {Object} wizard
* @param {Object} toast
* @returns {Object} create subscription service
* @description A service to open the subscriptions wizard.
*/
function createSubscriptionService(
$q, meta, policy, events, createSubWorkflow, zaqar, wizard, toast) {
@ -83,8 +92,8 @@
});
}
function allowed(queue) {
return policy.ifAllowed({ rules: [['queue', 'add_subscriptions']] });;
function allowed() {
return policy.ifAllowed({ rules: [['queue', 'add_subscriptions']] });
}
function submit() {
@ -97,7 +106,7 @@
scope.$emit(events.SUBSCRIPTION_CREATE_SUCCESS, model);
}
function error(response) {
function error() {
// TODO: Currently, when server throws an error
// close the modal dialog and display the error message
// In the future, display the error message inside the dialog
@ -107,6 +116,3 @@
} // end of createSubscriptionService
})(); // end of IIFE

View File

@ -31,6 +31,10 @@
/**
* @ngdoc factory
* @name horizon.dashboard.project.queues.actions.createSubscriptionWorkflow
* @param {Object} workflowService
* @param {Object} basePath
* @param {Object} gettext
* @returns {Object} create subscription workflow service
* @description A workflow for the create subscription action.
*/
function createSubscriptionWorkflow(workflowService, basePath, gettext) {

View File

@ -35,7 +35,16 @@
/**
* @ngDoc factory
* @name horizon.dashboard.project.queues.actions.deleteQueueService
* @Description Brings up the delete queues confirmation modal dialog.
* @param {Object} $q
* @param {Object} policy
* @param {Object} zaqar
* @param {Object} events
* @param {Object} gettext
* @param {Object} $qExtensions
* @param {Object} deleteModal
* @param {Object} toast
* @returns {Object} delete queue service
* @description Brings up the delete queues confirmation modal dialog.
* On submit, delete given queues.
* On cancel, do nothing.
*/
@ -65,7 +74,7 @@
$qExtensions.allSettled(queues.map(checkPermission)).then(afterCheck);
}
function allowed(queue) {
function allowed() {
return policy.ifAllowed({ rules: [['zaqar', 'delete_queues']] });
}

View File

@ -34,7 +34,15 @@
/**
* @ngDoc factory
* @name horizon.dashboard.project.queues.actions.updateQueueService
* @Description A service to open the queues wizard.
* @param {Object} meta
* @param {Object} policy
* @param {Object} events
* @param {Object} updateQueueWorkflow
* @param {Object} zaqar
* @param {Object} wizard
* @param {Object} toast
* @returns {Object} update queue service
* @description A service to open the queues wizard.
*/
function updateQueueService(meta, policy, events, updateQueueWorkflow, zaqar, wizard, toast) {
@ -91,8 +99,8 @@
});
}
function allowed(queue) {
return policy.ifAllowed({ rules: [['queue', 'update_queue']] });;
function allowed() {
return policy.ifAllowed({ rules: [['queue', 'update_queue']] });
}
function submit() {

View File

@ -30,6 +30,10 @@
/**
* @ngdoc factory
* @name horizon.dashboard.project.queues.actions.updateQueueWorkflow
* @param {Object} createQueueWorkflow
* @param {Object} basePath
* @param {Object} gettext
* @returns {Object} update queue workflow service
* @description A workflow for the update queue action.
*/
function updateQueueWorkflow(createQueueWorkflow, basePath, gettext) {

View File

@ -38,6 +38,7 @@
/**
* @ngdoc value
* @name horizon.dashboard.project.queues.events
* @returns {Object} The event object
* @description a list of events for queues
*/
function events() {
@ -54,6 +55,9 @@
/**
* @ndoc config
* @name horizon.dashboard.project.queues.basePath
* @param {Object} $provide
* @param {Object} $windowProvider
* @returns {undefined} Returns nothing
* @description Base path for the queues panel
*/
function config($provide, $windowProvider) {

View File

@ -30,13 +30,17 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.queues.steps.QueueDetailsController
* @param {Object} $scope
* @param {Object} zaqar
* @param {Object} events
* @returns {undefined} Returns nothing
* @description This controller is use for creating a queue.
*/
function controller($scope, zaqar, events) {
var ctrl = this;
ctrl.queue = $scope.queue ? $scope.queue : {};
ctrl.update = $scope.queue? true: false;
ctrl.update = $scope.queue;
////////////////////////
@ -44,7 +48,7 @@
var watcher = $scope.$watchCollection(getQueue, onQueneChange);
$scope.$on('$destroy', function() {
watcher();
})
});
////////////////////////
@ -57,7 +61,5 @@
$scope.$emit(events.DETAILS_CHANGED, newValue);
}
}
} // end of controller
})();

View File

@ -33,6 +33,13 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.queues.steps.QueueDetailsController
* @param {Object} $q
* @param {Object} $scope
* @param {Object} metadata
* @param {Object} zaqar
* @param {Object} events
* @param {Object} metaTree
* @returns {undefined} Returns nothing
* @description This controller is use for creating a queue.
*/
function controller($q, $scope, metadata, zaqar, events, metaTree) {

View File

@ -31,6 +31,10 @@
/**
* @ngdoc controller
* @name horizon.dashboard.project.queues.steps.SubscriptionController
* @param {Object} $scope
* @param {Object} zaqar
* @param {Object} events
* @returns {undefined} Returns nothing
* @description This controller is use for creating a subscription.
*/
function SubscriptionController($scope, zaqar, events) {
@ -45,7 +49,7 @@
var watcher = $scope.$watchCollection(getSubscription, onSubscriptionChange);
$scope.$on('$destroy', function() {
watcher();
})
});
////////////////////////

View File

@ -33,7 +33,7 @@
'horizon.dashboard.project.queues.basePath',
'horizon.dashboard.project.queues.events',
'horizon.dashboard.project.queues.resourceType',
'horizon.framework.conf.resource-type-registry.service',
'horizon.framework.conf.resource-type-registry.service'
];
function queueController($scope, zaqar, base, events, type, registry) {
@ -80,7 +80,7 @@
// hz-table expects all items to have the id field
// so we need to manually add name as id here
ctrl.queuesSrc = response.data;
ctrl.queuesSrc.map(function addIdentifier(queue, index){
ctrl.queuesSrc.map(function addIdentifier(queue) {
queue.id = queue.name;
});
}

View File

@ -37,7 +37,7 @@
function validateSubscriber() {
var regex = /^(http:\/\/\w+|https:\/\/\w+|mailto:\w+)/
var regex = /^(http:\/\/\w+|https:\/\/\w+|mailto:\w+)/;
var directive = {
require: 'ngModel',
restrict: 'A',
@ -60,5 +60,4 @@
}
} // end of link
} // end of validateSubscriber
})();