diff --git a/src/app/api/serviceInstance/serviceInstance.api.js b/src/app/api/serviceInstance/serviceInstance.api.js index 018ad51dcc..7395ac1455 100644 --- a/src/app/api/serviceInstance/serviceInstance.api.js +++ b/src/app/api/serviceInstance/serviceInstance.api.js @@ -83,7 +83,9 @@ }; var removalData = {cnsi_guid: guid}; var data = this.$httpParamSerializer(removalData); + /* eslint-disable */ // TODO(woodnt): This should likely be a delete. We should investigate the Portal-proxy urls and verbs. https://jira.hpcloud.net/browse/TEAMFOUR-620 + /* eslint-enable */ return this.$http.post('/pp/v1/unregister', data, config); }, diff --git a/src/app/api/serviceInstance/user/userServiceInstance.api.js b/src/app/api/serviceInstance/user/userServiceInstance.api.js index 3d389c4870..3687e57040 100644 --- a/src/app/api/serviceInstance/user/userServiceInstance.api.js +++ b/src/app/api/serviceInstance/user/userServiceInstance.api.js @@ -80,7 +80,9 @@ }; var disconnectData = {cnsi_guid: guid}; var data = this.$httpParamSerializer(disconnectData); + /* eslint-disable */ // TODO(woodnt): This should likely be a delete. We should investigate the Portal-proxy urls and verbs. https://jira.hpcloud.net/browse/TEAMFOUR-620 + /* eslint-enable */ return this.$http.post('/pp/v1/auth/logout/cnsi', data, config); }, diff --git a/src/app/view/service-registration/service-registration.directive.js b/src/app/view/service-registration/service-registration.directive.js index 3c4f55e7fa..6caaa75487 100644 --- a/src/app/view/service-registration/service-registration.directive.js +++ b/src/app/view/service-registration/service-registration.directive.js @@ -62,7 +62,9 @@ this.warningMsg = gettext('Authentication failed, please try reconnect.'); this.detailView = detailView; this.currentEndpoints = []; + /* eslint-disable */ // TODO(woodnt): There must be a more reproducable/general way of doing this. https://jira.hpcloud.net/browse/TEAMFOUR-626 + /* eslint-enable */ this.cfModel = modelManager.retrieve('cloud-foundry.model.application'); $scope.$watchCollection(function () { diff --git a/src/plugins/cloud-foundry/model/auth/checkers/application-access.js b/src/plugins/cloud-foundry/model/auth/checkers/application-access.js index 78cde40458..94705303b1 100644 --- a/src/plugins/cloud-foundry/model/auth/checkers/application-access.js +++ b/src/plugins/cloud-foundry/model/auth/checkers/application-access.js @@ -21,15 +21,15 @@ } /** - * @name: ApplicationAccessFactory - * @description: Function to return an ApplicationAccess class + * @name ApplicationAccessFactory + * @description Function to return an ApplicationAccess class * @param {app.api.modelManager} modelManager - the Model management service * @returns {ApplicationAccess} */ function ApplicationAccessFactory(modelManager) { /** - * @name: ApplicationAccess - * @description: Constructor for ApplicationAccess + * @name ApplicationAccess + * @description Constructor for ApplicationAccess * @param {Principal} principal Principal instance * @param {Array} flags feature flags * @constructor @@ -42,8 +42,8 @@ angular.extend(ApplicationAccess.prototype, { /** - * @name: create - * @description: Does user have create application permission in the space + * @name create + * @description Does user have create application permission in the space * @param {Object} space Domain space * @returns {boolean} */ @@ -58,8 +58,8 @@ }, /** - * @name: update - * @description: Does user have update application permission + * @name update + * @description Does user have update application permission * @param {Object} app Application detail * @returns {boolean} */ @@ -74,9 +74,9 @@ }, /** - * @name: delete - * @description: Does user have delete application permission - * @param {Object} app Application detail + * @name delete + * @description Does user have delete application permission + * @param {Object} app - Application detail * @returns {boolean} */ delete: function(app) { @@ -84,9 +84,9 @@ }, /** - * @name: canHandle - * @description: Specifies that this ACL checker can handle `application` permission - * @param {String} resource + * @name canHandle + * @description Specifies that this ACL checker can handle `application` permission + * @param {String} resource - String representing the resource * @returns {boolean} */ canHandle: function(resource) { diff --git a/src/plugins/cloud-foundry/model/auth/checkers/organization-access.js b/src/plugins/cloud-foundry/model/auth/checkers/organization-access.js index c438a16cc6..da21fccf88 100644 --- a/src/plugins/cloud-foundry/model/auth/checkers/organization-access.js +++ b/src/plugins/cloud-foundry/model/auth/checkers/organization-access.js @@ -21,15 +21,15 @@ } /** - * @name: OrganizationAccessFactory - * @description: Function to return an OrganizationAccess class - * @param {app.api.modelManager} modelManager - the Model management service + * @name OrganizationAccessFactory + * @description Function to return an OrganizationAccess class + * @param {app.api.modelManager} modelManager - the Model management service * @returns {OrganizationAccess} */ function OrganizationAccessFactory(modelManager) { /** - * @name: OrganizationAccess - * @description: Constructor for OrganizationAccess + * @name OrganizationAccess + * @description Constructor for OrganizationAccess * @param {Principal} principal Principal instance * @param {Array} flags feature flags * @constructor @@ -43,9 +43,9 @@ angular.extend(OrganizationAccess.prototype, { /** - * @name: create - * @description: Does user have create organization permission in the space - * @param {Object} space Domain space + * @name create + * @description Does user have create organization permission in the space + * @param {Object} space - Domain space * @returns {boolean} */ create: function(space) { @@ -53,8 +53,8 @@ }, /** - * @name: update - * @description: Does user have update organization permission + * @name update + * @description Does user have update organization permission * @returns {boolean} */ delete: function() { @@ -62,10 +62,10 @@ }, /** - * @name: delete - * @description: Does user have delete organization permission + * @name delete + * @description Does user have delete organization permission * Original source contained a `//TODO(irfran):` annotation https://jira.hpcloud.net/browse/TEAMFOUR-625 - * @param {Object} app Application detail + * @param {Object} org - Application detail * @returns {boolean} */ @@ -80,9 +80,9 @@ }, /** - * @name: canHandle - * @description: Specifies that this ACL checker can handle `application` permission - * @param {String} resource + * @name canHandle + * @description Specifies that this ACL checker can handle `application` permission + * @param {String} resource - string specifying resource * @returns {boolean} */ canHandle: function(resource) { diff --git a/src/plugins/cloud-foundry/model/auth/checkers/route-access.js b/src/plugins/cloud-foundry/model/auth/checkers/route-access.js index 517a19f9fd..fc150eb9ab 100644 --- a/src/plugins/cloud-foundry/model/auth/checkers/route-access.js +++ b/src/plugins/cloud-foundry/model/auth/checkers/route-access.js @@ -21,15 +21,15 @@ } /** - * @name: RouteAccessFactory - * @description: Function to return an RouteAccess class + * @name RouteAccessFactory + * @description Function to return an RouteAccess class * @param {app.api.modelManager} modelManager - the Model management service * @returns {RouteAccess} */ function RouteAccessFactory(modelManager) { /** - * @name: RouteAccess - * @description: Constructor for RouteAccess + * @name RouteAccess + * @description Constructor for RouteAccess * @param {Principal} principal Principal instance * @param {Array} flags feature flags * @constructor @@ -42,8 +42,8 @@ angular.extend(RouteAccess.prototype, { /** - * @name: create - * @description: Does user have create route permission in the space + * @name create + * @description Does user have create route permission in the space * @param {Object} space Domain space * @returns {boolean} */ @@ -69,8 +69,8 @@ }, /** - * @name: update - * @description: Does user have update route permission + * @name update + * @description Does user have update route permission * @param {Object} route route detail * @returns {boolean} */ @@ -96,8 +96,8 @@ }, /** - * @name: delete - * @description: Does user have delete route permission + * @name delete + * @description Does user have delete route permission * @param {Object} route route detail * @returns {boolean} */ @@ -119,9 +119,9 @@ }, /** - * @name: canHandle - * @description: Specifies that this ACL checker can handle `route` permission - * @param {String} resource + * @name canHandle + * @description Specifies that this ACL checker can handle `route` permission + * @param {String} resource - string representing the resource * @returns {boolean} */ canHandle: function(resource) { diff --git a/src/plugins/cloud-foundry/model/auth/checkers/service-instance-access.js b/src/plugins/cloud-foundry/model/auth/checkers/service-instance-access.js index 91aa77f529..d4952dd5b3 100644 --- a/src/plugins/cloud-foundry/model/auth/checkers/service-instance-access.js +++ b/src/plugins/cloud-foundry/model/auth/checkers/service-instance-access.js @@ -21,16 +21,16 @@ } /** - * @name: ServiceInstanceAccessFactory - * @description: Function to get a ServiceInstanceAccess class + * @name ServiceInstanceAccessFactory + * @description Function to get a ServiceInstanceAccess class * @param {app.api.modelManager} modelManager - the Model management service * @returns {ServiceInstanceAccess} * @constructor */ function ServiceInstanceAccessFactory(modelManager) { /** - * @name: ServiceInstanceAccess - * @description: Constructor for ServiceInstanceAccess + * @name ServiceInstanceAccess + * @description Constructor for ServiceInstanceAccess * @param {Principal} principal Principal instance * @param {Array} flags feature flags * @constructor @@ -43,8 +43,8 @@ angular.extend(ServiceInstanceAccess.prototype, { /** - * @name: create - * @description: Does user have create service instance permission in the space + * @name create + * @description Does user have create service instance permission in the space * @param {Object} space Domain space * @returns {boolean} */ @@ -61,8 +61,8 @@ }, /** - * @name: update - * @description: Does user have update service instance permission + * @name update + * @description Does user have update service instance permission * @param {Object} serviceInstance service instance detail * @returns {boolean} */ @@ -78,8 +78,8 @@ }, /** - * @name: delete - * @description: Does user have delete application permission + * @name delete + * @description Does user have delete application permission * @param {Object} serviceInstance service instance detail * @returns {boolean} */ @@ -88,9 +88,9 @@ }, /** - * @name: canHandle - * @description: Specifies that this ACL checker can handle `managed_service_instance` permission - * @param {String} resource + * @name canHandle + * @description Specifies that this ACL checker can handle `managed_service_instance` permission + * @param {String} resource - string representing the resource * @returns {boolean} */ canHandle: function(resource) { diff --git a/src/plugins/cloud-foundry/model/auth/principal.js b/src/plugins/cloud-foundry/model/auth/principal.js index 5b36bfddbd..60a455ad5d 100644 --- a/src/plugins/cloud-foundry/model/auth/principal.js +++ b/src/plugins/cloud-foundry/model/auth/principal.js @@ -20,8 +20,8 @@ } /** - * @name: PrincipalFactory - * @description: Function to return an Principal class + * @name PrincipalFactory + * @description Function to return an Principal class * @param {app.api.modelManager} modelManager - the Model management service * @returns {Principal} * @constructor @@ -29,8 +29,8 @@ function PrincipalFactory(modelManager) { /** - * @name: Principal - * @description: initialise a Principal object + * @name Principal + * @description initialise a Principal object * @param {String} username * @param {String} authToken * @param {String} refreshToken @@ -39,7 +39,7 @@ * @param {Object} scope * @param {Object} userInfo * @constructor - */ + */ function Principal(username, authToken, refreshToken, expiresIn, tokenType, scope, userInfo) { this.username = username; this.authToken = authToken; @@ -53,46 +53,46 @@ angular.extend(Principal.prototype, { /** - * @name: hasAccessTo - * @description: Does user have access to operation + * @name hasAccessTo + * @description Does user have access to operation * @param {String} operation operation name * @param {Array} flags feature flags * @returns {*} - */ + */ hasAccessTo: function(operation, flags) { return this.isAdmin() || flags[operation]; }, /** - * @name: isAdmin - * @description: Is user an admin + * @name isAdmin + * @description Is user an admin * @returns {boolean} - */ + */ isAdmin: function() { return _.includes(this.scope, 'cloud_controller.admin'); }, /** - * @name: isAllowed - * @description: Is user permitted to do the action + * @name isAllowed + * @description Is user permitted to do the action * @param {Object} context * @param {String} resourceType ACL type * @param {String} action action name * @param {Array} flags feature flags - * @returns {*} - */ + * @returns {*} + */ isAllowed: function(context, resourceType, action, flags) { var accessChecker = this._getAccessChecker(resourceType, flags); return accessChecker[action](context); }, /** - * @name:_createAccessCheckerList - * @description: Internal method to create checker list + * @name_createAccessCheckerList + * @description Internal method to create checker list * @param {Array} flags feature flags * @returns {Array} - * @private - */ + * @private + */ _createAccessCheckerList: function(flags) { var ServiceInstanceAccess = modelManager @@ -114,8 +114,9 @@ /** * Access constants + * @returns {object} * @private - */ + */ _accessConstants: function() { return { resources: { @@ -139,13 +140,13 @@ }, /** - * @name: _getAccessChecker - * @description: Get Access checker for a given resource type + * @name _getAccessChecker + * @description Get Access checker for a given resource type * @param resourceType * @param flags * @returns {*} - * @private - */ + * @private + */ _getAccessChecker: function(resourceType, flags) { var checkers = this._createAccessCheckerList(flags); return _.find(checkers, function(checker) { diff --git a/src/plugins/cloud-foundry/model/auth/principal.service.js b/src/plugins/cloud-foundry/model/auth/principal.service.js index 34d8799327..30ae83e2ec 100644 --- a/src/plugins/cloud-foundry/model/auth/principal.service.js +++ b/src/plugins/cloud-foundry/model/auth/principal.service.js @@ -21,10 +21,10 @@ } /** - * @name: PrincipalService - * @param {Object} principalFactory factor to retrieve initialised Principal object + * @name PrincipalService + * @param {Object} principalFactory - factor to retrieve initialised Principal object * @constructor - */ + */ function PrincipalService(principalFactory) { // Original implementation also passed in $localStorage which was used // to store and retrieve `currentUser` @@ -32,10 +32,12 @@ } angular.extend(PrincipalService.prototype, { + /* eslint-disable */ + //TODO(irfran): Not original implement relied on localStorage to retrieve current user https://jira.hpcloud.net/browse/TEAMFOUR-625 + /* eslint-enable */ /** - * //TODO(irfran): Not original implement relied on localStorage to retrieve current user https://jira.hpcloud.net/browse/TEAMFOUR-625 - * @name: getCurrentUser - * @description: Retrieves current user + * @name getCurrentUser + * @description Retrieves current user */ getCurrentUser: function() { // Original implementation retrieved `currentUser` from localStorage @@ -47,12 +49,14 @@ // } }, + /* eslint-disable */ + // TODO(irfran): Not original implement relied on localStorage to store current user https://jira.hpcloud.net/browse/TEAMFOUR-625 + /* eslint-enable */ /** - * //TODO(irfran): Not original implement relied on localStorage to store current user https://jira.hpcloud.net/browse/TEAMFOUR-625 - * @name: setCurrentUser - * @description: get a Principal instance for the current user - * @param {Object} authInfo - */ + * @name setCurrentUser + * @description get a Principal instance for the current user + * @param {Object} authInfo - object containing authentication information + */ setCurrentUser: function(authInfo) { var currentUser = this.principalFactory.create(authInfo); // eslint-disable-line no-unused-vars // this.localStorage.currentUser = currentUser; diff --git a/src/plugins/cloud-foundry/model/model.module.js b/src/plugins/cloud-foundry/model/model.module.js index 3a6863e2f0..baa08ad7f1 100644 --- a/src/plugins/cloud-foundry/model/model.module.js +++ b/src/plugins/cloud-foundry/model/model.module.js @@ -21,7 +21,7 @@ * @description A $http interceptor that adds `x-cnap-cnsi-list` * header to each request if the CNSI guid is present in the * URL (route). - * @params {object} $stateParams - the UI router $stateParams service + * @param {object} $stateParams - the UI router $stateParams service * @returns {object} The request function */ function interceptor($stateParams) { diff --git a/src/plugins/cloud-foundry/view/applications/application/application.module.js b/src/plugins/cloud-foundry/view/applications/application/application.module.js index f5649e62b4..dc17245a55 100644 --- a/src/plugins/cloud-foundry/view/applications/application/application.module.js +++ b/src/plugins/cloud-foundry/view/applications/application/application.module.js @@ -141,7 +141,9 @@ this.model.getAppStats(this.cnsiGuid, this.id); this.model.application.project = null; + /* eslint-disable */ // TODO(kdomico): Get or create fake HCE user until HCE API is complete https://jira.hpcloud.net/browse/TEAMFOUR-623 + /* eslint-enable */ this.cnsiModel.list().then(function () { var hceCnsis = _.filter(that.cnsiModel.serviceInstances, { cnsi_type: 'hce' }) || []; if (hceCnsis.length > 0) { @@ -198,8 +200,10 @@ appAction.disabled = that.isPending; }); + /* eslint-disable */ // TODO(woodnt): This list-index mechanism is WAY fragile. Now we can't reorder the actions without re-counting indexes. https://jira.hpcloud.net/browse/TEAMFOUR-621 // TODO(woodnt): Why are we both conditionally hiding and conditionally disabling these appActions? That seems ... odd. https://jira.hpcloud.net/browse/TEAMFOUR-622 + /* eslint-enable */ this.showOrHideLaunchApp(newState, null); // Index 0 is Launch App though it's handled in it's own special method because it requires route info. this.appActions[1].hidden = newState !== 'STARTED'; // Stop diff --git a/src/plugins/cloud-foundry/view/applications/application/delivery-logs/delivery-logs.module.js b/src/plugins/cloud-foundry/view/applications/application/delivery-logs/delivery-logs.module.js index 7805cf7d27..298cd242ea 100644 --- a/src/plugins/cloud-foundry/view/applications/application/delivery-logs/delivery-logs.module.js +++ b/src/plugins/cloud-foundry/view/applications/application/delivery-logs/delivery-logs.module.js @@ -102,7 +102,7 @@ that.updateVisibleExecutions(visibleExecutions); }, 500); - $scope.$on("$destroy", function(){ + $scope.$on("$destroy", function() { if (that.debouncedUpdateVisibleExecutions) { that.debouncedUpdateVisibleExecutions.cancel(); } diff --git a/src/plugins/cloud-foundry/view/applications/application/delivery-pipeline/delivery-pipeline.module.js b/src/plugins/cloud-foundry/view/applications/application/delivery-pipeline/delivery-pipeline.module.js index 7de9f5c0da..ab5b109559 100644 --- a/src/plugins/cloud-foundry/view/applications/application/delivery-pipeline/delivery-pipeline.module.js +++ b/src/plugins/cloud-foundry/view/applications/application/delivery-pipeline/delivery-pipeline.module.js @@ -77,7 +77,9 @@ ]; /* eslint-enable */ + /* eslint-disable */ // TODO(kdomico): Get or create fake HCE user until HCE API is complete https://jira.hpcloud.net/browse/TEAMFOUR-623 + /* eslint-enable */ this.cnsiModel = modelManager.retrieve('app.model.serviceInstance'); this.cnsiModel.list().then(function () { var hceCnsis = _.filter(that.cnsiModel.serviceInstances, { cnsi_type: 'hce' }) || []; diff --git a/src/plugins/cloud-foundry/view/applications/workflows/add-app-workflow/add-app-workflow.directive.js b/src/plugins/cloud-foundry/view/applications/workflows/add-app-workflow/add-app-workflow.directive.js index 36356d4d3c..dcfd7034db 100644 --- a/src/plugins/cloud-foundry/view/applications/workflows/add-app-workflow/add-app-workflow.directive.js +++ b/src/plugins/cloud-foundry/view/applications/workflows/add-app-workflow/add-app-workflow.directive.js @@ -196,7 +196,9 @@ nextBtnText: gettext('Next'), onNext: function () { try { + /* eslint-disable */ // TODO (kdomico): Get or create fake HCE user until HCE API is complete https://jira.hpcloud.net/browse/TEAMFOUR-623 + /* eslint-enable */ that.hceModel.getUserByGithubId(that.userInput.hceCnsi.guid, '123456') .then(angular.noop, function (response) { if (response.status === 404) { @@ -249,7 +251,7 @@ var branches = _.map(that.githubModel.data.branches, function (o) { return { - label: o.name + ((_.indexOf(usedBranches, o.name) >= 0) ? gettext(' (used by other project)') : ''), + label: o.name + (_.indexOf(usedBranches, o.name) >= 0 ? gettext(' (used by other project)') : ''), value: o.name }; });