Fixed Sonar issues for Console Logs
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplateController / BaseConfigPolicyController.js
index 891e409..f950e74 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.
@@ -25,6 +25,13 @@ app.controller('baseConfigController', ['$scope', 'PolicyAppService', 'policyNav
     $scope.savebutton = true;
     $scope.refreshCheck = false;
     
+    if(!$scope.temp.policy.editPolicy  && !$scope.temp.policy.readOnly){
+       $scope.temp.policy = {
+               policyType : "Config",
+               configPolicyType : "Base"
+       }
+    }
+    
     $scope.refresh = function(){
        if($scope.refreshCheck){
                $scope.policyNavigator.refresh();
@@ -75,14 +82,6 @@ app.controller('baseConfigController', ['$scope', 'PolicyAppService', 'policyNav
     }, 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.savePolicy = function(policy){
        if(policy.itemContent != undefined){
@@ -178,4 +177,4 @@ app.controller('baseConfigController', ['$scope', 'PolicyAppService', 'policyNav
         var lastItem = $scope.temp.policy.attributes.length-1;
         $scope.temp.policy.attributes.splice(lastItem);
     };
-}]);
\ No newline at end of file
+}]);