summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'POLICY-SDK-APP/src/main')
-rw-r--r--POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateDcaeMicroServiceController.java38
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/ImportDictionaryController.js10
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryController/BRMSParamDictController.js4
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSControllerDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSDependencyDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/BRMSParamDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLServiceDictGridController.js33
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/CLSiteDictGridController.js33
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWParentListDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagListDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/FWTagPickerListDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/MSModelDictGridController.js62
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/RiskTypeDictGridController.js28
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/controller/dictionaryGridController/actionPolicyDictGridController.js1
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ExportPolicyController.js29
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/DCAEMicroServicePolicyTemplate.html8
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplates/ExportPolicyTemplate.html13
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/css/main.css4
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/modals.html7
19 files changed, 191 insertions, 85 deletions
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<String> 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<File> 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: '' +
'<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'},
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"></select>
+ ng-options="option for option in microServiceCongigNameDictionaryDatas track by option" required="true"></select>
</div>
<div class="form-group col-sm-3" ng-show="isCheck">
<label>Location:<sup><b>*!</b></sup></label><br> <select
class="form-control" class="form-control"
ng-disabled="temp.policy.readOnly" ng-model="temp.policy.location"
- ng-options="option for option in microServiceLocationDictionaryDatas track by option"></select>
+ ng-options="option for option in microServiceLocationDictionaryDatas track by option" required="true"></select>
</div>
<div class="form-group col-sm-3" ng-show="isCheck">
<label>UUID:<sup><b>*!</b></sup></label><br> <select
class="form-control" class="form-control"
ng-disabled="temp.policy.readOnly" ng-model="temp.policy.uuid"
- ng-options="option for option in dcaeUUIDDictionaryDatas track by option"></select>
+ ng-options="option for option in dcaeUUIDDictionaryDatas track by option" required="true"></select>
</div>
<div class="form-group col-sm-3" ng-show="isCheck">
<label>Policy Scope:<sup><b>*</b></sup></label><br> <select
class="form-control" class="form-control"
ng-disabled="temp.policy.readOnly"
ng-model="temp.policy.policyScope"
- ng-options="option for option in groupPolicyScopeListDatas track by option"></select>
+ ng-options="option for option in groupPolicyScopeListDatas track by option" required="true"></select>
</div>
</div>
</div>
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 @@
-<div class="modal fadeIn" id="exportPolicy"
+<div class="modal" id="exportPolicy" style="margin-bottom: 20px; width: 100%; height: 100%"
ng-controller="exportPolicyController" data-toggle="modal"
data-backdrop="static" data-keyboard="false">
- <div class="modal-dialog modal-lg">
+ <div class="modal-dialog-lg">
<div class="modal-content">
<div class="modal-header">
- <h2 style="text-align: left; color: #157bb2">Export Policies</h2>
- </div>
- <div class="divider-container">
- <hr>
+ <h2 class="modal-title" style="color: #157bb2">Export Policies</h2>
</div>
+ <div class="well">
<div>
- <div id="grid1" style="width: 100%; height: 500px;" ui-grid="gridOptions"
+ <div id="grid1" ui-grid="gridExportOptions"
ui-grid-pagination ui-grid-selection ui-grid-resize-columns class="grid"></div>
</div>
<div class="modal-footer">
@@ -19,6 +17,7 @@
<button type="button" class="btn btn-default" data-dismiss="modal"
ng-disabled="temp.inprocess">Close</button>
</div>
+ </div>
</div>
</div>
</div> \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/css/main.css b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/css/main.css
index ec19f0d7f..317efd9fa 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/css/main.css
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/css/main.css
@@ -99,6 +99,10 @@ body {
border-radius: 4px;
}
+.first_child {
+ margin-top: 10px;
+}
+
.btn {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .26);
font-weight: 500;
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/modals.html b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/modals.html
index 77006002c..1c33839f2 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/modals.html
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/templates/modals.html
@@ -43,7 +43,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-pedefault" data-dismiss="modal" ng-click="refresh();" ng-disabled="temp.inprocess">Cancel</button>
- <button type="submit" class="btn btn-primary" ng-disabled="temp.inprocess" autofocus="autofocus">Delete</button>
+ <button type="submit" class="btn btn-primary" ng-disabled="!temp.model.versions" autofocus="autofocus">Delete</button>
</div>
</form>
</div>
@@ -140,7 +140,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-pedefault" data-dismiss="modal" ng-disabled="temp.inprocess">Cancel</button>
- <button type="submit" class="btn btn-primary" ng-disabled="temp.inprocess">Save</button>
+ <button type="submit" class="btn btn-primary" ng-disabled="temp.tempModel.content.highestVersion === temp.tempModel.content.activeVersion">Save</button>
</div>
</form>
</div>
@@ -160,6 +160,7 @@
<div class="modal-body">
<label class="radio">Enter new Policy Name to Clone <b>{{temp.model.name}}</b></label>
<input class="form-control" ng-model="temp.tempModel.name" autofocus="autofocus">
+ <div ng-include data-src="'error-bar'" class="clearfix"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-pedefault" data-dismiss="modal" ng-disabled="temp.inprocess">Cancel</button>
@@ -277,7 +278,7 @@
</div>
<div class="detail-sources">
<code class="mr5"><b>Destination:</b>{{temp.tempModel.fullPath()}}</code>
- <a href="" ng-click="openNavigator(temp)"><span class="label label-primary">move</span></a>
+ <a href="" ng-click="openNavigator(temp)"><span class="label label-primary">change</span></a>
</div>
</div>
</div>