summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js56
1 files changed, 48 insertions, 8 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js
index 8fa14643..b15205fc 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/app/fusion/scripts/DS2-controllers/ds2-reports/report-chart-controller.js
@@ -1,4 +1,4 @@
-appDS2.controller('reportChartController', function ($scope, $rootScope, $timeout, $window, $http, $routeParams,modalService) {
+appDS2.controller('reportChartController', function ($scope, $rootScope, $timeout, $window, $modal, $http, $routeParams,modalService) {
$scope.showLoader = true;
$scope.commonOptionOpen = false;
$scope.additionalOptionOpen = false;
@@ -15,11 +15,16 @@ appDS2.controller('reportChartController', function ($scope, $rootScope, $timeou
$scope.populateChrtWzdFields = function() {
$scope.reportRunJson = {};
+ $scope.showLoader=true;
$http.get("raptor.htm?action=chart.json&c_master="+$routeParams.reportId).then(function (response) {
+ $scope.showLoader=false;
$scope.reportRunJson = response.data;
//Set chart type
- $scope.reportRunJson.commonChartOptions.animateAnimatedChart = $scope.reportRunJson.commonChartOptions.animateAnimatedChart+"";
- $scope.reportRunJson.commonChartOptions.hideLegend = $scope.reportRunJson.commonChartOptions.hideLegend + "";
+ if($scope.reportRunJson.commonChartOptions!=null){
+ $scope.reportRunJson.commonChartOptions.animateAnimatedChart = $scope.reportRunJson.commonChartOptions.animateAnimatedChart+"";
+ $scope.reportRunJson.commonChartOptions.hideLegend = $scope.reportRunJson.commonChartOptions.hideLegend + "";
+ }
+
$scope.reportRunJson.showTitle = $scope.reportRunJson.showTitle + "";
// if barChartOptions is not null
@@ -126,9 +131,11 @@ appDS2.controller('reportChartController', function ($scope, $rootScope, $timeou
$scope.saveChartData = function() {
$scope.showLoader = true;
-
- $scope.reportRunJson.commonChartOptions.animateAnimatedChart = ($scope.reportRunJson.commonChartOptions.animateAnimatedChart=="true")
- $scope.reportRunJson.commonChartOptions.hideLegend = ($scope.reportRunJson.commonChartOptions.hideLegend=="true");
+ if($scope.reportRunJson.commonChartOptions){
+ $scope.reportRunJson.commonChartOptions.animateAnimatedChart = ($scope.reportRunJson.commonChartOptions.animateAnimatedChart=="true")
+ $scope.reportRunJson.commonChartOptions.hideLegend = ($scope.reportRunJson.commonChartOptions.hideLegend=="true");
+ }
+
$scope.reportRunJson.showTitle = ($scope.reportRunJson.showTitle=="true");
$scope.reportRunJson.chartTypeJSON = {
@@ -190,12 +197,12 @@ appDS2.controller('reportChartController', function ($scope, $rootScope, $timeou
//add the remove list to the json
$scope.reportRunJson.rangeAxisRemoveList= $scope.rangeAxisRemoveList;
$http.post("save_chart", JSON.stringify($scope.reportRunJson)).success(function(data, status) {
- $scope.successSubmit=true;
+ $scope.successSubmit=true;
$scope.showLoader = false;
$scope.reportRunJson.commonChartOptions.animateAnimatedChart = $scope.reportRunJson.commonChartOptions.animateAnimatedChart+"";
$scope.reportRunJson.commonChartOptions.hideLegend = $scope.reportRunJson.commonChartOptions.hideLegend + "";
$scope.reportRunJson.showTitle = $scope.reportRunJson.showTitle + "";
- if ($scope.reportRunJson.chartType == "BarChart3D") {
+ if ($scope.reportRunJson.chartType == "BarChart3D" && $scope.reportRunJson.barChartOptions) {
$scope.reportRunJson.barChartOptions.displayBarControls = $scope.reportRunJson.barChartOptions.displayBarControls+"";
$scope.reportRunJson.barChartOptions.minimizeXAxisTickers = $scope.reportRunJson.barChartOptions.minimizeXAxisTickers+"";
$scope.reportRunJson.barChartOptions.stackedChart = $scope.reportRunJson.barChartOptions.stackedChart+"";
@@ -203,6 +210,7 @@ appDS2.controller('reportChartController', function ($scope, $rootScope, $timeou
$scope.reportRunJson.barChartOptions.verticalOrientation = $scope.reportRunJson.barChartOptions.verticalOrientation +"";
$scope.reportRunJson.barChartOptions.xAxisDateType = $scope.reportRunJson.barChartOptions.xAxisDateType +"";
}
+ $scope.successPopUp();
$scope.populateChrtWzdFields();
})
}
@@ -419,6 +427,38 @@ appDS2.controller('reportChartController', function ($scope, $rootScope, $timeou
$rootScope.isViewRendering = false;
});
+ $scope.successPopUp = function (msg) {
+ var modalInstance = $modal.open({
+ templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html',
+ controller: ModalInstanceCtrl,
+ sizeClass: 'modal-small',
+ resolve: {
+ msg: function () {
+ var message = {
+ title: '',
+ text: msg
+ };
+ return message;
+ }
+ }
+ });
+ };
+
+ $scope.errorPopUp = function (msg) {
+ var modalInstance = $modal.open({
+ templateUrl: 'app/fusion/scripts/DS2-modal/error_modal.html',
+ controller: ModalInstanceCtrl,
+ sizeClass: 'modal-small',
+ resolve: {
+ msg: function () {
+ return msg;
+ }
+ }
+ });
+ };
+ var ModalInstanceCtrl = function ($scope, $modalInstance, msg,$rootScope) {
+ $scope.msg=msg;
+ }
});