From 6ede8fedb4ad777e38da609534d549da2d1174fd Mon Sep 17 00:00:00 2001 From: Anjali Walsatwar Date: Wed, 11 Apr 2018 08:02:53 +0530 Subject: code needs to be formatted code needs to be formatted Issue-ID: VNFSDK-245 Change-Id: I5f091b989a3308b633ab8c9e2d727d64601c7cf7 Signed-off-by: Anjali Walsatwar --- .../functionalTest/functionalTestCtrl.js | 28 ++++----- .../functionalTest/functionalTestService.js | 6 +- .../home/serviceDetails/lifeCycle/lifeCycleCtrl.js | 36 +++++------ .../home/serviceDetails/lifeCycle/view.html | 32 +++++----- .../home/serviceDetails/serviceDetails-test.js | 42 ++++++------- .../home/serviceDetails/serviceDetails.html | 58 ++++++++++-------- .../home/serviceDetails/serviceDetailsCtrl.js | 70 +++++++++++----------- .../home/serviceDetails/serviceDetailsService.js | 6 +- .../serviceDetails/validation/validationCtrl.js | 36 +++++------ .../home/serviceDetails/validation/view.html | 26 ++++---- 10 files changed, 176 insertions(+), 164 deletions(-) diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestCtrl.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestCtrl.js index ec08f3df..fc49d111 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestCtrl.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestCtrl.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -28,7 +28,7 @@ .module('vnfmarket') .controller('functionalTestCtrl', functionalTest); - functionalTest.$inject = [ 'vnfConfig', 'baseUrlConfig', 'functionalTestService', '$stateParams']; + functionalTest.$inject = ['vnfConfig', 'baseUrlConfig', 'functionalTestService', '$stateParams']; /* * recommend @@ -36,10 +36,10 @@ * and bindable members up top. */ - function functionalTest(vnfConfig, baseUrlConfig, functionalTestService,$stateParams) { + function functionalTest(vnfConfig, baseUrlConfig, functionalTestService, $stateParams) { var vm = this; vm.validations = []; - vm.csarId = $stateParams.csarId; + vm.csarId = $stateParams.csarId; console.log("functionalTest") vm.filter = { "search": '', @@ -52,7 +52,7 @@ vm.pagination = [5, 10, 15, { label: 'All', - value: function() { + value: function () { return vm.validations.length ? vm.validations.length : 0; } }]; @@ -74,16 +74,16 @@ limitSelect: true, pageSelect: true }; - vm.getvalidations = function(){ + vm.getvalidations = function () { console.log(vm.functionalTests) } - - vm.getFunctionTestDetails = function() { - functionalTestService.getFunctionTestDetails(vm.csarId).then(function(response){ - vm.validations = response.data; - }) - } - - vm.getFunctionTestDetails(); + + vm.getFunctionTestDetails = function () { + functionalTestService.getFunctionTestDetails(vm.csarId).then(function (response) { + vm.validations = response.data; + }) + } + + vm.getFunctionTestDetails(); } })(); \ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestService.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestService.js index 1c66de0e..e0c5ad7f 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestService.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/functionalTest/functionalTestService.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -42,9 +42,9 @@ 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; diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/lifeCycleCtrl.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/lifeCycleCtrl.js index 2a313938..af6c960b 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/lifeCycleCtrl.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/lifeCycleCtrl.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -28,7 +28,7 @@ .module('vnfmarket') .controller('lifeCycleCtrl', lifeCycle); - lifeCycle.$inject = [ 'vnfConfig', 'baseUrlConfig']; + lifeCycle.$inject = ['vnfConfig', 'baseUrlConfig']; /* * recommend @@ -51,7 +51,7 @@ vm.pagination = [5, 10, 15, { label: 'All', - value: function() { + value: function () { return vm.lifeCycleTests.length ? vm.lifeCycleTests.length : 0; } }]; @@ -73,23 +73,23 @@ limitSelect: true, pageSelect: true }; - vm.getTests = function(){ + vm.getTests = function () { console.log(vm.lifeCycleTests) } - vm.lifeCycleTests = [{ - "step" : "Lifecycle step-1", - "parameter" : "Lifecycle Parameter1", - "result" : "pass" - }, - { - "step" : "Lifecycle step-2", - "parameter" : "Lifecycle Parameter2", - "result" : "pass" - },{ - "step" : "Lifecycle step-3", - "parameter" : "Parameter3", - "result" : "pass" - }] + vm.lifeCycleTests = [{ + "step": "Lifecycle step-1", + "parameter": "Lifecycle Parameter1", + "result": "pass" + }, + { + "step": "Lifecycle step-2", + "parameter": "Lifecycle Parameter2", + "result": "pass" + }, { + "step": "Lifecycle step-3", + "parameter": "Parameter3", + "result": "pass" + }] } })(); \ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/view.html b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/view.html index 5759ceb0..c767a05b 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/view.html +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/lifeCycle/view.html @@ -1,42 +1,44 @@
- + - - - - + - +
- {{'common.tabs.validation.stepTHead' | translate}} + + {{'common.tabs.validation.stepTHead' | translate}} {{'common.tabs.validation.stepTHead' | translate}} - {{'common.tabs.validation.ParamTHead' | translate}} + + {{'common.tabs.validation.ParamTHead' | translate}} {{'common.tabs.validation.ParamTHead' | translate}} - {{'common.tabs.validation.ResultTHead' | translate}} + + {{'common.tabs.validation.ResultTHead' | translate}} {{'common.tabs.validation.ResultTHead' | translate}}
- {{test.step}}{{test.step}} + {{test.step}}{{test.step}} - {{test.parameter}}{{test.parameter}} + {{test.parameter}}{{test.parameter}} - {{test.result}}{{test.result}} + {{test.result}}{{test.result}}
- -
-
+ + + \ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails-test.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails-test.js index 0c6edc27..d5c0038d 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails-test.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails-test.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -24,7 +24,7 @@ * Test of the app */ - describe('Home - serviceDetailsCtrl', function() { + describe('Home - serviceDetailsCtrl', function () { var controller = null, $scope = null, $location, stateParams, httpBackend, config, state, blah; @@ -46,14 +46,14 @@ "remarks": "" }; - beforeEach(function() { + beforeEach(function () { module('vnfmarket'); }); beforeEach(module('ui.router')); beforeEach(module('md.data.table')); beforeEach(module('pascalprecht.translate')); - beforeEach(inject(function($controller, $rootScope, $stateParams, $httpBackend, vnfConfig) { + beforeEach(inject(function ($controller, $rootScope, $stateParams, $httpBackend, vnfConfig) { $scope = $rootScope.$new(); stateParams = $stateParams; httpBackend = $httpBackend; @@ -64,26 +64,26 @@ }); })); - it('Should serviceDetailsCtrl must be defined', function() { + it('Should serviceDetailsCtrl must be defined', function () { expect(controller).toBeDefined(); }); - it('Receving state param service details', function() { - expect(stateParams.serviceDetails.csarId).toBeDefined(); - expect(stateParams.serviceDetails.name).toBeDefined(); - expect(stateParams.serviceDetails.downloadUri).toBeDefined(); - expect(stateParams.serviceDetails.report).toBeDefined(); - expect(stateParams.serviceDetails.size).toBeDefined(); - expect(stateParams.serviceDetails.version).toBeDefined(); - expect(stateParams.serviceDetails.provider).toBeDefined(); - expect(stateParams.serviceDetails.type).toBeDefined(); - expect(stateParams.serviceDetails.format).toBeDefined(); - expect(stateParams.serviceDetails.deletionPending).toBeDefined(); - expect(stateParams.serviceDetails.createTime).toBeDefined(); - expect(stateParams.serviceDetails.modifyTime).toBeDefined(); - expect(stateParams.serviceDetails.shortDesc).toBeDefined(); - expect(stateParams.serviceDetails.details).toBeDefined(); - expect(stateParams.serviceDetails.remarks).toBeDefined(); + it('Receving state param service details', function () { + expect(stateParams.serviceDetails.csarId).toBeDefined(); + expect(stateParams.serviceDetails.name).toBeDefined(); + expect(stateParams.serviceDetails.downloadUri).toBeDefined(); + expect(stateParams.serviceDetails.report).toBeDefined(); + expect(stateParams.serviceDetails.size).toBeDefined(); + expect(stateParams.serviceDetails.version).toBeDefined(); + expect(stateParams.serviceDetails.provider).toBeDefined(); + expect(stateParams.serviceDetails.type).toBeDefined(); + expect(stateParams.serviceDetails.format).toBeDefined(); + expect(stateParams.serviceDetails.deletionPending).toBeDefined(); + expect(stateParams.serviceDetails.createTime).toBeDefined(); + expect(stateParams.serviceDetails.modifyTime).toBeDefined(); + expect(stateParams.serviceDetails.shortDesc).toBeDefined(); + expect(stateParams.serviceDetails.details).toBeDefined(); + expect(stateParams.serviceDetails.remarks).toBeDefined(); }); }); })(); \ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails.html b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails.html index e44dfbef..e21c3cd8 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails.html +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetails.html @@ -19,23 +19,29 @@
{{vm.service.name}}
-
{{vm.service.details}}
+
{{vm.service.details}}
-
-
-
- {{'module.marketplace.serviceDetails.info.typeLbl' | translate}} :
- {{'module.marketplace.serviceDetails.info.createLbl' | translate}} :
- {{'module.marketplace.serviceDetails.info.modLbl' | translate}} :
-
-
- {{vm.service.type}}
- {{vm.service.createTime | date:'yyyy-MM-dd h:mm a'}}
- {{vm.service.modifyTime | date:'yyyy-MM-dd h:mm a'}}
-
+
+
+
+ {{'module.marketplace.serviceDetails.info.typeLbl' | translate}} : +
+ {{'module.marketplace.serviceDetails.info.createLbl' | translate}} : +
+ {{'module.marketplace.serviceDetails.info.modLbl' | translate}} : +
+
+
+ {{vm.service.type}} +
+ {{vm.service.createTime | date:'yyyy-MM-dd h:mm a'}} +
+ {{vm.service.modifyTime | date:'yyyy-MM-dd h:mm a'}} +
+
@@ -69,18 +75,20 @@ -
-
{{'module.marketplace.serviceDetails.info.reportTitle' | translate}}
- - -
+ +
+ + +
\ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsCtrl.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsCtrl.js index 466ab412..2a739a04 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsCtrl.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsCtrl.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -39,68 +39,68 @@ function ServiceDetail(serviceDetailsService, $state, $stateParams, vnfConfig, homeService, baseUrlConfig) { var vm = this; vm.index = 0; - vm.active = 'validation'; + vm.active = 'validation'; if (!$stateParams.serviceDetails) { $state.go('home.marketplace'); return; } vm.service = $stateParams.serviceDetails; - //ses vm.service.funcTestReportUrl = baseUrlConfig.common.ip + ":" + baseUrlConfig.common.port + vm.service.report; - vm.service.funcTestReportUrl = vm.service.report; + //ses vm.service.funcTestReportUrl = baseUrlConfig.common.ip + ":" + baseUrlConfig.common.port + vm.service.report; + vm.service.funcTestReportUrl = vm.service.report; - vm.downloadService = function(csarId) { - homeService.updateDownloadCount(csarId).then(function(response){ + vm.downloadService = function (csarId) { + homeService.updateDownloadCount(csarId).then(function (response) { homeService.downloadServiceFile(csarId); }) } - vm.onDeleteCompletion = function() { + vm.onDeleteCompletion = function () { $state.go('home.marketplace', {}, { reload: true }); } - vm.serviceDelete = function(serviceDetails) { + vm.serviceDelete = function (serviceDetails) { homeService.openDeleteDialog(serviceDetails, vm.onDeleteCompletion); }; - - vm.navigateValidation = function() { - vm.active = 'validation'; + + vm.navigateValidation = function () { + vm.active = 'validation'; $state.go('home.serviceDetails.validation'); }; - - vm.navigateLifecycle = function() { - vm.active = 'lifeCycle'; + + vm.navigateLifecycle = function () { + vm.active = 'lifeCycle'; $state.go('home.serviceDetails.lifeCycle'); }; - - vm.navigationFunctionalTest = function() { - vm.active = 'functionTest'; + + vm.navigationFunctionalTest = function () { + vm.active = 'functionTest'; $state.go('home.serviceDetails.functionTest', { - csarId: vm.service.csarId - }); + csarId: vm.service.csarId + }); }; - vm.navigateTab = function(sref, index) { + vm.navigateTab = function (sref, index) { $state.go(sref); vm.index = index; }; - - vm.reupload = function(isUpload, csarId){ - homeService.openUploadDialog(null, isUpload, csarId); - } - if(!$state.current.name.startsWith("home.serviceDetails.")){ - $state.go('home.serviceDetails.validation'); - } else { - if($state.current.name.endsWith("validation")){ - vm.active = 'validation'; - } else if ($state.current.name.endsWith("lifeCycle")){ - vm.active = 'lifeCycle'; - } else if($state.current.name.endsWith("functionTest")){ - vm.active = 'functionalTest'; - } - } + vm.reupload = function (isUpload, csarId) { + homeService.openUploadDialog(null, isUpload, csarId); + } + + if (!$state.current.name.startsWith("home.serviceDetails.")) { + $state.go('home.serviceDetails.validation'); + } else { + if ($state.current.name.endsWith("validation")) { + vm.active = 'validation'; + } else if ($state.current.name.endsWith("lifeCycle")) { + vm.active = 'lifeCycle'; + } else if ($state.current.name.endsWith("functionTest")) { + vm.active = 'functionalTest'; + } + } } })(); \ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsService.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsService.js index e59ef49b..a0ee1d2e 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsService.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/serviceDetailsService.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -42,9 +42,9 @@ 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; diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/validationCtrl.js b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/validationCtrl.js index 978e6aed..04839161 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/validationCtrl.js +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/validationCtrl.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function() { +(function () { 'use strict'; /** @@ -28,7 +28,7 @@ .module('vnfmarket') .controller('validationCtrl', validation); - validation.$inject = [ 'vnfConfig', 'baseUrlConfig']; + validation.$inject = ['vnfConfig', 'baseUrlConfig']; /* * recommend @@ -51,7 +51,7 @@ vm.pagination = [5, 10, 15, { label: 'All', - value: function() { + value: function () { return vm.validations.length ? vm.validations.length : 0; } }]; @@ -73,23 +73,23 @@ limitSelect: true, pageSelect: true }; - vm.getValidations = function(){ + vm.getValidations = function () { console.log(vm.validations) } - vm.validations = [{ - "step" : "Validation step-1", - "parameter" : "Validation Parameter1", - "result" : "pass" - }, - { - "step" : "Validation step-2", - "parameter" : "Validation Parameter2", - "result" : "pass" - },{ - "step" : "Validation step-3", - "parameter" : "Validation Parameter3", - "result" : "pass" - }]; + vm.validations = [{ + "step": "Validation step-1", + "parameter": "Validation Parameter1", + "result": "pass" + }, + { + "step": "Validation step-2", + "parameter": "Validation Parameter2", + "result": "pass" + }, { + "step": "Validation step-3", + "parameter": "Validation Parameter3", + "result": "pass" + }]; } })(); \ No newline at end of file diff --git a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/view.html b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/view.html index a90e1113..5a3d45ff 100644 --- a/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/view.html +++ b/vnfmarket/src/main/webapp/vnfmarket/app/modules/home/serviceDetails/validation/view.html @@ -1,42 +1,44 @@
- + - - - - + - +
+ {{'common.tabs.validation.stepTHead' | translate}} {{'common.tabs.validation.stepTHead' | translate}} + {{'common.tabs.validation.ParamTHead' | translate}} {{'common.tabs.validation.ParamTHead' | translate}} + {{'common.tabs.validation.ResultTHead' | translate}} {{'common.tabs.validation.ResultTHead' | translate}}
- {{validation.step}}{{validation.step}} + {{validation.step}}{{validation.step}} - {{validation.parameter}}{{validation.parameter}} + {{validation.parameter}}{{validation.parameter}} - {{validation.result}}{{validation.result}} + {{validation.result}}{{validation.result}}
- -
-
+ + +
\ No newline at end of file -- cgit 1.2.3-korg