Create Catalogue page
[releng.git] / utils / test / reporting / pages / app / scripts / controllers / case.controller.js
1 'use strict';
2
3 /**
4  * @ngdoc function
5  * @name opnfvdashBoardAngularApp.controller:CaseController
6  * @description
7  * # TableController
8  * Controller of the opnfvdashBoardAngularApp
9  */
10 angular.module('opnfvApp')
11     .controller('CaseController', ['$scope', '$state', '$stateParams', 'TableFactory', function($scope, $state, $stateParams, TableFactory) {
12
13         init();
14         $scope.projectSelect = "";
15         $scope.funcTestCase = ['test1func', 'test2func', 'test3func', 'test4func'];
16         $scope.yardStickCase = ['test1yard', 'test2yard', 'test3yard', 'test4yard'];
17         $scope.bottleNeckCase = ['test1bottle', 'test2bottle', 'test3bottle', 'test4bottle',
18             'test5bottle', 'test6bottle', 'test7bottle', 'test8bottle',
19             'test9bottle', 'test10bottle', 'test11bottle', 'test12bottle',
20             'test13bottle', 'test14bottle', 'test15bottle', 'test16bottle',
21             'test17bottle', 'test18bottle', 'test19bottle', 'test20bottle'
22         ];
23         $scope.selectedFunc = ["test1func"];
24         $scope.selectBottle = ["test8bottle"];
25         $scope.versionlist = ["Colorado", "Master"];
26         $scope.VersionOption = [
27             { title: 'Colorado' },
28             { title: 'Master' }
29         ];
30         $scope.VersionConfig = {
31             create: true,
32             valueField: 'title',
33             labelField: 'title',
34             delimiter: '|',
35             maxItems: 1,
36             placeholder: 'Version',
37             onChange: function(value) {
38                 checkElementArrayValue($scope.selection, $scope.VersionOption);
39                 $scope.selection.push(value);
40                 // console.log($scope.selection);
41
42             }
43         };
44
45
46         function init() {
47             $scope.toggleSelection = toggleSelection;
48             $scope.toggleSelectionMulti = toggleSelectionMulti;
49
50         }
51
52         function toggleSelection(status) {
53             // var idx = $scope.weekselection.indexOf(status);
54             $scope.projectSelect = status;
55
56         }
57
58         function toggleSelectionMulti(status) {
59             var idx = $scope.selection.indexOf(status);
60
61             if (idx > -1) {
62                 $scope.selection.splice(idx, 1);
63             } else {
64                 $scope.selection.push(status);
65             }
66             console.log($scope.selection);
67         }
68
69
70     }]);