a9d12db33f17ae190dc9eb72fa38d2c601e367b1
[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('functionalTestOnboardingCtrl', functionalTest);\r
30 \r
31     functionalTest.$inject = [ 'vnfConfig', 'baseUrlConfig', '$mdDialog', '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, $mdDialog, functionalTestService,$stateParams) {\r
40         var vm = this;\r
41                 vm.csarId = $stateParams.csarId;\r
42         console.log("functionalTest")\r
43         vm.filter = {\r
44             "search": '',\r
45             "name": 'testCase'\r
46         };\r
47 \r
48         vm.listViewActions = {\r
49             "search": ""\r
50         }\r
51 \r
52         vm.pagination = [5, 10, 15, {\r
53             label: 'All',\r
54             value: function() {\r
55                 return vm.validations.length ? vm.validations.length : 0;\r
56             }\r
57         }];\r
58 \r
59         vm.paginationQuery = {\r
60             order: "step",\r
61             limit: 10,\r
62             page: 1\r
63         };\r
64 \r
65         vm.paginationOptions = {\r
66             rowSelect: false,\r
67             multiSelect: false,\r
68             autoSelect: false,\r
69             //autoSelect: false,\r
70             decapitate: false,\r
71             largeEditDialog: false,\r
72             boundaryLink: true,\r
73             limitSelect: true,\r
74             pageSelect: true\r
75         };\r
76         vm.getvalidations = function(){\r
77             console.log(vm.functionalTests)\r
78         }\r
79                 \r
80                 \r
81                 vm.hide = function(answer) {\r
82             $mdDialog.hide(answer);\r
83         };\r
84 \r
85         \r
86 \r
87         vm.getFunctionTestDetails = function() {\r
88                         functionalTestService.getFunctionTestDetails(vm.csarId).then(function(response){\r
89                                 vm.validations = response.data;\r
90                         })\r
91                 }\r
92                 \r
93                 vm.getFunctionTestDetails();\r
94             \r
95         vm.cancel = function() {\r
96             $mdDialog.cancel();\r
97         };\r
98     }\r
99 })();