Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / raptor / report_ebz.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   --%>
20 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/ebz_header/header.css">
21 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/ebz_header/portal_ebz_header.css">
22 <link rel="stylesheet" type="text/css" href="app/fusion/external/ebz/sandbox/styles/style.css" >
23
24
25 <script src= "app/fusion/external/ebz/angular_js/angular.js"></script> 
26 <script src= "app/fusion/external/ebz/angular_js/angular-route.min.js"></script>
27 <script src= "app/fusion/external/ebz/angular_js/angular-sanitize.js"></script>
28 <script src= "app/fusion/external/ebz/angular_js/angular-cookies.js"></script>
29 <script src="app/fusion/external/ebz/angular_js/angular-touch.js"></script>
30 <script src="app/fusion/external/ebz/angular_js/angular-animate.js"></script>
31
32 <script src= "app/fusion/external/ebz/angular_js/gestures.js"></script>
33 <script src="static/js/jquery-1.10.2.js"></script>
34 <script src="app/fusion/scripts/modalService.js"></script>
35 <script src="static/js/jquery.mask.min.js" type="text/javascript"></script>
36 <script src="static/js/jquery-ui.js" type="text/javascript"></script>
37 <script src="app/fusion/external/ebz/sandbox/att-abs-tpls.js" type="text/javascript"></script>
38 <script src="static/fusion/js/att_angular_gridster/ui-gridster-tpls.js"></script>
39 <script src="static/fusion/js/att_angular_gridster/angular-gridster.js"></script>
40 <script src= "app/fusion/external/ebz/angular_js/checklist-model.js"></script>
41 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/0.10.0/lodash.min.js"></script>
42 <script src="app/fusion/external/angular-ui/ui-bootstrap-tpls-1.1.2.min.js"></script>
43 <script src="app/fusion/scripts/services/userInfoService.js"></script>
44 <script src="app/fusion/scripts/services/leftMenuService.js"></script>
45
46
47 <script src="static/fusion/raptor/ebz/dynamicform.js"></script>
48 <script src="static/fusion/raptor/ebz/multiselect.js"></script>
49 <script src="static/fusion/raptor/ebz/report_search.js"></script>
50 <script src="static/fusion/raptor/ebz/report_run.js"></script>
51 <script src="static/fusion/raptor/ebz/quick_links.js"></script>
52
53 <script src="static/fusion/raptor/uigrid/vfs_fonts.js"></script>
54 <script src="static/fusion/raptor/uigrid/ui-grid.js"></script>
55
56 <script src="static/fusion/raptor/ebz/report_chart_wizard.js"></script>
57
58
59 <script src="app/fusion/scripts/controllers/modelpopupController.js"></script>
60
61 <script src="static/fusion/raptor/ebz/date_time_picker.js"></script>
62 <script src="static/fusion/raptor/ebz/moment.js"></script>
63 <link rel="stylesheet" href="static/fusion/raptor/ebz/date_time_picker.css"/>
64
65
66 <link rel="stylesheet" href="static/fusion/raptor/uigrid/ui-grid.css" type="text/css">
67
68 <div ng-controller="reportMainController">
69         <div ng-if='isViewRendering || isDataLoading' style="font-size:50px;color:#2ca02c">Loading...</div>
70         <div ng-view style="min-height: 400px;"></div>
71 </div>
72 <div ng-include src="app/fusion/scripts/view-models/profile-page/popup_modal.html"></div>
73
74 <style>
75 #accBar .att-accordion__heading span{
76         font-weight:bold;
77         position:relative;
78         margin:-10px;
79 }
80 #accTimeChart .att-accordion__heading span{
81         font-weight:bold;
82         position:relative;
83         margin:-10px;
84 }
85 #accFlexTimeChart .att-accordion__heading span{
86         font-weight:bold;
87         position:relative;
88         margin:-10px;
89 }
90 #accCommonOptions .att-accordion__heading span{
91         font-weight:bold;
92         position:relative;
93         margin:-10px;
94 }
95
96 #additionalOptions .att-accordion__heading span{
97         font-weight:bold;
98         position:relative;
99         margin:-10px;
100 }
101
102
103
104 </style>
105 <script>
106 angular.module('abs').requires.push('quantum', 'ngAnimate', 'ngTouch', 'ngRoute', 'ui.grid',
107                 'ui.grid.pagination','ui.grid.resizeColumns', 
108                 'ui.grid.pinning');
109 app.config(['$routeProvider',
110                   function($routeProvider) {
111                     $routeProvider.
112                       when('/report_search', {
113                         templateUrl: 'static/fusion/raptor/ebz/report_search.html',
114                         controller: 'reportSearchController'
115                       }).
116                       when('/report_run/:reportUrlParams*', {
117                         templateUrl: 'static/fusion/raptor/ebz/report_run.html',
118                         controller: 'reportRunController'
119                       }).
120                       when('/report_chart_wizard/:reportId', {
121                         templateUrl: 'static/fusion/raptor/ebz/report_chart_wizard.html',
122                         controller: 'ChartController'
123                       }).
124                       otherwise({
125                         redirectTo: '/report_search'
126                       });
127                 }]);
128
129 app.factory('redirectInterceptor',['$q','$location','$window','$rootScope', function($q,$location,$window,$rootScope){
130     return  {
131         'request':function(config){
132                 $rootScope.isDataLoading = true;
133                 return config;
134         },
135         'response':function(response,config){
136                 if(typeof response.data === 'string' && response.data=="session has timed out for user") {
137                 $window.location.href = 'login.htm';
138                 return $q.reject(response);
139             }else{
140                         //console.log('Inside response else ');
141                 $rootScope.isDataLoading = false;
142                 return response;
143             }
144         }
145     }
146 }]);
147
148 app.config(['$httpProvider',function($httpProvider) {
149     $httpProvider.interceptors.push('redirectInterceptor');
150 }]);
151
152 app.controller("reportMainController", [ '$scope', '$rootScope', '$parse', 'Grid', function($scope,$rootScope,$parse,Grid) {
153         $rootScope.isViewRendering = true;
154         $rootScope.$on('$routeChangeStart', function() {
155                 $rootScope.isViewRendering = true;
156                 });
157         
158         Grid.prototype.getCellValue = function getCellValue(row, col){
159                  if(col.field.indexOf('==')>-1){
160                          var customField = col.field.split('==');
161                          var obj = row.entity.filter(function(d){if(d.columnId==customField[0]) return true; });
162                          if(obj.length>0){
163                            return obj[0].searchresultField[customField[1]];
164                          }
165                  }
166                  if ( typeof(row.entity[ '$$' + col.uid ]) !== 'undefined' ) {
167                    return row.entity[ '$$' + col.uid].rendered;
168                  } else if (this.options.flatEntityAccess && typeof(col.field) !== 'undefined' ){
169                    return row.entity[col.field];
170                  } else {
171                    if (!col.cellValueGetterCache) {
172                      col.cellValueGetterCache = $parse(row.getEntityQualifiedColField(col));
173                    }
174                    return col.cellValueGetterCache(row);
175                  }
176         };
177
178 }]);
179 </script>