summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController
diff options
context:
space:
mode:
authorITSERVICES\rb7147 <rb7147@att.com>2017-05-08 22:20:44 -0400
committerITSERVICES\rb7147 <rb7147@att.com>2017-05-09 13:58:03 -0400
commitdda032f8bb161d54eb1f59de2b4a3efb774fc4d1 (patch)
tree9a11825d59434d97bb0c7dcbf00a0b84e7e5f526 /POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController
parenta330af579866dacbe595e2e4ad1dd29cd3c96945 (diff)
Policy 1707 Second commit
Change-Id: I18f5b142238733d17280cf17c3d1dd28204d34e9 Signed-off-by: ITSERVICES\rb7147 <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController')
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ActionPolicyController.js31
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js24
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js24
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js29
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js24
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js24
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js45
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js26
-rw-r--r--POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js23
9 files changed, 201 insertions, 49 deletions
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ActionPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ActionPolicyController.js
index fde8d4e9e..6ca9dfd93 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ActionPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ActionPolicyController.js
@@ -17,12 +17,24 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('actionPolicyController', function ($scope, PolicyAppService, modalService, $modal, Notification) {
+app.controller('actionPolicyController', ['$scope', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
-
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
+
PolicyAppService.getData('getDictionary/get_ActionPolicyDictDataByName').then(function (data) {
var j = data;
$scope.data = JSON.parse(j.data);
@@ -61,7 +73,11 @@ angular.module('abs').controller('actionPolicyController', function ($scope, Pol
}
$scope.saveActionPolicy = function(policy){
- console.log(policy);
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var uuu = "policycreation/save_policy";
var postData={policyData: policy};
@@ -82,7 +98,6 @@ angular.module('abs').controller('actionPolicyController', function ($scope, Pol
Notification.error("Policy Already Exists with Same Name in Scope.");
}
});
- console.log($scope.data);
},
error : function(data){
Notification.error("Error Occured while saving Policy.");
@@ -92,9 +107,8 @@ angular.module('abs').controller('actionPolicyController', function ($scope, Pol
};
$scope.validatePolicy = function(policy){
- console.log(policy);
document.getElementById("validate").innerHTML = "";
- var uuu = "policyController/validate_policy.htm";
+ var uuu = "policyController/validate_policy.htm";
var postData={policyData: policy};
$.ajax({
type : 'POST',
@@ -118,7 +132,6 @@ angular.module('abs').controller('actionPolicyController', function ($scope, Pol
}
});
- console.log($scope.data);
},
error : function(data){
Notification.error("Validation Failed.");
@@ -170,4 +183,4 @@ angular.module('abs').controller('actionPolicyController', function ($scope, Pol
$scope.temp.policy.ruleAlgorithmschoices.splice(lastItem);
};
-}); \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js
index c5160e741..ebec3a526 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSParamPolicyController.js
@@ -17,11 +17,23 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('brmsParamPolicyController', function ($scope, $window, PolicyAppService, modalService, $modal, Notification) {
+angular.module('abs').controller('brmsParamPolicyController', ['$scope', '$window', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, $window, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
$scope.validateSuccess = true;
var readValue = $scope.temp.policy.readOnly;
@@ -129,7 +141,11 @@ angular.module('abs').controller('brmsParamPolicyController', function ($scope,
};
$scope.saveBrmsParamPolicy = function(policy){
- console.log(policy);
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var uuu = "policycreation/save_policy";
var postData={policyData: policy};
@@ -231,7 +247,7 @@ angular.module('abs').controller('brmsParamPolicyController', function ($scope,
var lastItem = $scope.temp.policy.attributes.length-1;
$scope.temp.policy.attributes.splice(lastItem);
};
-});
+}]);
app.controller('showrulecontroller' , function ($scope, $modalInstance, message){
if(message.datas!=null){
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js
index 5b78193ee..97f6d2997 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BRMSRawPolicyController.js
@@ -17,11 +17,23 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('brmsRawPolicyController', function ($scope, $window, PolicyAppService, modalService, $modal, Notification) {
+angular.module('abs').controller('brmsRawPolicyController', ['$scope', '$window', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, $window, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
PolicyAppService.getData('getDictionary/get_BRMSControllerDataByName').then(function (data) {
var j = data;
@@ -54,7 +66,11 @@ angular.module('abs').controller('brmsRawPolicyController', function ($scope, $w
});
$scope.saveBrmsRawPolicy = function(policy){
- console.log(policy);
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var uuu = "policycreation/save_policy";
var postData={policyData: policy};
@@ -149,4 +165,4 @@ angular.module('abs').controller('brmsRawPolicyController', function ($scope, $w
var lastItem = $scope.temp.policy.attributes.length-1;
$scope.temp.policy.attributes.splice(lastItem);
};
-}); \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js
index 9f2863579..20287baf1 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/BaseConfigPolicyController.js
@@ -17,11 +17,25 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-app.controller('baseConfigController', function ($scope, PolicyAppService, modalService, $modal, Notification) {
+app.controller('baseConfigController', ['$scope', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+
+ $scope.policyNavigator;
$scope.savebutton = true;
-
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
+
PolicyAppService.getData('getDictionary/get_EcompNameDataByName').then(function (data) {
var j = data;
$scope.data = JSON.parse(j.data);
@@ -61,8 +75,12 @@ app.controller('baseConfigController', function ($scope, PolicyAppService, modal
}
$scope.savePolicy = function(policy){
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
- console.log(policy);
var uuu = "policycreation/save_policy";
var postData={policyData: policy};
$.ajax({
@@ -92,7 +110,7 @@ app.controller('baseConfigController', function ($scope, PolicyAppService, modal
$scope.validatePolicy = function(policy){
- console.log(policy);
+ $scope.scope = policy.domain;
document.getElementById("validate").innerHTML = "";
var uuu = "policyController/validate_policy.htm";
var postData={policyData: policy};
@@ -150,5 +168,4 @@ app.controller('baseConfigController', function ($scope, PolicyAppService, modal
var lastItem = $scope.temp.policy.attributes.length-1;
$scope.temp.policy.attributes.splice(lastItem);
};
-
-}); \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
index a8dcd7b0a..11254742a 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopFaultController.js
@@ -17,11 +17,23 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module("abs").controller('clFaultController', function($scope, $window, PolicyAppService, modalService, $modal, Notification){
+angular.module("abs").controller('clFaultController', ['$scope', '$window', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function($scope, $window, PolicyAppService, PolicyNavigator, modalService, $modal, Notification){
$("#dialog").hide();
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
if($scope.temp.policy.triggerTrapSignatures == undefined){
$scope.temp.policy.triggerTrapSignatures = [];
@@ -501,7 +513,11 @@ angular.module("abs").controller('clFaultController', function($scope, $window,
};
$scope.saveFaultPolicy = function(policy){
- console.log(policy);
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var data = {};
var faultData = {};
@@ -780,4 +796,4 @@ angular.module("abs").controller('clFaultController', function($scope, $window,
};
-}); \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js
index 2f709a716..393780705 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/ClosedLoopPMController.js
@@ -17,11 +17,23 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module("abs").controller('clPMController', function($scope, $window, $timeout, PolicyAppService, modalService, $modal, Notification){
+angular.module("abs").controller('clPMController', ['$scope', '$window', '$timeout', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function($scope, $window, $timeout, PolicyAppService, PolicyNavigator, modalService, $modal, Notification){
$("#dialog").hide();
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
PolicyAppService.getData('getDictionary/get_EcompNameDataByName').then(function (data) {
var j = data;
@@ -88,7 +100,11 @@ angular.module("abs").controller('clPMController', function($scope, $window, $ti
};
$scope.saveCLPMPolicy = function(policy){
- console.log(policy);
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var uuu = "policycreation/save_policy";
var postData={policyData: policy};
@@ -160,4 +176,4 @@ angular.module("abs").controller('clPMController', function($scope, $window, $ti
});
};
-}) \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
index d0f44d46e..b87299cbd 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js
@@ -17,13 +17,25 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('dcaeMicroServiceController', function ($scope, $window, $compile, PolicyAppService, modalService, $modal, Notification) {
+angular.module('abs').controller('dcaeMicroServiceController', ['$scope', '$window', '$compile', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, $window, $compile, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+
+ $scope.policyNavigator;
$scope.isCheck = false;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
-// $scope.temp.policy.ttlDate = "2016-12-31";
if ($scope.temp.policy.editPolicy != undefined|| $scope.temp.policy.readOnly != undefined){
if ($scope.temp.policy.configName == undefined){
$scope.isCheck = false;
@@ -384,11 +396,17 @@ angular.module('abs').controller('dcaeMicroServiceController', function ($scope,
}
function getList(attribute) {
-
+ var enumName = attribute;
+ console.log("In getList: attribute => " + attribute);
+ if(attribute){
+ if(attribute.includes(":")){
+ enumName = attribute.split(":")[0];
+ }
+ }
var baseEnum = $scope.dcaeModelData.enumValues;
var enumList = baseEnum.split(splitEnum);
var enumAttributes;
- var patternTest = new RegExp(attribute);
+ var patternTest = new RegExp(enumName);
for (k=0; k < enumList.length; k += 1){
if(patternTest.test(enumList[k]) == true){
enumAttributes = enumList[k].trim();
@@ -399,12 +417,9 @@ angular.module('abs').controller('dcaeMicroServiceController', function ($scope,
enumAttributes = enumAttributes.replace("[", "");
enumAttributes = enumAttributes.replace("]", "");
enumAttributes = enumAttributes.replace(/ /g, '');
-
var dropListAfterCommaSplit = enumAttributes.split(splitEqual);
listemunerateValues = dropListAfterCommaSplit[1].split(splitComma);
-
- enumKeyList.push(attribute);
-
+ //enumKeyList.push(attribute);
return listemunerateValues;
}
@@ -704,7 +719,10 @@ angular.module('abs').controller('dcaeMicroServiceController', function ($scope,
option.appendChild(document.createTextNode(listemunerateValues[i]));
listField.appendChild(option);
}
- listField.setAttribute("id" , ''+ labelLevel + attributeName + '');;
+ listField.setAttribute("id" , ''+ labelLevel + attributeName + '');
+
+ enumKeyList.push(attributeName);
+
document.getElementById(divID).appendChild(label);
document.getElementById(divID).appendChild(br);
@@ -750,6 +768,11 @@ angular.module('abs').controller('dcaeMicroServiceController', function ($scope,
}
$scope.savePolicy = function(policy){
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
var splitAt = '*';
var dot ='.';
@@ -926,4 +949,4 @@ angular.module('abs').controller('dcaeMicroServiceController', function ($scope,
}
return obj;
}
-}); \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
index f5932e2f4..d0c72682b 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DecisionPolicyController.js
@@ -17,10 +17,23 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('decisionPolicyController', function ($scope, PolicyAppService, modalService, $modal, Notification) {
+angular.module('abs').controller('decisionPolicyController', ['$scope', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
if($scope.temp.policy.ruleProvider==undefined){
$scope.temp.policy.ruleProvider="Custom";
@@ -76,6 +89,11 @@ angular.module('abs').controller('decisionPolicyController', function ($scope, P
}
$scope.saveDecisionPolicy = function(policy){
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
console.log(policy);
var uuu = "policycreation/save_policy";
@@ -146,7 +164,7 @@ angular.module('abs').controller('decisionPolicyController', function ($scope, P
$scope.temp.policy.attributes = [];
$scope.temp.policy.settings = [];
$scope.temp.policy.ruleAlgorithmschoices = [];
- }else{
+ }else if($scope.temp.policy.ruleProvider=="Custom"){
if($scope.temp.policy.attributes.length == 0){
$scope.temp.policy.attributes = [];
}
@@ -206,4 +224,4 @@ angular.module('abs').controller('decisionPolicyController', function ($scope, P
$scope.temp.policy.attributes = [];
}
};
-}); \ No newline at end of file
+}]); \ No newline at end of file
diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js
index cc051769c..46b6711cd 100644
--- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js
+++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/FirewallPolicyController.js
@@ -17,11 +17,23 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-angular.module('abs').controller('fwPolicyController', function ($scope, $window, PolicyAppService, modalService, $modal, Notification) {
+angular.module('abs').controller('fwPolicyController', ['$scope', '$window', 'PolicyAppService', 'policyNavigator', 'modalService', '$modal', 'Notification', function ($scope, $window, PolicyAppService, PolicyNavigator, modalService, $modal, Notification) {
$("#dialog").hide();
+ $scope.policyNavigator;
$scope.savebutton = true;
- $scope.finalPath = null;
+ $scope.refreshCheck = false;
+
+ $scope.refresh = function(){
+ if($scope.refreshCheck){
+ $scope.policyNavigator.refresh();
+ }
+ $scope.modal('createNewPolicy', true);
+ };
+
+ $scope.modal = function(id, hide) {
+ return $('#' + id).modal(hide ? 'hide' : 'show');
+ };
PolicyAppService.getData('getDictionary/get_SecurityZoneDataByName').then(function (data) {
var j = data;
@@ -113,6 +125,11 @@ angular.module('abs').controller('fwPolicyController', function ($scope, $window
$scope.saveFWPolicy = function(policy){
+ if(policy.itemContent != undefined){
+ $scope.refreshCheck = true;
+ $scope.policyNavigator = policy.itemContent;
+ policy.itemContent = "";
+ }
$scope.savebutton = false;
console.log(policy);
var uuu = "policycreation/save_policy";
@@ -224,4 +241,4 @@ angular.module('abs').controller('fwPolicyController', function ($scope, $window
$scope.temp.policy.fwattributes.splice(lastItem);
};
-}); \ No newline at end of file
+}]); \ No newline at end of file