From 52ef94725081dff105d9c96c60985f1334f39e96 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Wed, 30 Aug 2017 16:09:59 -0400 Subject: [PATCH] Configure sonar code coverage; use EPSDK 1.3.0 Also use this commit to mark delivery of many feature issues Issue: PORTAL-26, PORTAL-28, PORTAL-29, PORTAL-50, PORTAL-69, PORTAL-76, PORTAL-82, PORTAL-89 Change-Id: Ib3e8487c5eb3d39dcdae1450deac6d255449debc Signed-off-by: Christopher Lott (cl778h) --- ecomp-portal-BE-common/pom.xml | 22 +++-- .../service/ExternalAccessRolesServiceImpl.java | 18 ++-- .../portal/service/UserRolesCommonServiceImpl.java | 8 +- ecomp-portal-BE-os/pom.xml | 105 ++++++++++++--------- ecomp-portal-FE-common/client/app/router.js | 2 +- .../client/app/views/errors/error.controller.js | 20 ++++ .../client/app/views/errors/error.tpl.html | 31 ++++++ ecomp-portal-FE-os/pom.xml | 9 ++ ecomp-portal-widget-ms/common-widgets/pom.xml | 2 +- ecomp-portal-widget-ms/widget-ms/pom.xml | 7 ++ 10 files changed, 158 insertions(+), 66 deletions(-) create mode 100644 ecomp-portal-FE-common/client/app/views/errors/error.controller.js create mode 100644 ecomp-portal-FE-common/client/app/views/errors/error.tpl.html diff --git a/ecomp-portal-BE-common/pom.xml b/ecomp-portal-BE-common/pom.xml index af828cf2..79968b3a 100644 --- a/ecomp-portal-BE-common/pom.xml +++ b/ecomp-portal-BE-common/pom.xml @@ -12,27 +12,31 @@ 4.3.11.Final 1.0.0 2.7.4 - 1.3.0-SNAPSHOT + 1.3.0 UTF-8 true https://nexus.onap.org /content/repositories/snapshots/ + content/repositories/staging/ /content/repositories/releases/ - - ecomp-releases - OpenECOMP - Release Repository - ${nexusproxy}/${releaseNexusPath} + onap-releases + ONAP - Release Repository + ${nexusproxy}/${releaseNexusPath} - - ecomp-snapshots - OpenECOMP - Snapshot Repository - ${nexusproxy}/${snapshotNexusPath} + onap-staging + ONAP - Staging Repository + ${nexusproxy}/${stagingNexusPath} + + + onap-snapshots + ONAP - Snapshot Repository + ${nexusproxy}/${snapshotNexusPath} diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java index 17d9ceb0..491743f5 100644 --- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java @@ -444,15 +444,15 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic List getRoleCreated = null; if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) { List roleCreated = dataAccessService.getList(EPRole.class, - " where role_name = '" + addRoleInDB.getName() +"'", null, null); + " where role_name = '" + addRoleInDB.getName() +"' and app_id = "+ app.getId(), null, null); EPRole epUpdateRole = roleCreated.get(0); epUpdateRole.setAppRoleId(epUpdateRole.getId()); dataAccessService.saveDomainObject(epUpdateRole, null); getRoleCreated = dataAccessService.getList(EPRole.class, - " where role_name = '" + addRoleInDB.getName() +"'", null, null); + " where role_name = '" + addRoleInDB.getName() +"' and app_id = "+ app.getId() , null, null); } else{ getRoleCreated = dataAccessService.getList(EPRole.class, - " where role_name = '" + addRoleInDB.getName() +"'", null, null); + " where role_name = '" + addRoleInDB.getName() +"' and app_id is null", null, null); } // Add role in External Access system boolean response = addNewRoleInExternalSystem(getRoleCreated, app); @@ -611,7 +611,7 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic if (((epApp.getId().equals(app.getId())) && (!userApp.getRole().getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID))) || ((epApp.getId().equals(PortalConstants.PORTAL_APP_ID)) - && (globalRole.startsWith("global_")))) { + && (globalRole.toLowerCase().startsWith("global_")))) { CentralUserApp cua = new CentralUserApp(); cua.setUserId(null); CentralApp cenApp = new CentralApp(1L, epApp.getCreated(), epApp.getModified(), @@ -633,7 +633,13 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic roleFunc.getCode(), roleFunc.getName(), null, null); roleFunctionSet.add(cenRoleFunc); } - CentralRole cenRole = new CentralRole(userApp.getRole().getAppRoleId(), + Long userRoleId = null; + if(globalRole.toLowerCase().startsWith("global_") && epApp.getId().equals(PortalConstants.PORTAL_APP_ID)){ + userRoleId = userApp.getRole().getId(); + } else{ + userRoleId = userApp.getRole().getAppRoleId(); + } + CentralRole cenRole = new CentralRole(userRoleId, userApp.getRole().getCreated(), userApp.getRole().getModified(), userApp.getRole().getCreatedId(), userApp.getRole().getModifiedId(), userApp.getRole().getRowNum(), userApp.getRole().getName(), @@ -750,7 +756,7 @@ public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesServic } catch (Exception e) { logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunction failed", e); - throw new Exception("getRoleFunction failed"); + throw new Exception("getRoleFunction failed", e); } return getRoleFuncList.get(0); } diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java index 1315c5e9..7e7a55a1 100644 --- a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java @@ -771,9 +771,10 @@ public class UserRolesCommonServiceImpl { * @param mapper * @param searchService * @param applicationsRestClientService + * @return * @throws Exception */ - private void addRemoteUser(List roleInAppForUserList, String userId, EPApp app, ObjectMapper mapper, SearchService searchService, ApplicationsRestClientService applicationsRestClientService) throws Exception{ + private EPUser addRemoteUser(List roleInAppForUserList, String userId, EPApp app, ObjectMapper mapper, SearchService searchService, ApplicationsRestClientService applicationsRestClientService) throws Exception{ EPUser addRemoteUser = null; if (remoteUserShouldBeCreated(roleInAppForUserList)) { @@ -787,6 +788,7 @@ public class UserRolesCommonServiceImpl { // return null; } } + return addRemoteUser; } /** @@ -882,7 +884,7 @@ public class UserRolesCommonServiceImpl { remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService); if (remoteAppUser == null) { - addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService); + remoteAppUser = addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService); } if (remoteAppUser != null) { Set userRolesInRemoteApp = postUsersRolesToRemoteApp(roleInAppForUserList, mapper, @@ -1336,7 +1338,7 @@ public class UserRolesCommonServiceImpl { EPUser remoteAppUser = null; remoteAppUser = checkIfRemoteUserExits(userId.getOrgUserId(), app, applicationsRestClientService); if (remoteAppUser == null) { - addRemoteUser(roleInAppForUserList, userId.getOrgUserId(), app, mapper, searchService, applicationsRestClientService); + remoteAppUser = addRemoteUser(roleInAppForUserList, userId.getOrgUserId(), app, mapper, searchService, applicationsRestClientService); reqMessage = "Saved Successfully"; } if (remoteAppUser != null) { diff --git a/ecomp-portal-BE-os/pom.xml b/ecomp-portal-BE-os/pom.xml index 22b13749..00e77c20 100644 --- a/ecomp-portal-BE-os/pom.xml +++ b/ecomp-portal-BE-os/pom.xml @@ -7,63 +7,50 @@ 1.1 + 1.3.0-SNAPSHOT + 1.3.0 + + 0 4.2.0.RELEASE 4.3.11.Final 1.0.0 - 1.3.0-SNAPSHOT - 1.3.0-SNAPSHOT UTF-8 - + false true - - 0 + ${project.build.directory}/coverage-reports/jacoco-ut.exec + 3.8 + jacoco + ${project.build.directory}/code-coverage/jacoco.exec + ${project.build.directory}/code-coverage/jacoco-it.exec + **.js https://nexus.onap.org content/repositories/snapshots/ + content/repositories/staging/ content/repositories/releases/ - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - false - org.umlgraph.doclet.UmlGraphDoc - - org.umlgraph - umlgraph - 5.6 - - -views - true - - - - - - - - ecomp-site - dav:${nexusproxy}/content/sites/site/org/onap/portal/${project.version} - - onap-releases + ONAP - Release Repository ${nexusproxy}/${releaseNexusPath} + + onap-staging + ONAP - Staging Repository + ${nexusproxy}/${stagingNexusPath} + onap-snapshots + ONAP - Snapshot Repository ${nexusproxy}/${snapshotNexusPath} onap-public - https://nexus.onap.org/content/groups/public + ${nexusproxy}/content/groups/public @@ -98,28 +85,25 @@ 1.8 - + org.jacoco jacoco-maven-plugin 0.7.5.201505241946 - + is passed as VM argument when Maven the Surefire plugin is executed. --> pre-unit-test prepare-agent - - ${basedir}/target/coverage-reports/jacoco-ut.exec - + + ${jacoco.data.file} + surefireArgLine ${skipCoverage} - @@ -130,12 +114,11 @@ report - - ${project.build.directory}/coverage-reports/jacoco-ut.exec - + + ${jacoco.data.file} + ${project.reporting.outputDirectory}/jacoco-ut ${skipCoverage} - +
+
+
+

{{errorTitle}}

+
+
+

{{errorMsg}}

+
+ +
+ +
diff --git a/ecomp-portal-FE-os/pom.xml b/ecomp-portal-FE-os/pom.xml index aa853498..ae3921ad 100644 --- a/ecomp-portal-FE-os/pom.xml +++ b/ecomp-portal-FE-os/pom.xml @@ -21,9 +21,18 @@ ${basedir}/client/app + + ${basedir}/dist + ${basedir}/.tmp + + ${basedir}/node + + + ${basedir}/node_modules +
diff --git a/ecomp-portal-widget-ms/common-widgets/pom.xml b/ecomp-portal-widget-ms/common-widgets/pom.xml index a71c5ac5..6a6d54bd 100644 --- a/ecomp-portal-widget-ms/common-widgets/pom.xml +++ b/ecomp-portal-widget-ms/common-widgets/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.openecomp.portal - widget-ms-widgets-os + common-widgets 1.3.0-SNAPSHOT pom diff --git a/ecomp-portal-widget-ms/widget-ms/pom.xml b/ecomp-portal-widget-ms/widget-ms/pom.xml index dcab5721..b421ebd5 100644 --- a/ecomp-portal-widget-ms/widget-ms/pom.xml +++ b/ecomp-portal-widget-ms/widget-ms/pom.xml @@ -25,6 +25,13 @@ + + + org.openecomp.portal + common-widgets + ${project.version} + pom + org.springframework.boot -- 2.16.6