From: rb7147 Date: Mon, 11 Dec 2017 21:25:23 +0000 (-0500) Subject: Resolved the Policy GUI Javascript issues X-Git-Tag: v1.2.0~197 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=commitdiff_plain;h=0368cb99d6108970d172d4dc7145c67e4524b4a9 Resolved the Policy GUI Javascript issues Issue-ID: POLICY-440 Change-Id: I44d5304699da19bee7ae2997565802fc7d44cb0e Signed-off-by: rb7147 --- diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java index 7d2fe23c6..a40b48aa2 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java @@ -708,17 +708,25 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { //The "." in the value determines if its a string or a user defined type. if (!value.contains(".")){ //This is string - constraints.add(keyValues.get(key)); + if(StringUtils.isNumeric(key) ){ //only integer key for the value of Constrains + constraints.add(keyValues.get(key)); + } }else{ - //This is userdefined string + //This is user defined string String trimValue=value.substring(value.lastIndexOf('.')+1); StringBuilder referenceIndividualStringBuilder= new StringBuilder(); referenceIndividualStringBuilder.append(keySetString+"="+trimValue+":MANY-true"); referenceStringBuilder.append(referenceIndividualStringBuilder+","); } - } + } + } + if(keyValues.get("type").equalsIgnoreCase(LIST)){ + if(constraints == null || constraints.isEmpty()){ + referenceStringBuilder.append(keySetString+"=MANY-true"+","); + } + } }else{ //User defined Datatype. String value=keyValues.get("type"); @@ -1014,7 +1022,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { if(allkeys != null){ Iterator iter = allkeys.iterator(); while(iter.hasNext()){ - //convert to array values for MANY-true keys + //Convert to array values for MANY-true keys finalJsonObject = convertToArrayElement(jsonObject, iter.next()); } } @@ -1036,7 +1044,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { if(finalJsonObject != null){ LOGGER.info(finalJsonObject.toString()); - jsonModel = finalJsonObject.toString(); + jsonModel = finalJsonObject.toString(); } } @@ -1562,10 +1570,7 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { else { this.newModel.setVersion(this.newFile.toString().split("-v")[1].replace(".xmi", "")); } - }else{ - errorMsg = "Upload error: The file name should contain '-v', such as xxx-v1802.yml"; - } - + } }catch(Exception e){ LOGGER.error("Upload error : ", e); errorMsg = "Upload error:" + e.getMessage(); @@ -1573,6 +1578,21 @@ public class CreateDcaeMicroServiceController extends RestrictedBaseController { } } + + if(!errorMsg.isEmpty()){ + + PrintWriter out = response.getWriter(); + + response.setCharacterEncoding("UTF-8"); + response.setContentType("application / json"); + request.setCharacterEncoding("UTF-8"); + + JSONObject j = new JSONObject(); + j.put("errorMsg", errorMsg); + out.write(j.toString()); + return; + } + List fileList = new ArrayList<>(); this.directory = "model"; if (zip){ 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: '' + '', @@ -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: '' + '', @@ -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: '' + - '', - cellTemplate: - ' ', 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: '' + + '', + cellTemplate: + ' ', 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'}, diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ExportPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ExportPolicyController.js index f3974f863..de30fe011 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ExportPolicyController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ExportPolicyController.js @@ -20,21 +20,22 @@ var app = appDS2; app.controller('exportPolicyController', function ($scope, $window, PolicyAppService, modalService, $modal, Notification){ $( "#dialog" ).hide(); + $scope.policydatas = []; $scope.linkEnable = true; - $scope.gridOptions = { - data : 'policydatas', - onRegisterApi: function(gridApi) { - $scope.gridPolicyApi = gridApi; - }, - enableSorting: true, - enableFiltering: true, - showTreeExpandNoChildren: true, - paginationPageSizes: [10, 20, 50, 100], - paginationPageSize: 20, - columnDefs: [{name: 'policyName', displayName : 'Policy Name', sort: { direction: 'asc', priority: 0 }}, - {name: 'activeVersion', displayName : 'Version'}, - {name: 'modifiedDate', displayName : 'Last Modified',type: 'date', cellFilter: 'date:\'yyyy-MM-dd HH:MM:ss a\'' }] - }; + $scope.gridExportOptions = { + data : 'policydatas', + onRegisterApi: function(gridApi) { + $scope.gridPolicyApi = gridApi; + }, + enableSorting: true, + enableFiltering: true, + showTreeExpandNoChildren: true, + paginationPageSizes: [10, 20, 50, 100], + paginationPageSize: 20, + columnDefs: [{name: 'policyName', displayName : 'Policy Name', sort: { direction: 'asc', priority: 0 }}, + {name: 'activeVersion', displayName : 'Version'}, + {name: 'modifiedDate', displayName : 'Last Modified',type: 'date', cellFilter: 'date:\'yyyy-MM-dd HH:MM:ss a\'' }] + }; $scope.files; PolicyAppService.getData('get_AutoPushPoliciesContainerData').then(function (data) { diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html index 5c0aa9fbd..11472b96a 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html @@ -93,26 +93,26 @@ class="form-control" class="form-control" ng-disabled="temp.policy.readOnly" ng-model="temp.policy.configName" - ng-options="option for option in microServiceCongigNameDictionaryDatas track by option"> + ng-options="option for option in microServiceCongigNameDictionaryDatas track by option" required="true">

+ ng-options="option for option in microServiceLocationDictionaryDatas track by option" required="true">

+ ng-options="option for option in dcaeUUIDDictionaryDatas track by option" required="true">

+ ng-options="option for option in groupPolicyScopeListDatas track by option" required="true">
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ExportPolicyTemplate.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ExportPolicyTemplate.html index 5e9fdbd6c..6ae8d6b54 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ExportPolicyTemplate.html +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ExportPolicyTemplate.html @@ -1,16 +1,14 @@ - @@ -140,7 +140,7 @@ @@ -160,6 +160,7 @@
Destination:{{temp.tempModel.fullPath()}} - move + change