Update css file name in conf.py
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplateController / ActionPolicyController.js
index 2892936..80c1146 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * 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,13 +24,19 @@ app.controller('actionPolicyController', ['$scope', 'PolicyAppService', 'policyN
     $scope.savebutton = true;
     $scope.refreshCheck = false;
        
+    if(!$scope.temp.policy.editPolicy  && !$scope.temp.policy.readOnly){
+       $scope.temp.policy = {
+                       policyType : "Action"
+       }
+    }
+    
     $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');
@@ -65,13 +71,6 @@ app.controller('actionPolicyController', ['$scope', 'PolicyAppService', 'policyN
     }, function (error) {
        console.log("failed");
     });
-
-    function extend(obj, src) {
-        for (var key in src) {
-            if (src.hasOwnProperty(key)) obj[key] = src[key];
-        }
-        return obj;
-    }
     
     $scope.saveActionPolicy = function(policy){
        if(policy.itemContent != undefined){
@@ -185,4 +184,4 @@ app.controller('actionPolicyController', ['$scope', 'PolicyAppService', 'policyN
       $scope.temp.policy.ruleAlgorithmschoices.splice(lastItem);
     };
     
-}]);
\ No newline at end of file
+}]);