From db02e8bdbaae109456791230526a55c4f2964b5c Mon Sep 17 00:00:00 2001 From: hrushikesh07 Date: Tue, 27 Sep 2016 16:51:10 +0530 Subject: [PATCH] Changed the split up data, added path for analytics in jquery page clear filter changed --- .../dashboard/analytics/analytics.html | 18 +++++++-------- .../sections/dashboard/analytics/analytics.js | 10 +++++--- .../analytics/controller/costCtrl.js | 14 ++++++----- client/htmls/private/index.html | 23 ++++++++++++++++++- 4 files changed, 46 insertions(+), 19 deletions(-) diff --git a/client/cat3/src/partials/sections/dashboard/analytics/analytics.html b/client/cat3/src/partials/sections/dashboard/analytics/analytics.html index 683ce3bfe..86f795f6f 100644 --- a/client/cat3/src/partials/sections/dashboard/analytics/analytics.html +++ b/client/cat3/src/partials/sections/dashboard/analytics/analytics.html @@ -88,8 +88,8 @@
- - + +
@@ -109,18 +109,18 @@
- - - - + + + +
- + - {{filter.title}} :{{filter.name}} + {{filt.title}} :{{filt.name}}
diff --git a/client/cat3/src/partials/sections/dashboard/analytics/analytics.js b/client/cat3/src/partials/sections/dashboard/analytics/analytics.js index d78ee10c5..12f865892 100644 --- a/client/cat3/src/partials/sections/dashboard/analytics/analytics.js +++ b/client/cat3/src/partials/sections/dashboard/analytics/analytics.js @@ -75,7 +75,9 @@ //$rootScope.$emit('treeNameUpdate', treeNames); $rootScope.$emit('HEADER_NAV_CHANGE', 'ANALYTICS'); $rootScope.organNewEnt=[]; + $rootScope.filterNewEnt={}; $rootScope.organNewEnt.org = '0'; + $rootScope.filterNewEnt.period='month'; $rootScope.splitUpCosts=[]; analytic.viewByFilter='orgView'; $scope.$watch(function() { return analytic.viewByFilter}, function(newVal, oldVal) { @@ -83,6 +85,7 @@ $rootScope.viewType='ProviderView'; $state.params.filterView.provi=true; } else { + $rootScope.organNewEnt.provider='' $rootScope.viewType='orgView'; $state.params.filterView.provi=false; } @@ -94,15 +97,16 @@ $scope.$watch(function() { return analytic.splitUp}, function(newVal, oldVal) { $scope.$broadcast('CHANGE_VIEW',newVal); }, true); - $rootScope.filterNewEnt={}; analytic.applyCount=0 - analytic.applyFilter = function(filterApp){ + analytic.applyFilter = function(filterApp,period){ $rootScope.filterApply= new Date(); var obj=$rootScope.organObject, or=$rootScope.organNewEnt.org, bu=$rootScope.organNewEnt.buss, pr=$rootScope.organNewEnt.proj; - $rootScope.filterNewEnt={} + if(period) + $rootScope.filterNewEnt.period=period; + if(or){ $rootScope.filterNewEnt.org={name:obj[or].name,id:obj[or].rowid,title:'Org'}; $rootScope.filterNewEnt.provider=''; diff --git a/client/cat3/src/partials/sections/dashboard/analytics/controller/costCtrl.js b/client/cat3/src/partials/sections/dashboard/analytics/controller/costCtrl.js index 15885d7a9..ec1226b8e 100644 --- a/client/cat3/src/partials/sections/dashboard/analytics/controller/costCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/analytics/controller/costCtrl.js @@ -109,19 +109,21 @@ } else { entityId=fltObj.org.id; } - param.url='/analytics/cost/aggregate?parentEntityId='+fltObj.org.id+'&entityId='+entityId+'&toTimeStamp='+new Date()+'&period=month'; + param.url='/analytics/cost/aggregate?parentEntityId='+fltObj.org.id+'&entityId='+entityId+'&toTimeStamp='+new Date()+'&period='+fltObj.period; } genSevs.promiseGet(param).then(function (result) { costObj.chartData=result; $rootScope.splitUpCosts=[]; - console.log('aaa',result.splitUpCosts); if(result.splitUpCosts) { angular.forEach(result.splitUpCosts, function (val, key) { - $rootScope.splitUpCosts.push(key); + var a=key.replace(/([A-Z])/g, ' $1').replace(/^./, function(str) { + return str.toUpperCase(); + }); + $rootScope.splitUpCosts.push({id:key,val:a}); }); - $scope.$emit('CHANGE_splitUp', $rootScope.splitUpCosts[0]); - costObj.createLable(result, $rootScope.splitUpCosts[0]); + $scope.$emit('CHANGE_splitUp', $rootScope.splitUpCosts[0].id); + costObj.createLable(result, $rootScope.splitUpCosts[0].id); } else { costObj.createLable(result,'provider'); } @@ -250,7 +252,7 @@ } else { entityId=fltObj.org.id; } - param.url='/analytics/cost/trend?parentEntityId='+fltObj.org.id+'&entityId='+fltObj.org.id+'&toTimeStamp='+new Date()+'&period=month&interval=86400' + param.url='/analytics/cost/trend?parentEntityId='+fltObj.org.id+'&entityId='+fltObj.org.id+'&toTimeStamp='+new Date()+'&period='+fltObj.period+'&interval=86400' } genSevs.promiseGet(param).then(function (result) { diff --git a/client/htmls/private/index.html b/client/htmls/private/index.html index e3b419898..17adab73a 100644 --- a/client/htmls/private/index.html +++ b/client/htmls/private/index.html @@ -47,6 +47,11 @@ + @@ -754,7 +759,23 @@