Merge "Fixed Portal-Multi-Tab Issue"
authorSunder Tattavarada <statta@research.att.com>
Tue, 7 Jul 2020 14:47:45 +0000 (14:47 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 7 Jul 2020 14:47:45 +0000 (14:47 +0000)
16 files changed:
ecomp-portal-BE-common/pom.xml
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/TicketEventController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserRolesController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java
ecomp-portal-BE-os/pom.xml
ecomp-portal-FE-os/pom.xml
ecomp-portal-widget-ms/common-widgets/pom.xml
ecomp-portal-widget-ms/pom.xml
ecomp-portal-widget-ms/widget-ms/pom.xml
pom.xml
portal-FE-common/src/app/layout/components/tabbar/tabbar.component.html
portal-FE-common/src/app/layout/components/tabbar/tabbar.component.ts
portal-FE-os/pom.xml

index 8e89aa2..85cf875 100644 (file)
@@ -5,7 +5,7 @@
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>3.3.0</version>
+               <version>3.4.0</version>
        </parent>
 
        <artifactId>portal-be-common</artifactId>
index 56a4df3..26559ae 100644 (file)
@@ -67,6 +67,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -105,7 +106,7 @@ public class TicketEventController implements BasicAuthenticationController {
     @ApiOperation(
             value = "Accepts messages from external ticketing systems and creates notifications for Portal users.",
             response = PortalRestResponse.class)
-    @RequestMapping(value = { "/ticketevent" }, method = RequestMethod.POST)
+    @PostMapping(value = { "/ticketevent" })
     public PortalRestResponse<String> handleRequest(HttpServletRequest request, HttpServletResponse response,
             @RequestBody String ticketEventJson) throws Exception {
 
index fc76a0e..eec14f7 100644 (file)
@@ -55,6 +55,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -79,7 +81,7 @@ public class UserController extends EPRestrictedBaseController {
         * 
         * @return PortalRestResponse of EPUser
         */
-       @RequestMapping(value = { "/portalApi/loggedinUser" }, method = RequestMethod.GET, produces = "application/json")
+       @GetMapping(value = { "/portalApi/loggedinUser" }, produces = "application/json")
        public PortalRestResponse<ProfileDetail> getLoggedinUser(HttpServletRequest request) {
                PortalRestResponse<ProfileDetail> portalRestResponse = null;
                try {
@@ -106,8 +108,8 @@ public class UserController extends EPRestrictedBaseController {
         *            Body with user information
         * @return PortalRestResponse of String
         */
-       @RequestMapping(value = {
-                       "/portalApi/modifyLoggedinUser" }, method = RequestMethod.PUT, produces = "application/json")
+       @PutMapping(value = {
+                       "/portalApi/modifyLoggedinUser" }, produces = "application/json")
        public PortalRestResponse<String> modifyLoggedinUser(HttpServletRequest request,
                        @RequestBody ProfileDetail profileDetail) {
                PortalRestResponse<String> portalRestResponse = null;
index cec01ba..8b87462 100644 (file)
@@ -51,10 +51,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.onap.portalapp.controller.EPRestrictedBaseController;
index b3d64db..906563c 100644 (file)
@@ -82,8 +82,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.EnableAspectJAutoProxy;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -117,7 +117,7 @@ public class UserRolesController extends EPRestrictedBaseController {
      * @param response HttpServletResponse
      * @return array of found users as json
      */
-    @RequestMapping(value = { "/portalApi/queryUsers" }, method = RequestMethod.GET, produces = "application/json")
+    @GetMapping(value = { "/portalApi/queryUsers" }, produces = "application/json")
     public String getPhoneBookSearchResult(HttpServletRequest request, @RequestParam("search") String searchString,
             HttpServletResponse response) {
         EPUser user = EPUserUtils.getUserSession(request);
@@ -147,8 +147,7 @@ public class UserRolesController extends EPRestrictedBaseController {
      * @param response HttpServletResponse
      * @return for GET: array of all applications with boolean isAdmin=true/false for each application
      */
-    @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/adminAppsRoles" }, produces = "application/json")
     public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(HttpServletRequest request,
             @RequestParam("user") String orgUserId, HttpServletResponse response) {
 
@@ -198,8 +197,7 @@ public class UserRolesController extends EPRestrictedBaseController {
      * @param response HttpServletResponse
      * @return FieldsValidator
      */
-    @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
-            RequestMethod.PUT }, produces = "application/json")
+    @PutMapping(value = { "/portalApi/adminAppsRoles" }, produces = "application/json")
     public FieldsValidator putAppsWithAdminRoleStateForUser(HttpServletRequest request,
             @RequestBody AppsListWithAdminRole newAppsListWithAdminRoles, HttpServletResponse response) {
 
@@ -275,8 +273,7 @@ public class UserRolesController extends EPRestrictedBaseController {
      * @param extRequestValue set to false if request is from users page otherwise true
      * @return List<RoleInAppForUser>
      */
-    @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/userAppRoles" }, produces = "application/json")
     public List<RoleInAppForUser> getAppRolesForUser(HttpServletRequest request, @RequestParam("user") String orgUserId,
             @RequestParam("app") Long appid, @RequestParam("externalRequest") Boolean extRequestValue,
             @RequestParam("isSystemUser") Boolean isSystemUser,
@@ -354,8 +351,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return result;
     }
 
-    @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
-            RequestMethod.PUT }, produces = "application/json")
+    @PutMapping(value = { "/portalApi/userAppRoles" }, produces = "application/json")
     public PortalRestResponse<String> putAppWithUserRoleStateForUser(HttpServletRequest request,
             @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
         // FieldsValidator fieldsValidator = new FieldsValidator();
@@ -435,8 +431,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return portalResponse;
     }
 
-    @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/updateRemoteUserProfile" }, produces = "application/json")
     public PortalRestResponse<String> updateRemoteUserProfile(HttpServletRequest request,
             HttpServletResponse response) {
 
@@ -455,8 +450,7 @@ public class UserRolesController extends EPRestrictedBaseController {
 
     }
 
-    @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/app/{appId}/users" }, produces = "application/json")
     public List<UserApplicationRoles> getUsersFromAppEndpoint(HttpServletRequest request,
             @PathVariable("appId") Long appId) throws HTTPException {
         try {
@@ -468,8 +462,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         }
     }
 
-    @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/app/{appId}/roles" }, produces = "application/json")
     public List<EcompRole> testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId)
             throws HTTPException {
         EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
@@ -480,8 +473,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return rolesList;
     }
 
-    @RequestMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, produces = "application/json")
     public List<EPRole> importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId)
             throws HTTPException {
         List<EPRole> rolesList = userRolesService.importRolesFromRemoteApplication(appId);
@@ -491,8 +483,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return rolesList;
     }
 
-    @RequestMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, produces = "application/json")
     public EcompRole testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
             @PathVariable("orgUserId") String orgUserId) throws Exception {
         if (!EcompPortalUtils.legitimateUserId(orgUserId)) {
@@ -513,8 +504,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return roles[0];
     }
 
-    @RequestMapping(value = { "/portalApi/saveUserAppRoles" }, method = {
-            RequestMethod.PUT }, produces = "application/json")
+    @PutMapping(value = { "/portalApi/saveUserAppRoles" }, produces = "application/json")
     public FieldsValidator putAppWithUserRoleRequest(HttpServletRequest request,
             @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
         FieldsValidator fieldsValidator = null;
@@ -534,8 +524,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return fieldsValidator;
     }
 
-    @RequestMapping(value = { "/portalApi/appCatalogRoles" }, method = {
-            RequestMethod.GET }, produces = "application/json")
+    @GetMapping(value = { "/portalApi/appCatalogRoles" }, produces = "application/json")
     public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(HttpServletRequest request,
             @RequestParam("appName") String appName) {
         EPUser user = EPUserUtils.getUserSession(request);
@@ -560,7 +549,7 @@ public class UserRolesController extends EPRestrictedBaseController {
                 }
             };
 
-    @RequestMapping(value = "/portalApi/externalRequestAccessSystem", method = RequestMethod.GET,
+    @GetMapping(value = "/portalApi/externalRequestAccessSystem",
             produces = "application/json")
     public ExternalSystemAccess readExternalRequestAccess(HttpServletRequest request) {
         ExternalSystemAccess result = null;
@@ -574,8 +563,7 @@ public class UserRolesController extends EPRestrictedBaseController {
         return result;
     }
 
-    @RequestMapping(value = { "/portalApi/checkIfUserIsSuperAdmin" }, method = RequestMethod.GET,
-            produces = "application/json")
+    @GetMapping(value = { "/portalApi/checkIfUserIsSuperAdmin" }, produces = "application/json")
     public boolean checkIfUserIsSuperAdmin(HttpServletRequest request,
             HttpServletResponse response) {
         EPUser user = EPUserUtils.getUserSession(request);
index a8eb1d6..929ac47 100644 (file)
@@ -81,7 +81,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.client.AsyncRestTemplate;
index a97dc58..7a7f9ee 100644 (file)
@@ -1127,8 +1127,7 @@ public class UserRolesCommonServiceImpl  {
                                                        userRolesInLocalApp);
                                        List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
                                        if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
-
-                                       // Apply changes in external Access system
+                                               // Apply changes in external Access system
                                                updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList,
                                                                epRequestValue,false,rolesGotDeletedFromApprover,checkIfUserisOnlyRoleAdmin);
                                        }
@@ -1147,7 +1146,7 @@ public class UserRolesCommonServiceImpl  {
                                        if(!app.getRolesInAAF() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)){
                                                
                                                remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService);
-               
+
                                                if (remoteAppUser == null) {
                                                        remoteAppUser = addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService);
                                                }
@@ -1655,6 +1654,7 @@ public class UserRolesCommonServiceImpl  {
                                                // If adding just account admin role dont make remote application user call or
                                                // if request has only single non admin role then make remote call
                                                if (!(app.getId().equals(PortalConstants.PORTAL_APP_ID) && reqType.equals("DELETE"))
+                                                               && (app.getAppAck() != null && app.getAppAck())
                                                                && ((checkIfAdminRoleExists && roleInAppForUserList.size() > 1)
                                                                                || (!checkIfAdminRoleExists && roleInAppForUserList.size() >= 1))) {
                                                        // check if admin role exist then delete
@@ -1664,6 +1664,7 @@ public class UserRolesCommonServiceImpl  {
                                                                return (role.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
                                                        });
                                                        String orgUserIdNewOrExist = (userInfo.size() != 0 || !userInfo.isEmpty()) ? user.getOrgUserId() : orgUserId;
+                                                               
                                                        pushRemoteUser(remoteUserRoles, orgUserIdNewOrExist , app, mapper, searchService,
                                                                        applicationsRestClientService,true);
                                                }
index 41615df..4bc5403 100644 (file)
@@ -5,7 +5,7 @@
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>3.3.0</version>
+               <version>3.4.0</version>
        </parent>
 
        <artifactId>portal-be-os</artifactId>
index 735ce79..29154e8 100644 (file)
@@ -5,7 +5,7 @@
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>3.3.0</version>
+               <version>3.4.0</version>
        </parent>
 
        <artifactId>portal-FE-os</artifactId>
index 2fdc2f8..7844390 100644 (file)
@@ -6,7 +6,7 @@
         <parent>
                 <groupId>org.onap.portal</groupId>
                 <artifactId>widget-ms-parent</artifactId>
-                               <version>3.3.0</version>
+                               <version>3.4.0</version>
         </parent>
 
        <artifactId>common-widgets</artifactId>
index 553535d..913ac44 100644 (file)
@@ -6,7 +6,7 @@
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>3.3.0</version>
+               <version>3.4.0</version>
        </parent>
 
        <artifactId>widget-ms-parent</artifactId>
index f427506..50a285c 100644 (file)
@@ -13,7 +13,7 @@
 
        <groupId>org.onap.portal</groupId>
        <artifactId>widget-ms</artifactId>
-       <version>3.3.0</version>
+       <version>3.4.0</version>
        <packaging>jar</packaging>
        <name>widget-microservice</name>
 
diff --git a/pom.xml b/pom.xml
index 157db9e..e4ccbde 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
        <groupId>org.onap.portal</groupId>
        <artifactId>onap-portal-parent</artifactId>
-       <version>3.3.0</version>
+       <version>3.4.0</version>
 
        <packaging>pom</packaging>
        <name>portal</name>
index 2aecbba..1e0518b 100644 (file)
@@ -59,7 +59,7 @@
             <div style="display: flex; flex-direction:row;">
               <app-sidebar (collapsedEvent)="receiveCollapsed($event)"></app-sidebar>
               <app-userbar></app-userbar>
-              <div class="container" style="margin-left: 370px;">
+              <div class="container" [ngStyle]="setStyle()">
                 <router-outlet></router-outlet>
               </div>
             </div>
index 7a10e39..b0b882d 100644 (file)
@@ -92,4 +92,11 @@ export class TabbarComponent implements OnInit {
     if(this.tabs.length != 0 && $event.index != 0)
       this.tabs[$event.index - 1].active = true;
   }
+  
+  setStyle() {  
+    const style = {
+       'margin-left': this.collapedSideBar ? '80px' : '370px',
+    };
+    return style;
+  }
 }
index a74e837..615e7fa 100644 (file)
@@ -4,7 +4,7 @@
 
        <groupId>org.onap.portal</groupId>
        <artifactId>portal-FE-os</artifactId>
-       <version>3.3.0</version>
+       <version>3.4.0</version>
 
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>