X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fwebapp%2Fapp%2FpolicyApp%2Fpolicy-models%2FEditor%2FPolicyTemplateController%2FBRMSParamPolicyController.js;h=22511c5a76c25228681fb98579ff9bb34a0ae043;hb=09e5ff42a2994650584b87ced8a1549e816408f7;hp=ebec3a52622560ea87b652fc428006da47b01470;hpb=dda032f8bb161d54eb1f59de2b4a3efb774fc4d1;p=policy%2Fengine.git 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 ebec3a526..22511c5a7 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 @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * ECOMP Policy Engine + * ONAP Policy Engine * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -24,17 +24,34 @@ angular.module('abs').controller('brmsParamPolicyController', ['$scope', '$windo $scope.savebutton = true; $scope.refreshCheck = false; + if(!$scope.temp.policy.editPolicy && !$scope.temp.policy.readOnly){ + $scope.temp.policy = { + policyType : "Config", + configPolicyType : "BRMS_Param" + } + }; + $scope.refresh = function(){ if($scope.refreshCheck){ $scope.policyNavigator.refresh(); } $scope.modal('createNewPolicy', true); + $scope.temp.policy = ""; }; $scope.modal = function(id, hide) { return $('#' + id).modal(hide ? 'hide' : 'show'); }; + $('#ttlDate').datepicker({ + dateFormat: 'dd/mm/yy', + changeMonth: true, + changeYear: true, + onSelect: function(date) { + angular.element($('#ttlDate')).triggerHandler('input'); + } + }); + $scope.validateSuccess = true; var readValue = $scope.temp.policy.readOnly; if(readValue){ @@ -106,6 +123,8 @@ angular.module('abs').controller('brmsParamPolicyController', ['$scope', '$windo } }; + $scope.showbrmsrule = true; + $scope.ShowRule = function(policy){ console.log(policy); var uuu = "policyController/ViewBRMSParamPolicyRule.htm"; @@ -117,21 +136,10 @@ angular.module('abs').controller('brmsParamPolicyController', ['$scope', '$windo contentType: 'application/json', data: JSON.stringify(postData), success : function(data){ + $scope.showbrmsrule = false; + $scope.validateSuccess = true; $scope.$apply(function(){ $scope.datarule = data.policyData; - var modalInstance = $modal.open({ - backdrop: 'static', keyboard: false, - templateUrl : 'brmsshowrule', - controller: 'showrulecontroller', - resolve: { - message: function () { - var message = { - datas: $scope.datarule - }; - return message; - } - } - }); }); }, error : function(data){ @@ -140,6 +148,12 @@ angular.module('abs').controller('brmsParamPolicyController', ['$scope', '$windo }); }; + $scope.hideRule = function(){ + $scope.showbrmsrule = true; + $scope.validateSuccess = false; + $scope.apply(); + }; + $scope.saveBrmsParamPolicy = function(policy){ if(policy.itemContent != undefined){ $scope.refreshCheck = true; @@ -247,15 +261,4 @@ angular.module('abs').controller('brmsParamPolicyController', ['$scope', '$windo 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){ - $scope.datarule=message.datas; - } - - $scope.close = function() { - $modalInstance.close(); - }; - -}); \ No newline at end of file +}]); \ No newline at end of file