Resolved Policy GUI Issues
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / js / controllers / policyManager.js
index 869d26b..7568030 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * ECOMP Policy Engine
+ * ONAP Policy Engine
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -58,11 +58,11 @@ app.controller('PolicyManagerController', [
                console.log("failed");
         });
 
-        PolicyAppService.getData('getDictionary/get_EcompNameDataByName').then(function(data){
+        PolicyAppService.getData('getDictionary/get_OnapNameDataByName').then(function(data){
                var j = data;
                $scope.data = JSON.parse(j.data);
                console.log($scope.data);
-               $scope.ecompNameDictionaryDatas = JSON.parse($scope.data.ecompNameDictionaryDatas);     
+               $scope.onapNameDictionaryDatas = JSON.parse($scope.data.onapNameDictionaryDatas);       
         }, function (error) {
                console.log("failed");
         });
@@ -186,7 +186,7 @@ app.controller('PolicyManagerController', [
             return currentPath.indexOf(path) !== -1;
         };
          
-       $scope.watch = function(item){
+       $scope.watchPolicy = function(item){
            var uuu = "watchPolicy";
            var data = {name : item.model.name,
                           path : item.model.path};
@@ -208,55 +208,12 @@ app.controller('PolicyManagerController', [
                }
            });
        };
-       
-           $scope.search = function(search){
-                   var deferred = $q.defer();
-           var uuu = "searchPolicy";
-           var postData = {searchdata : search};
-           $.ajax({
-               type : 'POST',
-               url : uuu,
-               dataType: 'json',
-               contentType: 'application/json',
-               data: JSON.stringify(postData),
-               success : function(data){
-                   $scope.$apply(function(){
-                       $scope.searchdata=data.result;});
-                   if($scope.searchdata[0].error != undefined){
-                          Notification.info($scope.searchdata[0].error);
-                   }else{
-                       var j = data;  
-                       $scope.data = JSON.stringify(data.result);
-                          $scope.searchDatas = JSON.parse($scope.data);           
-                                               var searchString = "Policies List" + "<br>";
-                                               var i;
-                                               for(i = 0 ; i < $scope.searchDatas.length; i++){
-                                                       searchString += $scope.searchDatas[i].name + ".xml" + "<br>";
-                                               }
-                                                var myWindow = window.open("", "MsgWindow", "width=500,height=500");
-                                                myWindow.document.write("<p>Search List</p>");
-                                                myWindow.document.write("<p>"+searchString+"</p>");
-                   }      
-               },
-               error : function(data){
-                   alert("Error while Searching.");
-               }
-           });
-       };
-          
-      
-        /* $scope.describePolicy = function(item){
-                item.describePolicy().then(function(){
-                        $scope.modal('describePolicy', true);
-                });
-         };
-         
-         $scope.exportPolicy = function(item){
-                item.exportPolicy().then(function(){
-                        $scope.modal('exportPolicy', true);
-                });
-         };*/
+     
          
+       $scope.refresh = function(){
+          $scope.policyNavigator.refresh();
+       };
+       
          $scope.switchVersion = function(item){
                 if ($scope.policyNavigator.fileNameExists(item.tempModel.content.activeVersion)) {
                  item.error = 'Invalid filename or already exists, specify another name';
@@ -268,13 +225,6 @@ app.controller('PolicyManagerController', [
                 });
          };
 
-
-        /* $scope.viewPolicy = function(item){
-                item.viewPolicy().then(function(){
-                        $scope.modal('createNewPolicy', true);
-                });
-         };*/
-
         $scope.copy = function(item) {
             var samePath = item.tempModel.path.join() === item.model.path.join();
             if (samePath && $scope.policyNavigator.fileNameExists(item.tempModel.name)) {