From e0a5c40af5c32450a52347de83dc3d78c692c1ef Mon Sep 17 00:00:00 2001 From: xg353y Date: Thu, 9 Nov 2017 16:52:37 +0100 Subject: [PATCH] Fix Properties CL UI issue Fix the issue in Properties CL window, where the first service doesn't show the corresponding vf settings Change-Id: I59f1f5117f453f1cb385d4789288a5b8a690e7e9 Signed-off-by: xg353y Issue-ID: CLAMP-68 --- .../org/onap/clamp/clds/service/CldsService.java | 2 +- .../partials/portfolios/global_properties.html | 50 +++++++++++----------- .../designer/scripts/GlobalPropertiesCtrl.js | 2 + .../META-INF/resources/designer/scripts/aOnBoot.js | 9 ---- .../META-INF/resources/designer/scripts/app.js | 2 +- .../resources/clds/clds-policy-config.properties | 4 +- src/main/resources/logback.xml | 23 +++++----- 7 files changed, 41 insertions(+), 51 deletions(-) diff --git a/src/main/java/org/onap/clamp/clds/service/CldsService.java b/src/main/java/org/onap/clamp/clds/service/CldsService.java index 15706345..f9eeeb58 100644 --- a/src/main/java/org/onap/clamp/clds/service/CldsService.java +++ b/src/main/java/org/onap/clamp/clds/service/CldsService.java @@ -937,7 +937,7 @@ public class CldsService extends SecureServiceBase { JsonNode globalNode = modelJson.get("global"); String service = AbstractModelElement.getValueByName(globalNode, "service"); List resourceVf = AbstractModelElement.getValuesByName(globalNode, "vf"); - if (resourceVf != null && !resourceVf.isEmpty()) { + if (service != null && resourceVf != null && !resourceVf.isEmpty()) { List cldsModelPropList = cldsDao.getAllModelProperties(); for (CldsModelProp cldsModelProp : cldsModelPropList) { JsonNode currentJson = new ObjectMapper().readTree(cldsModelProp.getPropText()); diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html index 755ad7df..c2306140 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/global_properties.html @@ -213,35 +213,33 @@ (function () { $("#paramsWarn").hide(); /*Below service method is called for checking the service is being loaded or not*/ - + var intialize = intializeService; - + function intializeService() { $("#service").off('focus').off('change'); - - $("#service").on('change', function(){ - var chosen = $(this).val(); - (function(spinner){ - $("#ridinSpinners").show(); - setTimeout(spinner, 1); - })(function(){ - loadSharedPropertyByService(chosen, null, intialize); - if (elementMap["global"]){ - if ($("#vf").val() == oldVf){ - vfDiff = false; - if ((!vfDiff)&&(!asDiff)&&(!serDiff)){ + + $("#service").on('change', function(){ + var chosen = $(this).val(); + (function(spinner){ + $("#ridinSpinners").show(); + setTimeout(spinner, 1); + })(function(){ + loadSharedPropertyByService(chosen, null, intialize); + if (elementMap["global"]){ + if ($("#vf").val() == oldVf){ + vfDiff = false; + if ((!vfDiff)&&(!asDiff)&&(!serDiff)){ $(".propChangeWarn").hide(); }; - } else { - vfDiff = true; - $(".propChangeWarn").show(); - } - } - - $("#ridinSpinners").hide(); - }); - }); - + } else { + vfDiff = true; + $(".propChangeWarn").show(); + } + } + $("#ridinSpinners").hide(); + }); + }); } loadSharedPropertyByService(undefined, null, intialize); @@ -276,7 +274,9 @@ var f={} f.name=s f.value=select[s] - arr.push(f) + if (!(s=="service" && f.value=="")){ + arr.push(f) + } } return arr } diff --git a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js index fb810027..cd2f5ed1 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js +++ b/src/main/resources/META-INF/resources/designer/scripts/GlobalPropertiesCtrl.js @@ -27,6 +27,8 @@ app.controller('GlobalPropertiesCtrl', $scope.$watch('name', function(newValue, oldValue) { var services=asdc_Services setASDCFields() + // add blank service item as the default service, to force user chose the correct service by themselves + $("#service").append("") for(k in services){ $("#service").append("") } diff --git a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js index 01a39b62..c0a16ce2 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js +++ b/src/main/resources/META-INF/resources/designer/scripts/aOnBoot.js @@ -150,15 +150,6 @@ function loadSharedPropertyByService(onChangeUUID, refresh, callBack) { if (uuid === undefined) { uuid = elementMap["global"] && elementMap["global"].length > 0 ? elementMap["global"][0].value : ""; - } else if (uuid === "") { - vf_Services = null - if ($("#vf").length > 0) - $("#vf").empty().multiselect("refresh"); - if ($("#location").length > 0) - $("#location").empty().multiselect("refresh"); - if ($("#alarmCondition").length > 0) - $("#alarmCondition").empty().multiselect("refresh"); - return true; } var share = null, serviceUrl = '/restservices/clds/v1/clds/properties/' + uuid; diff --git a/src/main/resources/META-INF/resources/designer/scripts/app.js b/src/main/resources/META-INF/resources/designer/scripts/app.js index 3c723626..fd39a6f6 100644 --- a/src/main/resources/META-INF/resources/designer/scripts/app.js +++ b/src/main/resources/META-INF/resources/designer/scripts/app.js @@ -486,7 +486,7 @@ var app = angular.module('clds-app', ['ngRoute', link: "/refreshStatus", name: "Refresh Status" }, { - link: "/refreshASDCProperties", + link: "/cldsRefreshASDC", name: "Refresh ASDC" }], "Help": [{ diff --git a/src/main/resources/clds/clds-policy-config.properties b/src/main/resources/clds/clds-policy-config.properties index a2bc1faf..b812ffa7 100644 --- a/src/main/resources/clds/clds-policy-config.properties +++ b/src/main/resources/clds/clds-policy-config.properties @@ -21,8 +21,8 @@ # ECOMP is a trademark and service mark of AT&T Intellectual Property. ### # Configuration Settings for Policy Engine Components -PDP_URL1=https://vm1.policy.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123 -PDP_URL2=https://vm1.policy.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123 +PDP_URL1=http://vm1.policy.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123 +PDP_URL2=http://vm1.policy.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123 NOTIFICATION_TYPE=websocket NOTIFICATION_UEB_SERVERS=localhost NOTIFICATION_TOPIC= diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index a1330e3d..e02a320d 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -19,7 +19,7 @@ - WARN + INFO ${logDirectory}/CLAMP/error.log true @@ -45,16 +45,13 @@ %date{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX",UTC}|%X{RequestId}|%.20thread|%.-5level|%logger{36}|%msg%n - - 10 - ${logDirectory}/CLAMP/debug.%i.log.zip - - - + + ${logDirectory}/CLAMP/debug.%d{yyyy-MM-dd}.%i.log.zip + 10MB - + + 5 + - - + + + @@ -250,7 +248,6 @@ - -- 2.16.6