diff options
author | rb7147 <rb7147@att.com> | 2017-12-11 16:25:23 -0500 |
---|---|---|
committer | rb7147 <rb7147@att.com> | 2017-12-11 16:27:04 -0500 |
commit | 0368cb99d6108970d172d4dc7145c67e4524b4a9 (patch) | |
tree | 76c4d303c34d4b1146835bf520dcd776badcfc53 /POLICY-SDK-APP/src/main/webapp/app/policyApp/controller | |
parent | 428150834ee60899b9a8da019bae3c8bf009adf1 (diff) |
Resolved the Policy GUI Javascript issues
Issue-ID: POLICY-440
Change-Id: I44d5304699da19bee7ae2997565802fc7d44cb0e
Signed-off-by: rb7147 <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/controller')
13 files changed, 129 insertions, 48 deletions
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js index 5e3238be7..2dfd545f1 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js @@ -45,10 +45,14 @@ app.controller('importDictionaryController' , function ($scope, $modalInstance, withCredentials: false, headers: {'Content-Type': undefined}, transformRequest: angular.identity - }).success(function(){ - Notification.success("Dictionary Uploaded Successfully"); + }).success(function(data){ + if(data.includes("Success")){ + Notification.success("Dictionary Uploaded Successfully"); + }else{ + Notification.error(data); + } $scope.importButton = true; - }).error(function(){ + }).error(function(data){ Notification.error("Dictionary Upload Failed"); }); }; diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js index df78f6455..678902840 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js @@ -74,7 +74,9 @@ app.controller('editBRMSParamController' , function ($scope, $modalInstance, mes $scope.brmsParamDictionaryDatas=data.brmsParamDictionaryDatas;}); if($scope.brmsParamDictionaryDatas == "Duplicate"){ Notification.error("BRMSParan Dictionary exists with Same Name.") - }else{ + }else if($scope.brmsParamDictionaryDatas == "Validation"){ + Notification.error("BRMSParan Dictionary failed rule Validation.") + }else { console.log($scope.brmsParamDictionaryDatas); $modalInstance.close({brmsParamDictionaryDatas:$scope.brmsParamDictionaryDatas}); } diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSControllerDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSControllerDictGridController.js index 27c95a78d..c80f53d69 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSControllerDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSControllerDictGridController.js @@ -63,6 +63,7 @@ appDS2.controller('brmsControllerDictGridController', function ($scope, PolicyAp }, { field: 'controllerName', displayName : 'Controller Name', sort: { direction: 'asc', priority: 0 }}, { field: 'description'}, + { field: 'controller' , visible : false}, {field: 'userCreatedBy.userName', displayName : 'Created By'}, {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, {field: 'userModifiedBy.userName', displayName : 'Modified By'}, diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSDependencyDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSDependencyDictGridController.js index a22b1121c..61a5012b7 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSDependencyDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSDependencyDictGridController.js @@ -62,6 +62,7 @@ app.controller('brmsDependencyDictGridController', function ($scope, PolicyAppSe }, { field: 'dependencyName', displayName : 'Dependency Name', sort: { direction: 'asc', priority: 0 }}, { field: 'description'}, + { field: 'dependency' , visible : false}, {field: 'userCreatedBy.userName', displayName : 'Created By'}, {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, {field: 'userModifiedBy.userName', displayName : 'Modified By'}, diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js index 496a71a39..50e14ea26 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js @@ -59,6 +59,7 @@ app.controller('brmsParamDictGridController', function ($scope, PolicyAppService }, { field: 'ruleName', displayName : 'Rule Name', sort: { direction: 'asc', priority: 0 }}, { field: 'description'}, + { field: 'rule', visible : false}, {field: 'userCreatedBy.userName', displayName : 'Created By'}, {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } ], diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js index e60b6744e..de692a4f4 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js @@ -48,6 +48,9 @@ app.controller('serviceDictGridController', function ($scope, PolicyAppService, $scope.serviceDictionaryGrid = { data : 'closedLoopServiceDictionaryDatas', enableFiltering: true, + exporterCsvFilename: 'ClosedLoopService.csv', + enableGridMenu: true, + enableSelectAll: true, columnDefs: [{ field: 'id', enableFiltering: false, headerCellTemplate: '' + '<button id=\'New\' ng-click="grid.appScope.createNewServiceDictWindow()" class="btn btn-success">' + 'Create</button>', @@ -61,7 +64,35 @@ app.controller('serviceDictGridController', function ($scope, PolicyAppService, {field: 'userModifiedBy.userName', displayName : 'Modified By'}, {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ] + ], + exporterMenuPdf: false, + exporterPdfDefaultStyle: {fontSize: 9}, + exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, + exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, + exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, + exporterPdfFooter: function ( currentPage, pageCount ) { + return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; + }, + exporterPdfCustomFormatter: function ( docDefinition ) { + docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; + docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; + return docDefinition; + }, + exporterFieldCallback: function(grid, row, col, input) { + if( col.name == 'createdDate' || col.name == 'modifiedDate') { + var date = new Date(input); + return date.toString("yyyy-MM-dd HH:MM:ss a"); + } else { + return input; + } + }, + exporterPdfOrientation: 'portrait', + exporterPdfPageSize: 'LETTER', + exporterPdfMaxGridWidth: 500, + exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), + onRegisterApi: function(gridApi){ + $scope.gridApi = gridApi; + } }; $scope.editCLService = null; diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js index 62121d9e0..abf44f86a 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js @@ -48,6 +48,9 @@ app.controller('siteDictGridController', function ($scope, PolicyAppService, mod $scope.siteDictionaryGrid = { data : 'closedLoopSiteDictionaryDatas', enableFiltering: true, + exporterCsvFilename: 'ClosedLoopSite.csv', + enableGridMenu: true, + enableSelectAll: true, columnDefs: [{ field: 'id', enableFiltering: false, headerCellTemplate: '' + '<button id=\'New\' ng-click="grid.appScope.createNewSiteDictWindow()" class="btn btn-success">' + 'Create</button>', @@ -61,7 +64,35 @@ app.controller('siteDictGridController', function ($scope, PolicyAppService, mod {field: 'userModifiedBy.userName', displayName : 'Modified By'}, {field: 'createdDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' }, {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\'' } - ] + ], + exporterMenuPdf: false, + exporterPdfDefaultStyle: {fontSize: 9}, + exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, + exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, + exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, + exporterPdfFooter: function ( currentPage, pageCount ) { + return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; + }, + exporterPdfCustomFormatter: function ( docDefinition ) { + docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; + docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; + return docDefinition; + }, + exporterFieldCallback: function(grid, row, col, input) { + if( col.name == 'createdDate' || col.name == 'modifiedDate') { + var date = new Date(input); + return date.toString("yyyy-MM-dd HH:MM:ss a"); + } else { + return input; + } + }, + exporterPdfOrientation: 'portrait', + exporterPdfPageSize: 'LETTER', + exporterPdfMaxGridWidth: 500, + exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), + onRegisterApi: function(gridApi){ + $scope.gridApi = gridApi; + } }; $scope.editCLSite = null; diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js index 546775cb4..5a90ca8f7 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js @@ -49,7 +49,6 @@ app.controller('parentDictGridController', function ($scope, PolicyAppService,mo data : 'fwDictListDictionaryDatas', enableFiltering: true, exporterCsvFilename: 'ParentList.csv', - enableGridMenu: true, enableSelectAll: true, columnDefs: [{ field: 'id', enableFiltering: false, headerCellTemplate: '' + diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagListDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagListDictGridController.js index a5d3c3408..be0169689 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagListDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagListDictGridController.js @@ -49,7 +49,6 @@ app.controller('tagListDictGridController', function ($scope, PolicyAppService, data : 'fwTagDictionaryDatas', enableFiltering: true, exporterCsvFilename: 'FWTag.csv', - enableGridMenu: true, enableSelectAll: true, columnDefs: [{ field: 'id', enableFiltering: false, headerCellTemplate: '' + diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagPickerListDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagPickerListDictGridController.js index e4e2a1429..dbc6c09e5 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagPickerListDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagPickerListDictGridController.js @@ -49,7 +49,6 @@ app.controller('tagPickerListDictGridController', function ($scope, PolicyAppSer data : 'fwTagPickerDictionaryDatas', enableFiltering: true, exporterCsvFilename: 'SearchCriteria.csv', - enableGridMenu: true, enableSelectAll: true, columnDefs: [{ field: 'id', enableFiltering: false, headerCellTemplate: '' + diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js index bbce9ddcb..007edd748 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js @@ -46,19 +46,57 @@ app.controller('msModelsDictGridController', function ($scope, PolicyAppService, }); $scope.msModelsDictionaryGrid = { - data : 'microServiceModelsDictionaryDatas', - enableFiltering: true, - columnDefs: [{ - field: 'id', enableFiltering: false, headerCellTemplate: '' + - '<button id=\'New\' ng-click="grid.appScope.createNewMSModelsWindow()" class="btn btn-success">' + 'Create</button>', - cellTemplate: - '<button type="button" class="btn btn-danger" ng-click="grid.appScope.deleteMSModels(row.entity)" ><i class="fa fa-trash-o"></i></button> ', width: '8%' - },{ field: 'modelName', displayName : 'Micro Service Model', sort: { direction: 'asc', priority: 0 }}, - { field: 'description' }, - { field: 'version', displayName : 'Model Version' }, - {field: 'userCreatedBy.userName', displayName : 'Imported By' } - ] + data : 'microServiceModelsDictionaryDatas', + enableFiltering: true, + exporterCsvFilename: 'MSPolicyDictionary.csv', + enableGridMenu: true, + enableSelectAll: true, + columnDefs: [{ + field: 'id', + enableFiltering: false, headerCellTemplate: '' + + '<button id=\'New\' ng-click="grid.appScope.createNewMSModelsWindow()" class="btn btn-success">' + 'Create</button>', + cellTemplate: + '<button type="button" class="btn btn-danger" ng-click="grid.appScope.deleteMSModels(row.entity)" ><i class="fa fa-trash-o"></i></button> ', width: '8%' + },{ field: 'modelName', displayName : 'Micro Service Model', sort: { direction: 'asc', priority: 0 }}, + { field: 'description' }, + { field: 'version', displayName : 'Model Version' }, + {field: 'userCreatedBy.userName', displayName : 'Imported By' }, + {field: 'dependency', visible: false}, + {field: 'attributes', visible: false}, + {field: 'enumValues', visible: false}, + {field: 'ref_attributes',visible: false}, + {field: 'sub_attributes', visible: false} + ] , + exporterMenuPdf: false, + exporterPdfDefaultStyle: {fontSize: 9}, + exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, + exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, + exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, + exporterPdfFooter: function ( currentPage, pageCount ) { + return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; + }, + exporterPdfCustomFormatter: function ( docDefinition ) { + docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; + docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; + return docDefinition; + }, + exporterFieldCallback: function(grid, row, col, input) { + if( col.name == 'createdDate' || col.name == 'modifiedDate') { + var date = new Date(input); + return date.toString("yyyy-MM-dd HH:MM:ss a"); + } else { + return input; + } + }, + exporterPdfOrientation: 'portrait', + exporterPdfPageSize: 'LETTER', + exporterPdfMaxGridWidth: 500, + exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), + onRegisterApi: function(gridApi){ + $scope.gridApi = gridApi; + } }; + $scope.editMSmodelName = null; $scope.createNewMSModelsWindow = function(){ $scope.editMSmodelName = null; diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js index 4d1d07539..34c472eb2 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js @@ -48,8 +48,6 @@ app.controller('riskTypeDictGridController', function ($scope, PolicyAppService, $scope.riskTypeDictionaryGrid = { data : 'riskTypeDictionaryDatas', enableFiltering: true, - exporterCsvFilename: 'RiskType.csv', - enableGridMenu: true, enableSelectAll: true, columnDefs: [{ field: 'id', enableFiltering: false, headerCellTemplate: '' + @@ -66,36 +64,12 @@ app.controller('riskTypeDictGridController', function ($scope, PolicyAppService, {field: 'modifiedDate',type: 'date', cellFilter: 'date:\'yyyy-MM-dd\''} ], enableColumnResize : true, - exporterPdfDefaultStyle: {fontSize: 9}, - exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, - exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color: 'red'}, - exporterPdfHeader: { text: "My Header", style: 'headerStyle' }, - exporterPdfFooter: function ( currentPage, pageCount ) { - return { text: currentPage.toString() + ' of ' + pageCount.toString(), style: 'footerStyle' }; - }, - exporterPdfCustomFormatter: function ( docDefinition ) { - docDefinition.styles.headerStyle = { fontSize: 22, bold: true }; - docDefinition.styles.footerStyle = { fontSize: 10, bold: true }; - return docDefinition; - }, - exporterFieldCallback: function(grid, row, col, input) { - if( col.name == 'createdDate' || col.name == 'modifiedDate') { - var date = new Date(input); - return date.toString("yyyy-MM-dd HH:MM:ss a"); - } else { - return input; - } - }, - exporterPdfOrientation: 'portrait', - exporterPdfPageSize: 'LETTER', - exporterPdfMaxGridWidth: 500, - exporterCsvLinkElement: angular.element(document.querySelectorAll(".custom-csv-link-location")), onRegisterApi: function(gridApi){ $scope.gridApi = gridApi; + $scope.gridApi.core.refresh(); } }; - $scope.editRiskType = null; $scope.createNewRiskType = function(){ $scope.editRiskType = null; diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js index d8a7bf55a..654575596 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js @@ -68,6 +68,7 @@ app.controller('actionPolicyDictGridController', function ($scope,modalService, {field: 'url'}, {field: 'method'}, {field: 'header', displayName: 'Headers'}, + {field: 'body', visible : false}, {field: 'description'}, {field: 'userCreatedBy.userName', displayName: 'Created By'}, {field: 'userModifiedBy.userName', displayName: 'Modified By'}, |