From 84b95a134c61217667b7eb7b7e774a485d2406ba Mon Sep 17 00:00:00 2001 From: rb7147 Date: Tue, 12 Sep 2017 14:43:59 -0400 Subject: Resolved Policy GUI Issues Resolved the time to leave date issue field to support all browsers. Resolved Export and Import Policy Functionality. Added few GUI cosmetic fixes. Issue-Id : POLICY-221 Change-Id: I920a4d9c8e16ae1cffcd13df3319e109a992ba55 Signed-off-by: rb7147 --- .../pap/xacml/rest/policycontroller/PolicyCreation.java | 2 +- .../policy/pap/xacml/rest/util/AbstractPolicyCreation.java | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'ONAP-PAP-REST/src/main/java') diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java index d989470a2..64324d432 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/policycontroller/PolicyCreation.java @@ -115,7 +115,7 @@ public class PolicyCreation extends AbstractPolicyCreation{ policyData.setTtlDate("NA"); }else{ String dateTTL = policyData.getTtlDate(); - String newDate = convertDate(dateTTL, false); + String newDate = convertDate(dateTTL); policyData.setTtlDate(newDate); } diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java index 71de2b297..aa33729c9 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/util/AbstractPolicyCreation.java @@ -40,18 +40,10 @@ public abstract class AbstractPolicyCreation { getDomain().replaceAll("[/\\\\.]", ":"), "xacml", "policy", "id", UUID.randomUUID()); } - public String convertDate(String dateTTL, boolean portalType) { + public String convertDate(String dateTTL) { String formateDate = null; - String[] date; - String[] parts; - - if (portalType){ - parts = dateTTL.split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; - } else { - date = dateTTL.split("T"); - parts = date[0].split("-"); - formateDate = parts[2] + "-" + parts[1] + "-" + parts[0]; + if(dateTTL.contains("/")){ + formateDate = dateTTL.replace("/", "-"); } return formateDate; } -- cgit 1.2.3-korg