code needs to be formatted 07/42107/1
authoranjali <anjali.walsatwar@huawei.com>
Wed, 11 Apr 2018 02:16:23 +0000 (07:46 +0530)
committeranjali <anjali.walsatwar@huawei.com>
Wed, 11 Apr 2018 02:16:23 +0000 (07:46 +0530)
code needs to be formatted

Issue-ID: VNFSDK-245

Change-Id: I12d96d202327b463c2e5ef0ef4c5aaaa0464f9ac
Signed-off-by: anjali <anjali.walsatwar@huawei.com>
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/home-test.js
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/home.html
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/homeCtrl.js
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/homeModule.js
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/homeRoute.js
vnfmarket/src/main/webapp/vnfmarket/app/modules/home/homeService.js

index a182a9b..40c09c2 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
+(function () {
     'use strict';
 
     /**
      * Test of the app
      */
 
-    describe('Home - Marketplace', function() {
+    describe('Home - Marketplace', function () {
         var controller = null,
             $scope = null,
             $location, service, httpBackend, config, state;
 
-        beforeEach(function() {
+        beforeEach(function () {
             module('vnfmarket');
         });
         beforeEach(module('ui.router'));
         beforeEach(module('md.data.table'));
         beforeEach(module('pascalprecht.translate'));
 
-        beforeEach(inject(function($controller, $rootScope, _$location_, homeService, $httpBackend, vnfConfig, $state) {
+        beforeEach(inject(function ($controller, $rootScope, _$location_, homeService, $httpBackend, vnfConfig, $state) {
             $scope = $rootScope.$new();
             $location = _$location_;
             service = homeService;
             });
         }));
 
-        it('Should HomeCtrl must be defined', function() {
+        it('Should HomeCtrl must be defined', function () {
             expect(controller).toBeDefined();
         });
 
-        it('Service List response should be of type array', function() {
+        it('Service List response should be of type array', function () {
             var data = [{
                 "csarId": "26b4d6c4-a157-43c0-8ebc-9d6af1d6c40c",
                 "name": "clearwater_vnf",
             var returnData = {};
             httpBackend.expectGET(config.common.baseUrl + config.api.home.getFeaturesList.url).respond(returnData);
 
-            service.getFeaturesList().then(function(response) {
+            service.getFeaturesList().then(function (response) {
                 expect(response.data).toBeDefined();
                 expect(Array.isArray(response.data)).toBeTruthy();
             });
             httpBackend.flush();
         });
 
-        it('Service List response is not of array type', function() {
+        it('Service List response is not of array type', function () {
             var data = {};
             httpBackend.whenGET(config.common.baseUrl + config.api.home.getFeaturesList.url).respond(200, data);
 
             var returnData = {};
             httpBackend.expectGET(config.common.baseUrl + config.api.home.getFeaturesList.url).respond(returnData);
 
-            service.getFeaturesList().then(function(response) {
+            service.getFeaturesList().then(function (response) {
                 expect(response.data).toBeDefined();
                 expect(Array.isArray(response.data)).toBeFalsy();
             });
             httpBackend.flush();
         });
 
-        it('Service List response should contain service details', function() {
+        it('Service List response should contain service details', function () {
             var returnData = {};
             var data = [{
                 "csarId": "26b4d6c4-a157-43c0-8ebc-9d6af1d6c40c",
             httpBackend.whenGET(config.common.baseUrl + config.api.home.getFeaturesList.url).respond(200, data);
 
             httpBackend.expectGET(config.common.baseUrl + config.api.home.getFeaturesList.url).respond(returnData);
-            service.getFeaturesList().then(function(response) {
+            service.getFeaturesList().then(function (response) {
                 expect(response.data).toBeDefined();
                 var serviceDetails = response.data[0];
                 expect(serviceDetails.csarId).toBeDefined();
             httpBackend.flush();
         });
 
-        it('Should match the path Module name', function() {
+        it('Should match the path Module name', function () {
             $location.path('/marketplace');
             expect($location.path()).toBe('/marketplace');
         });
 
-        it('Path to the state home has to be defined', function() {
+        it('Path to the state home has to be defined', function () {
             expect(state.href("home")).toBe('#!');
         });
 
-        it('Path to the state home.marketplace has to be defined', function() {
+        it('Path to the state home.marketplace has to be defined', function () {
             expect(state.href("home.marketplace")).toBe('#!/marketplace');
         });
 
-        it('Path to the state home.serviceDetails has to be defined', function() {
+        it('Path to the state home.serviceDetails has to be defined', function () {
             expect(state.href("home.serviceDetails")).toBe('#!/serviceDetails');
         });
 
-        it('When a state is invalid', function() {
+        it('When a state is invalid', function () {
             expect(state.href("blah")).toBeNull('/marketplace');
         });
     });
index da8fdc3..692e727 100644 (file)
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<md-sidenav layout="column" class="md-sidenav-left md-whiteframe-z1" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')" id="sideNav">
+<md-sidenav layout="column" class="md-sidenav-left md-whiteframe-z1" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')"
+    id="sideNav">
     <div ng-controller="SidenavCtrl as vm" ng-cloak>
         <md-toolbar class="md-tall md-hue-1">
             <div class="image">
-                <img src="/onapui/vnfmarket/common/images/logo.png" align="middle" >
+                <img src="/onapui/vnfmarket/common/images/logo.png" align="middle">
             </div>
             <div layout="column" class="md-toolbar-tools-bottom inset">
             </div>
         </md-toolbar>
         <md-list>
-            <md-list-item ui-sref="home.marketplace"  ui-sref-opts="{reload: true}">
+            <md-list-item ui-sref="home.marketplace" ui-sref-opts="{reload: true}">
                 <div class="inset">
                     <!--<ng-md-icon icon="apps"></ng-md-icon>-->
                     <i>
@@ -43,7 +44,8 @@
     </div>
 </md-sidenav>
 
-<div layout="column" class="relative md-whiteframe-23dp verticalBar" layout-fill role="main" ng-controller="LayoutCtrl as layout" ng-cloak>
+<div layout="column" class="relative md-whiteframe-23dp verticalBar" layout-fill role="main" ng-controller="LayoutCtrl as layout"
+    ng-cloak>
     <md-toolbar class="md-hue-2  md-whiteframe-z2">
         <div class="md-toolbar-tools">
             <md-button ng-click="layout.toggleSidenav('left')" hide-gt-md aria-label="Menu">
@@ -52,7 +54,7 @@
             <h3 class="headTitle">{{ 'module.marketplace.main.headerTitle' | translate}}</h3>
         </div>
     </md-toolbar>
-    <div class="PageIndicator" ></div>
+    <div class="PageIndicator"></div>
     <md-content layout="column" class="contentBackground" flex md-scroll-y>
         <div ui-view></div>
     </md-content>
index 8555bad..0b5e681 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
+(function () {
     'use strict';
 
     /**
@@ -57,7 +57,7 @@
 
         vm.pagination = [5, 10, 15, {
             label: 'All',
-            value: function() {
+            value: function () {
                 return vm.services.length ? vm.services.length : 0;
             }
         }];
@@ -80,9 +80,9 @@
             pageSelect: true
         };
 
-        vm.getFeatureList = function() {
+        vm.getFeatureList = function () {
             vm.SpinClass = "fa-spin"
-            homeService.getFeaturesList().then(function(response) {
+            homeService.getFeaturesList().then(function (response) {
                 for (var i = 0; i < response.data.length; i++) {
                     response.data[i].createTime = new Date(response.data[i].createTime);
                     response.data[i].modifyTime = new Date(response.data[i].modifyTime);
             });
         }
 
-        vm.downloadService = function(csarId) {
-                       homeService.updateDownloadCount(csarId).then(function(response){
-                               homeService.downloadServiceFile(csarId);
+        vm.downloadService = function (csarId) {
+            homeService.updateDownloadCount(csarId).then(function (response) {
+                homeService.downloadServiceFile(csarId);
                 vm.getFeatureList();
-                       });
-            
+            });
+
         }
 
-        vm.changeView = function(viewType) {
+        vm.changeView = function (viewType) {
             vm.hasGridView = !vm.hasGridView;
             localStorage.setItem('viewType', viewType);
         }
 
-        vm.showDetails = function(serviceDetails) {
+        vm.showDetails = function (serviceDetails) {
             $state.go('home.serviceDetails', {
                 serviceDetails: serviceDetails
             });
         }
 
-        vm.serviceUpload = function(isUpload, csarId) {
-                       homeService.openUploadDialog(vm.getFeatureList, isUpload, csarId);
+        vm.serviceUpload = function (isUpload, csarId) {
+            homeService.openUploadDialog(vm.getFeatureList, isUpload, csarId);
         };
-               
 
-        vm.onDeleteCompletion = function() {
+
+        vm.onDeleteCompletion = function () {
             vm.getFeatureList();
         }
 
-        vm.serviceDelete = function(serviceDetails) {
+        vm.serviceDelete = function (serviceDetails) {
             homeService.openDeleteDialog(serviceDetails, vm.onDeleteCompletion);
         };
 
index acf0516..ec89764 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
+(function () {
     'use strict';
 
     /**
index bcd7906..d6c9ace 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 angular.module('vnfmarket')
-    .config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider, vnfConfig) {
+    .config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider, vnfConfig) {
 
         var homePath = '/onapui/vnfmarket/app/modules/home';
         $stateProvider
index 750c171..ccf3478 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
+(function () {
     'use strict';
 
     /**
@@ -34,8 +34,8 @@
             getFeaturesList: getFeaturesList,
             downloadServiceFile: downloadServiceFile,
             openDeleteDialog: openDeleteDialog,
-                       updateDownloadCount:updateDownloadCount,
-                       openUploadDialog:openUploadDialog
+            updateDownloadCount: updateDownloadCount,
+            openUploadDialog: openUploadDialog
         };
 
         function getFeaturesList() {
 
             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;
         }
-               
-               function updateDownloadCount(csarId) {
+
+        function updateDownloadCount(csarId) {
             var url = vnfConfig.api.home.updateDownloadCount.url;
-                       var method = vnfConfig.api.home.updateDownloadCount.method;
-                       url = url.replace(":csarId", csarId)
+            var method = vnfConfig.api.home.updateDownloadCount.method;
+            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;
 
         function openDeleteDialog(serviceDetails, callbackFunction) {
             $mdDialog.show({
-                    controller: 'serviceDeleteCtrl',
-                    templateUrl: vnfConfig.modulePath.home + '/serviceDelete/serviceDelete.html',
-                    serviceDetails: serviceDetails,
-                    controllerAs: 'vm'
-                })
-                .then(function(answer) {
+                controller: 'serviceDeleteCtrl',
+                templateUrl: vnfConfig.modulePath.home + '/serviceDelete/serviceDelete.html',
+                serviceDetails: serviceDetails,
+                controllerAs: 'vm'
+            })
+                .then(function (answer) {
                     //vm.status = 'You said the information was "' + answer + '".';
                     callbackFunction();
-                }, function() {
+                }, function () {
                     //vm.status = 'You cancelled the dialog.';
                 });
         }
-               
-               function openUploadDialog(callbackFunction,isUpload ,csarId) {
+
+        function openUploadDialog(callbackFunction, isUpload, csarId) {
             $mdDialog.show({
-                               controller: 'serviceUploadCtrl',
-                               templateUrl: vnfConfig.modulePath.home + '/serviceUpload/serviceUpload.html',
-                               controllerAs: 'vm',
-                               isUpload: isUpload,
-                               csarId: csarId ? csarId : null
-                       })
-                       .then(function(answer) {
-                               if(callbackFunction)
-                                       callbackFunction();
-                               // vm.status = 'You said the information was "' + answer + '".';
-                       }, function() {
-                               // vm.status = 'You cancelled the dialog.';
-                       });
+                controller: 'serviceUploadCtrl',
+                templateUrl: vnfConfig.modulePath.home + '/serviceUpload/serviceUpload.html',
+                controllerAs: 'vm',
+                isUpload: isUpload,
+                csarId: csarId ? csarId : null
+            })
+                .then(function (answer) {
+                    if (callbackFunction)
+                        callbackFunction();
+                    // vm.status = 'You said the information was "' + answer + '".';
+                }, function () {
+                    // vm.status = 'You cancelled the dialog.';
+                });
         }
 
     }