@@ -121,21 +121,44 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory,
121121 $scope . showprogress = true ;
122122 $scope . progressMessage = 'Getting data... (can take a few minutes)'
123123 $scope . progressbarState = 100 ;
124- // TODO: modify this query to run a separate query per product
125- //$scope.products = productConfig.query({}, function() {
126- //console.log("products:" + $scope.products );
127- $scope . reportData = runReportFactory . query (
124+ $scope . products = productConfig . query ( function ( ) {
125+ console . log ( 'got the products!' ) ;
126+ for ( var i = 0 ; i < $scope . products . length ; i += 1 ) {
127+ console . log ( " product:" + $scope . products [ i ] [ 'data' ] ) ;
128+ //console.log(" keys: " + Object.keys($scope.products[i]));
129+
130+ $scope . chartObject = runReportFactory . query (
128131 { 'startDate' : utcStart ,
129132 'endDate' : utcEnd ,
130- 'reportResolution' : reportResolution } , function ( ) {
133+ 'reportResolution' : reportResolution ,
134+ 'product' : $scope . products [ i ] [ 'data' ] } , function ( ) {
131135 var i , j , row , chartData ;
132- chartData = restructData ( $scope . reportData ) ;
133- $scope . chartObject = chartData ;
136+ // chartData = restructData($scope.reportData);
137+ // $scope.chartObject = $scope.reportData ;
134138 console . log ( 'chartObject' ) ;
135- console . log ( JSON . stringify ( chartData ) ) ;
139+ console . log ( JSON . stringify ( $scope . chartObject ) ) ;
136140 $scope . showprogress = false ;
137141 } ) ;
138- //)
142+ }
143+
144+
145+ } ) ;
146+ // TODO: modify this query to run a separate query per product
147+ // $scope.products = productConfig.query( function() {
148+ // console.log("products:" + $scope.products );
149+ // $scope.reportData = runReportFactory.query(
150+ // {'startDate': utcStart,
151+ // 'endDate': utcEnd,
152+ // 'reportResolution': reportResolution}, function() {
153+ // var i, j, row, chartData;
154+ // console.log("report data: " + $scope.reportData);
155+ // //chartData = restructData($scope.reportData);
156+ // $scope.chartObject = $scope.reportData;
157+ // console.log('chartObject');
158+ // console.log(JSON.stringify(chartData));
159+ // $scope.showprogress = false;
160+ // });
161+ // ) ;
139162 } ;
140163
141164 function restructData ( inData ) {
0 commit comments