Merge "Fixed SonarIssues Alerts to Bootstrap Notification"
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplateController / BRMSRawPolicyController.js
index 97f6d29..3e75e05 100644 (file)
@@ -1,8 +1,8 @@
 /*-
  * ============LICENSE_START=======================================================
- * ECOMP Policy Engine
+ * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,17 +24,34 @@ angular.module('abs').controller('brmsRawPolicyController', ['$scope', '$window'
     $scope.savebutton = true;
     $scope.refreshCheck = false;
     
+    if(!$scope.temp.policy.editPolicy  && !$scope.temp.policy.readOnly){
+       $scope.temp.policy = {
+               policyType : "Config",
+               configPolicyType : "BRMS_Raw"
+       }
+    }
+    
     $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');
+       }
+    });
+    
     PolicyAppService.getData('getDictionary/get_BRMSControllerDataByName').then(function (data) {
        var j = data;
        $scope.data = JSON.parse(j.data);
@@ -142,13 +159,6 @@ angular.module('abs').controller('brmsRawPolicyController', ['$scope', '$window'
                });
     };
     
-    function extend(obj, src) {
-        for (var key in src) {
-            if (src.hasOwnProperty(key)) obj[key] = src[key];
-        }
-        return obj;
-    }
-
     if(!$scope.temp.policy.editPolicy  && !$scope.temp.policy.readOnly){
        $scope.temp.policy.attributes = [];
     }else{
@@ -165,4 +175,4 @@ angular.module('abs').controller('brmsRawPolicyController', ['$scope', '$window'
       var lastItem = $scope.temp.policy.attributes.length-1;
       $scope.temp.policy.attributes.splice(lastItem);
     };
-}]);
\ No newline at end of file
+}]);