Added Policy GUI Cosmetic Fixes
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplateController / BaseConfigPolicyController.js
index 20287ba..7425c92 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * ECOMP Policy Engine
+ * ONAP Policy Engine
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
@@ -25,23 +25,40 @@ 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();
        }
        $scope.modal('createNewPolicy', true);
+       $scope.temp.policy = "";
     };
     
     $scope.modal = function(id, hide) {
         return $('#' + id).modal(hide ? 'hide' : 'show');
     };
     
-    PolicyAppService.getData('getDictionary/get_EcompNameDataByName').then(function (data) {
+    $('#ttlDate').datepicker({
+       dateFormat: 'dd/mm/yy',
+       changeMonth: true,
+       changeYear: true,
+       onSelect: function(date) {
+               angular.element($('#ttlDate')).triggerHandler('input');
+       }
+    });
+    
+    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);
-       console.log($scope.ecompNameDictionaryDatas);
+       $scope.onapNameDictionaryDatas = JSON.parse($scope.data.onapNameDictionaryDatas);
+       console.log($scope.onapNameDictionaryDatas);
     }, function (error) {
        console.log("failed");
     });