From 4dc32df42eadbae49aa83356080ca324a6fc6dfc Mon Sep 17 00:00:00 2001 From: Anjali Walsatwar Date: Wed, 11 Apr 2018 08:10:00 +0530 Subject: code needs to be formatted code needs to be formatted Issue-ID: VNFSDK-245 Change-Id: Ie45ab07bd5cdfd3de5cb57b5acb413b7e2fb2d0e Signed-off-by: Anjali Walsatwar --- .../home/serviceDelete/serviceDelete-test.js | 52 +++++++++++----------- .../modules/home/serviceDelete/serviceDelete.html | 11 ++--- .../home/serviceDelete/serviceDeleteCtrl.js | 18 ++++---- .../home/serviceDelete/serviceDeleteService.js | 6 +-- 4 files changed, 44 insertions(+), 43 deletions(-) (limited to 'vnfmarket/src') diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete-test.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete-test.js index 2fb828a1..05bb3664 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete-test.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete-test.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -23,39 +23,39 @@ * # homeTest * Test of the app */ - angular - .module('vnfmarket') - .constant("serviceDetails", { - "csarId": "26b4d6c4-a157-43c0-8ebc-9d6af1d6c40c", - "name": "clearwater_vnf", - "downloadUri": "null/files/catalog-http/NFAR/Canonical/clearwater_vnf/v1.0/clearwater_vnf.csar", - "report": "/Demo/reports/b3232e0c-3843-4df8-88e7-734cf2d7a97c/report.html", - "size": "1.8 MB", - "version": "v1.0", - "provider": "Canonical", - "type": "NFAR", - "format": "yaml", - "deletionPending": false, - "createTime": "2017-02-22 08:59:06", - "modifyTime": "2017-02-22 08:59:06", - "shortDesc": "", - "details": "", - "remarks": "" - }) + angular + .module('vnfmarket') + .constant("serviceDetails", { + "csarId": "26b4d6c4-a157-43c0-8ebc-9d6af1d6c40c", + "name": "clearwater_vnf", + "downloadUri": "null/files/catalog-http/NFAR/Canonical/clearwater_vnf/v1.0/clearwater_vnf.csar", + "report": "/Demo/reports/b3232e0c-3843-4df8-88e7-734cf2d7a97c/report.html", + "size": "1.8 MB", + "version": "v1.0", + "provider": "Canonical", + "type": "NFAR", + "format": "yaml", + "deletionPending": false, + "createTime": "2017-02-22 08:59:06", + "modifyTime": "2017-02-22 08:59:06", + "shortDesc": "", + "details": "", + "remarks": "" + }) - describe('Home - serviceDeleteCtrl', function() { + describe('Home - serviceDeleteCtrl', function () { var controller = null, $scope = null, $location, service, httpBackend, config, state, blah; - beforeEach(function() { + beforeEach(function () { module('vnfmarket'); }); beforeEach(module('ui.router')); beforeEach(module('md.data.table')); beforeEach(module('pascalprecht.translate')); - beforeEach(inject(function($controller, $rootScope, serviceDeleteService, $httpBackend, vnfConfig, serviceDetails) { + beforeEach(inject(function ($controller, $rootScope, serviceDeleteService, $httpBackend, vnfConfig, serviceDetails) { $scope = $rootScope.$new(); service = serviceDeleteService; httpBackend = $httpBackend; @@ -66,11 +66,11 @@ }); })); - it('Should serviceDeleteCtrl must be defined', function() { + it('Should serviceDeleteCtrl must be defined', function () { expect(controller).toBeDefined(); }); - it('Delete service for a valid scenario', function() { + it('Delete service for a valid scenario', function () { var csarId = "26b4d6c4-a157-43c0-8ebc-9d6af1d6c40c", url = config.common.baseUrl + config.api.home.serviceDelete.url; url = url.replace(":csarId", csarId); httpBackend.whenDELETE(url).respond(200, {}); @@ -78,7 +78,7 @@ var returnData = {}; httpBackend.expectDELETE(url).respond(returnData); - service.serviceDelete(csarId).then(function(response) { + service.serviceDelete(csarId).then(function (response) { expect(response.status).toBeDefined(); expect(response.status).toBe(200); }); diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete.html b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete.html index 29e27823..aede2b0e 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete.html +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDelete.html @@ -27,12 +27,13 @@
-
-
-
-
{{'module.marketplace.serviceDelete.confirmationMesaage' | translate}} "{{ vm.serviceDetails.name }}"?
-
+
+
+
+
{{'module.marketplace.serviceDelete.confirmationMesaage' | translate}} "{{ vm.serviceDetails.name + }}"?
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteCtrl.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteCtrl.js index 5eafe9e8..3fd1a295 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteCtrl.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteCtrl.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -40,24 +40,24 @@ var vm = this; vm.serviceDetails = serviceDetails; - vm.hide = function() { + vm.hide = function () { $mdDialog.hide(); }; - vm.cancel = function() { + vm.cancel = function () { $mdDialog.cancel(); }; - vm.answer = function(answer) { + vm.answer = function (answer) { serviceDeleteService.serviceDelete(vm.serviceDetails.csarId) - .then(function(response) { + .then(function (response) { $mdDialog.hide(response); $mdToast.show( $mdToast.simple() - .textContent('Service deleted successfully') - .position("bottom right") - .action('Ok') - .theme('success-toast') + .textContent('Service deleted successfully') + .position("bottom right") + .action('Ok') + .theme('success-toast') ); }); }; diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteService.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteService.js index cf58d8a5..3d12cb0b 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteService.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDelete/serviceDeleteService.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -40,9 +40,9 @@ url = url.replace(":csarId", csarId) var defer = $q.defer() httpService.apiRequest(url, method) - .then(function(response) { + .then(function (response) { defer.resolve(response); - }, function(error) { + }, function (error) { defer.reject(error); }); return defer.promise; -- cgit 1.2.3-korg