fix code smells and vulnerabilities monitoring 62/118862/5
authormkidd <michael.kidd@est.tech>
Thu, 4 Mar 2021 15:27:27 +0000 (15:27 +0000)
committermkidd <michael.kidd@est.tech>
Wed, 10 Mar 2021 16:21:17 +0000 (16:21 +0000)
removed / from start of Rest path, hard coded it - resolves code smell issue
small code smell changes regarding passing variables to functions that have access to the variable from its current scope
reintroduced data parameter being passed in MonitoringUtils.js, can look into this more later
fixed pom for parent version, commons step up

Issue-ID: POLICY-3095
Signed-off-by: mkidd <michael.kidd@est.tech>
Change-Id: Id8b6a8b41e9b3c2f362821750d3fa728b93336a0
Signed-off-by: mkidd <michael.kidd@est.tech>
gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringServerParameters.java
gui-pdp-monitoring/src/webapp/js/PdpInformation.js
gui-pdp-monitoring/src/webapp/js/PdpListView.js
pom.xml

index 614d47d..a76fa02 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020-2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ public class PdpMonitoringServerParameters {
 
     // Base URI the HTTP server will listen on
     private static final String DEFAULT_SERVER_URI_ROOT = "http://0.0.0.0:";
-    private static final String DEFAULT_REST_PATH = "/papservices/*";
+    private static final String DEFAULT_REST_PATH = "papservices/*";
     private static final String DEFAULT_CONTEXT_PATH = "/";
     private static final String SERVER_HOST = "0.0.0.0";
     private static final int DEFAULT_REST_PORT = 17999;
@@ -70,7 +70,7 @@ public class PdpMonitoringServerParameters {
     }
 
     public URI getBaseUri() {
-        return URI.create(DEFAULT_SERVER_URI_ROOT + port + DEFAULT_REST_PATH);
+        return URI.create(DEFAULT_SERVER_URI_ROOT + port + "/" + DEFAULT_REST_PATH);
     }
 
     public String getRestPackage() {
@@ -86,7 +86,7 @@ public class PdpMonitoringServerParameters {
     }
 
     public String getDefaultRestPath() {
-        return DEFAULT_REST_PATH;
+        return "/" + DEFAULT_REST_PATH;
     }
 
     public int getDefaultRestPort() {
index cbb71a7..f25c245 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020-2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,6 +60,6 @@ function setEngineServiceData(engineId, groupName, subGroupName, healthStatus, p
             engineServiceTable.find("#" + tableId + "_" + headers[h]).html(data[h]);
         }
     }
-};
+}
 
 export { createEngineServiceTable, setEngineServiceData };
\ No newline at end of file
index 1457a9e..9ae5c23 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020-2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -70,6 +70,6 @@ function highlightSelected (id){
         el.classList.remove('pdps__link--active');
     });
     document.querySelector(`.pdps__link[href*="${id}"]`).classList.add('pdps__link--active');
-};
+}
 
 export { RenderPdpList, highlightSelected, };
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 07145ce..f839bf3 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@
     <parent>
         <groupId>org.onap.policy.parent</groupId>
         <artifactId>integration</artifactId>
-        <version>3.3.0-SNAPSHOT</version>
+        <version>3.3.1-SNAPSHOT</version>
         <relativePath />
     </parent>
 
@@ -40,8 +40,8 @@
     <description>Code for all the Policy GUI's.</description>
 
     <properties>
-        <policy.common.version>1.8.0-SNAPSHOT</policy.common.version>
-        <policy.models.version>2.4.0-SNAPSHOT</policy.models.version>
+        <policy.common.version>1.8.1-SNAPSHOT</policy.common.version>
+        <policy.models.version>2.4.2-SNAPSHOT</policy.models.version>
         <jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
         <sonar.javascript.lcov.reportPaths>${project.basedir}/target/code-coverage/lcov.info</sonar.javascript.lcov.reportPaths>
     </properties>