ec08f3dff9dc5e75758a8c5896f83b63d1766e5c
[vnfsdk/refrepo.git] /
1 /*\r
2  * Copyright 2017 Huawei Technologies Co., Ltd.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 (function() {\r
17     'use strict';\r
18 \r
19     /**\r
20      * @ngdoc function\r
21      * @name app.controller:HomeCtrl\r
22      * @description\r
23      * # HomeCtrl\r
24      * Controller of the app\r
25      */\r
26 \r
27     angular\r
28         .module('vnfmarket')\r
29         .controller('functionalTestCtrl', functionalTest);\r
30 \r
31     functionalTest.$inject = [ 'vnfConfig', 'baseUrlConfig', 'functionalTestService', '$stateParams'];\r
32 \r
33     /*\r
34      * recommend\r
35      * Using function declarations\r
36      * and bindable members up top.\r
37      */\r
38 \r
39     function functionalTest(vnfConfig, baseUrlConfig, functionalTestService,$stateParams) {\r
40         var vm = this;\r
41         vm.validations = [];\r
42                 vm.csarId = $stateParams.csarId;\r
43         console.log("functionalTest")\r
44         vm.filter = {\r
45             "search": '',\r
46             "name": 'testCase'\r
47         };\r
48 \r
49         vm.listViewActions = {\r
50             "search": ""\r
51         }\r
52 \r
53         vm.pagination = [5, 10, 15, {\r
54             label: 'All',\r
55             value: function() {\r
56                 return vm.validations.length ? vm.validations.length : 0;\r
57             }\r
58         }];\r
59 \r
60         vm.paginationQuery = {\r
61             order: "step",\r
62             limit: 10,\r
63             page: 1\r
64         };\r
65 \r
66         vm.paginationOptions = {\r
67             rowSelect: false,\r
68             multiSelect: false,\r
69             autoSelect: false,\r
70             //autoSelect: false,\r
71             decapitate: false,\r
72             largeEditDialog: false,\r
73             boundaryLink: true,\r
74             limitSelect: true,\r
75             pageSelect: true\r
76         };\r
77         vm.getvalidations = function(){\r
78             console.log(vm.functionalTests)\r
79         }\r
80                 \r
81                 vm.getFunctionTestDetails = function() {\r
82                         functionalTestService.getFunctionTestDetails(vm.csarId).then(function(response){\r
83                                 vm.validations = response.data;\r
84                         })\r
85                 }\r
86                 \r
87                 vm.getFunctionTestDetails();\r
88     }\r
89 })();