diff options
author | uj426b <uj426b@att.com> | 2020-07-21 16:40:02 -0400 |
---|---|---|
committer | uj426b <uj426b@att.com> | 2020-07-22 14:37:11 -0400 |
commit | d262404ee1b85625f0e36b96cdad05117ffe9147 (patch) | |
tree | a7f9a46e84c7dd5f14fde67bee0299e6ea2b1ba6 | |
parent | 846be9a1a49034d46fcf432b9ccbe8bb9726c052 (diff) |
MS Model GUI fix for edit/view
Change-Id: Ia8ec5b8ec9d604ba739eed34b7080079380fb98f
Issue-ID: POLICY-2723
Signed-off-by: uj426b <uj426b@att.com>
2 files changed, 6 insertions, 5 deletions
diff --git a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java index 70be83208..aa2c8f3d8 100644 --- a/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java +++ b/ONAP-REST/src/main/java/org/onap/policy/rest/util/PolicyValidation.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP Policy Engine * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,7 +40,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; - +import java.util.stream.Collectors; import javax.json.Json; import javax.json.JsonException; import javax.json.JsonObject; @@ -1345,7 +1345,8 @@ public class PolicyValidation { Map<String, String> attributesMap = null; if (",".equals(attributes.substring(attributes.length() - 1))) { String attributesString = attributes.substring(0, attributes.length() - 1); - attributesMap = Splitter.on(",").withKeyValueSeparator("=").split(attributesString); + attributesMap = Splitter.on(",").splitToList(attributesString).stream().map(kv -> kv.split("=")) + .collect(Collectors.toMap(kv -> kv[0], kv -> kv[1], (exist, d2) -> exist)); } else if (!StringUtils.isBlank(modelAttributes)) { attributesMap = Splitter.on(",").withKeyValueSeparator("=").split(modelAttributes); } else { diff --git a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js index 1e452e830..c3716654c 100644 --- a/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js +++ b/POLICY-SDK-APP/src/main/webapp/app/policyApp/policy-models/Editor/PolicyTemplateController/DCAEMicroServicePolicyController.js @@ -1493,14 +1493,14 @@ angular.module('abs').controller('dcaeMicroServiceController', }else{ if(splitPlainAttributeKey[1]!= undefined && splitPlainAttributeKey[1] == "boolean"){ jsonPolicy[key]= false; - for(var i=0; i<booleanTrueElements.length; i++){ + for(var i=0; i<booleanTrueElements.length; i++){ if(booleanTrueElements[i] == key){ jsonPolicy[key]= true; } } }else{ - jsonPolicy[key]= searchElement.value; + jsonPolicy[key]= window.btoa(searchElement.value); } } } else { |