From: Lorraine Welch Date: Tue, 21 Jan 2020 23:20:16 +0000 (+0000) Subject: Merge "InvalidUserRoleException-junits" X-Git-Tag: 3.2.0~51 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=portal.git;a=commitdiff_plain;h=40521ea6e5a87e6a9b9a1d11eba82c8c33e04ac4;hp=6ec77b16f5f7754781d23c60ad76d84bdc86fa9b Merge "InvalidUserRoleException-junits" --- diff --git a/.gitignore b/.gitignore index 5c18f3b0..eb6bfe1f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ kubernetes/.classpath kubernetes/.settings kubernetes/.classpath/* kubernetes/.settings/* -ecomp-portal-FE-att/client/bower* \ No newline at end of file +ecomp-portal-FE-att/client/bower* +/.metadata/ diff --git a/docs/tutorials/portal-BE/index.rst b/docs/tutorials/portal-BE/index.rst index 9ab7c1aa..b1b0be0c 100644 --- a/docs/tutorials/portal-BE/index.rst +++ b/docs/tutorials/portal-BE/index.rst @@ -11,4 +11,5 @@ Building ONAP Portal BE Applications :caption: Contents: setting-up + request-flow diff --git a/docs/tutorials/portal-BE/request-flow.rst b/docs/tutorials/portal-BE/request-flow.rst new file mode 100644 index 00000000..a186b013 --- /dev/null +++ b/docs/tutorials/portal-BE/request-flow.rst @@ -0,0 +1,4 @@ +Request flow in Portal-BE project +================================= + +.. image:: requestflow.jpeg diff --git a/docs/tutorials/portal-BE/requestflow.jpeg b/docs/tutorials/portal-BE/requestflow.jpeg new file mode 100644 index 00000000..10c2e127 Binary files /dev/null and b/docs/tutorials/portal-BE/requestflow.jpeg differ diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java index f0f0af5a..4d81c6d0 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java @@ -43,38 +43,36 @@ import org.glassfish.jersey.client.ClientResponse; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; public class SchedulerAuxUtil { - - private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxUtil.class); - public static SchedulerAuxResponseWrapper wrapResponse ( String body, int statusCode ) { - - SchedulerAuxResponseWrapper w = new SchedulerAuxResponseWrapper(); - w.setStatus (statusCode); - w.setEntity(body); - - return w; - } - - public static SchedulerAuxResponseWrapper wrapResponse (ClientResponse cres) { - String resp_str = ""; - if ( cres != null ) { - resp_str = cres.readEntity(String.class); - } - int statuscode = cres.getStatus(); - SchedulerAuxResponseWrapper w = SchedulerAuxUtil.wrapResponse ( resp_str, statuscode ); - return (w); - } - - public static SchedulerAuxResponseWrapper wrapResponse (RestObject rs) { - String resp_str = ""; - int status = 0; - if ( rs != null ) { - resp_str = rs.get(); - status = rs.getStatusCode(); - } - SchedulerAuxResponseWrapper w = SchedulerAuxUtil.wrapResponse ( resp_str, status ); - return (w); - } - - + public static SchedulerAuxResponseWrapper wrapResponse(String body, int statusCode) { + + SchedulerAuxResponseWrapper w = new SchedulerAuxResponseWrapper(); + w.setStatus(statusCode); + w.setEntity(body); + + return w; + } + + public static SchedulerAuxResponseWrapper wrapResponse(ClientResponse cres) { + String respStr = ""; + int statuscode = 0; + if (cres != null) { + respStr = cres.readEntity(String.class); + statuscode = cres.getStatus(); + } + SchedulerAuxResponseWrapper w = SchedulerAuxUtil.wrapResponse(respStr, statuscode); + return (w); + } + + public static SchedulerAuxResponseWrapper wrapResponse(RestObject rs) { + String respStr = ""; + int status = 0; + if (rs != null) { + respStr = rs.get(); + status = rs.getStatusCode(); + } + SchedulerAuxResponseWrapper w = SchedulerAuxUtil.wrapResponse(respStr, status); + return (w); + } + } diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java index 92cbe90e..5d38317a 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java @@ -43,7 +43,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; @@ -61,146 +60,155 @@ import org.onap.portalsdk.core.service.DataAccessService; @EnableAspectJAutoProxy @EPMetricsLog public class EPRoleServiceImpl implements EPRoleService { - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPRoleServiceImpl.class); - - @Autowired - private DataAccessService dataAccessService; - - @Autowired - ExternalAccessRolesService externalAccessRolesService; - - @SuppressWarnings("unchecked") - public List getRoleFunctions() { - // List msgDB = getDataAccessService().getList(Profile.class, null); - return getDataAccessService().getList(RoleFunction.class, null); - } - - @SuppressWarnings("unchecked") - public List getAvailableChildRoles(Long roleId) { - List availableChildRoles = (List) getDataAccessService().getList(EPRole.class, null); - if (roleId == null || roleId == 0) { - return availableChildRoles; - } - - EPRole currentRole = (EPRole) getDataAccessService().getDomainObject(EPRole.class, roleId, null); - Set allParentRoles = new TreeSet(); - allParentRoles = getAllParentRolesAsList(currentRole, allParentRoles); - - Iterator availableChildRolesIterator = availableChildRoles.iterator(); - while (availableChildRolesIterator.hasNext()) { - EPRole role = availableChildRolesIterator.next(); - if (!role.getActive() || allParentRoles.contains(role) || role.getId().equals(roleId)) { - availableChildRolesIterator.remove(); - } - } - return availableChildRoles; - } - - private Set getAllParentRolesAsList(EPRole role, Set allParentRoles) { - Set parentRoles = role.getParentRoles(); - allParentRoles.addAll(parentRoles); - Iterator parentRolesIterator = parentRoles.iterator(); - while (parentRolesIterator.hasNext()) { - getAllParentRolesAsList(parentRolesIterator.next(), allParentRoles); - } - return allParentRoles; - } - - public RoleFunction getRoleFunction(String code) { - return (RoleFunction) getDataAccessService().getDomainObject(RoleFunction.class, code, null); - } - - public void saveRoleFunction(RoleFunction domainRoleFunction) { - getDataAccessService().saveDomainObject(domainRoleFunction, null); - } - - public void deleteRoleFunction(RoleFunction domainRoleFunction) { - getDataAccessService().deleteDomainObject(domainRoleFunction, null); - } - - public EPRole getRole(Long id) { - return (EPRole) getDataAccessService().getDomainObject(EPRole.class, id, null); - } - - // TODO: refactor - private static final String getAppRoleSqlFormat = "SELECT * FROM fn_role where APP_ID = %s AND APP_ROLE_ID = %s"; - - @SuppressWarnings("unchecked") - public EPRole getRole(Long appId, Long appRoleid) { - if (appId == null || appRoleid == null) { - logger.error(EELFLoggerDelegate.errorLogger, String.format( - "getRole does not support null appId or roleId. appRoleid=%s, appRoleid=%s", appId, appRoleid)); - return null; - } - - String sql = String.format(getAppRoleSqlFormat, appId, appRoleid); - - List roles = (List) dataAccessService.executeSQLQuery(sql, EPRole.class, null); - int resultsCount = roles.size(); - if (resultsCount > 1) { - logger.error(EELFLoggerDelegate.errorLogger, - String.format( - "search by appId=%s, appRoleid=%s should have returned 0 or 1 results. Got %d. This is an internal server error.", - appId, appRoleid, resultsCount)); - logger.error(EELFLoggerDelegate.errorLogger, - "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar."); - return roles.get(0); - } else if (resultsCount == 1) { - return roles.get(0); - } - return null; - } - - @SuppressWarnings("unchecked") - public EPRole getAppRole(String roleName, Long appId) { - - final Map params = new HashMap(); - final Map portalParams = new HashMap(); - List roles = null; - params.put("appId", appId.toString()); - params.put("roleName", roleName); - portalParams.put("appRoleName", roleName); - - List roleList = externalAccessRolesService.getPortalAppRoleInfo(PortalConstants.ACCOUNT_ADMIN_ROLE_ID); - EPRole role = new EPRole(); - if(roleList.size()>0){ - role = roleList.get(0);} - logger.debug(EELFLoggerDelegate.debugLogger, "Requested RoleName is "+role.getName()); - - if (appId == 1 || roleName.equals(role.getName())) { - roles = (List) dataAccessService.executeNamedQuery("getPortalAppRoles", portalParams, null); - } else if (appId != 1 && !roleName.equals(role.getName())) { - roles = (List) dataAccessService.executeNamedQuery("getAppRoles", params, null); - } - int resultsCount = (roles == null ? 0 : roles.size()); - if (resultsCount > 1) { - logger.error(EELFLoggerDelegate.errorLogger, - "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar."); - return roles.get(0); - } else if (resultsCount == 1) { - return roles.get(0); - } - return null; - } - - public void saveRole(EPRole domainRole) { - getDataAccessService().saveDomainObject(domainRole, null); - } - - public void deleteRole(EPRole domainRole) { - getDataAccessService().deleteDomainObject(domainRole, null); - } - - @SuppressWarnings("unchecked") - public List getAvailableRoles() { - return getDataAccessService().getList(EPRole.class, null); - } - - public DataAccessService getDataAccessService() { - return dataAccessService; - } - - public void setDataAccessService(DataAccessService dataAccessService) { - this.dataAccessService = dataAccessService; - } + EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPRoleServiceImpl.class); + + @Autowired + private DataAccessService dataAccessService; + + @Autowired + ExternalAccessRolesService externalAccessRolesService; + + @SuppressWarnings("unchecked") + public List getRoleFunctions() { + return getDataAccessService().getList(RoleFunction.class, null); + } + + @SuppressWarnings("unchecked") + public List getAvailableChildRoles(Long roleId) { + List availableChildRoles = + (List) getDataAccessService().getList(EPRole.class, null); + if (roleId == null || roleId == 0) { + return availableChildRoles; + } + + EPRole currentRole = + (EPRole) getDataAccessService().getDomainObject(EPRole.class, roleId, null); + Set allParentRoles = new TreeSet<>(); + allParentRoles = getAllParentRolesAsList(currentRole, allParentRoles); + + Iterator availableChildRolesIterator = availableChildRoles.iterator(); + while (availableChildRolesIterator.hasNext()) { + EPRole role = availableChildRolesIterator.next(); + if (!role.getActive() || allParentRoles.contains(role) || role.getId().equals(roleId)) { + availableChildRolesIterator.remove(); + } + } + return availableChildRoles; + } + + private Set getAllParentRolesAsList(EPRole role, Set allParentRoles) { + Set parentRoles = role.getParentRoles(); + allParentRoles.addAll(parentRoles); + Iterator parentRolesIterator = parentRoles.iterator(); + while (parentRolesIterator.hasNext()) { + getAllParentRolesAsList(parentRolesIterator.next(), allParentRoles); + } + return allParentRoles; + } + + public RoleFunction getRoleFunction(String code) { + return (RoleFunction) getDataAccessService().getDomainObject(RoleFunction.class, code, + null); + } + + public void saveRoleFunction(RoleFunction domainRoleFunction) { + getDataAccessService().saveDomainObject(domainRoleFunction, null); + } + + public void deleteRoleFunction(RoleFunction domainRoleFunction) { + getDataAccessService().deleteDomainObject(domainRoleFunction, null); + } + + public EPRole getRole(Long id) { + return (EPRole) getDataAccessService().getDomainObject(EPRole.class, id, null); + } + + // TODO: refactor + private static final String GET_APP_ROLE_SQL_FORMAT = + "SELECT * FROM fn_role where APP_ID = %s AND APP_ROLE_ID = %s"; + + @SuppressWarnings("unchecked") + public EPRole getRole(Long appId, Long appRoleid) { + if (appId == null || appRoleid == null) { + logger.error(EELFLoggerDelegate.errorLogger, String.format( + "getRole does not support null appId or roleId. appRoleid=%s, appRoleid=%s", + appId, appRoleid)); + return null; + } + + String sql = String.format(GET_APP_ROLE_SQL_FORMAT, appId, appRoleid); + + List roles = + (List) dataAccessService.executeSQLQuery(sql, EPRole.class, null); + int resultsCount = roles.size(); + if (resultsCount > 1) { + logger.error(EELFLoggerDelegate.errorLogger, String.format( + "search by appId=%s, appRoleid=%s should have returned 0 or 1 results. Got %d. This is an internal server error.", + appId, appRoleid, resultsCount)); + logger.error(EELFLoggerDelegate.errorLogger, + "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar."); + return roles.get(0); + } else if (resultsCount == 1) { + return roles.get(0); + } + return null; + } + + @SuppressWarnings("unchecked") + public EPRole getAppRole(String roleName, Long appId) { + + final Map params = new HashMap<>(); + final Map portalParams = new HashMap<>(); + List roles = null; + params.put("appId", appId.toString()); + params.put("roleName", roleName); + portalParams.put("appRoleName", roleName); + + List roleList = externalAccessRolesService + .getPortalAppRoleInfo(PortalConstants.ACCOUNT_ADMIN_ROLE_ID); + EPRole role = new EPRole(); + if (!roleList.isEmpty()) { + role = roleList.get(0); + } + logger.debug(EELFLoggerDelegate.debugLogger, "Requested RoleName is " + role.getName()); + + if (appId == 1 || roleName.equals(role.getName())) { + roles = (List) dataAccessService.executeNamedQuery("getPortalAppRoles", + portalParams, null); + } else if (appId != 1 && !roleName.equals(role.getName())) { + roles = (List) dataAccessService.executeNamedQuery("getAppRoles", params, null); + } + int resultsCount = (roles == null ? 0 : roles.size()); + if (resultsCount > 1) { + logger.error(EELFLoggerDelegate.errorLogger, + "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar."); + if (roles != null) { + return roles.get(0); + } + } else if (resultsCount == 1) { + return roles.get(0); + } + return null; + } + + public void saveRole(EPRole domainRole) { + getDataAccessService().saveDomainObject(domainRole, null); + } + + public void deleteRole(EPRole domainRole) { + getDataAccessService().deleteDomainObject(domainRole, null); + } + + @SuppressWarnings("unchecked") + public List getAvailableRoles() { + return getDataAccessService().getList(EPRole.class, null); + } + + public DataAccessService getDataAccessService() { + return dataAccessService; + } + + public void setDataAccessService(DataAccessService dataAccessService) { + this.dataAccessService = dataAccessService; + } } diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/ExternalAuthSystemExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/ExternalAuthSystemExceptionTest.java new file mode 100644 index 00000000..e36e81f8 --- /dev/null +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/ExternalAuthSystemExceptionTest.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 IBM Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +package org.onap.portalapp.portal.exceptions; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class ExternalAuthSystemExceptionTest { + + @Test + public void TestException2() { + String s1 = "Value1"; + String s2 = "value2"; + try { + if (!s1.equalsIgnoreCase(s2)) { + throw new ExternalAuthSystemException("Exception occured.."); + } + } catch (ExternalAuthSystemException mde) { + assertEquals(mde.getMessage(),"Exception occured.."); + } + + } +} diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/exception/StorageFileNotFoundExceptionTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/exception/StorageFileNotFoundExceptionTest.java new file mode 100644 index 00000000..d49d87dc --- /dev/null +++ b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/exception/StorageFileNotFoundExceptionTest.java @@ -0,0 +1,39 @@ +package org.onap.portalapp.widget.exception; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.onap.portalapp.widget.excetpion.StorageFileNotFoundException; + +public class StorageFileNotFoundExceptionTest { + + @Test + public void Test1() + { + String s1 = "Value1"; + String s2 = "value2"; + try { + if (!s1.equalsIgnoreCase(s2)) { + throw new StorageFileNotFoundException("org.onap.portalapp.widget.excetpion.StorageFileNotFoundException"); + } + } catch (StorageFileNotFoundException mde) { + assertEquals(mde.getMessage(),"org.onap.portalapp.widget.excetpion.StorageFileNotFoundException"); + } + } + + @Test + public void Test2() + { + String message = "Exception occured"; + String s1 = "Value1"; + String s2 = "value2"; + try { + if (!s1.equalsIgnoreCase(s2)) { + throw new StorageFileNotFoundException(message, new Throwable()); + } + } catch (StorageFileNotFoundException mde) { + assertEquals("org.onap.portalapp.widget.excetpion.StorageFileNotFoundException", mde.getClass().getName()); + } + } + +} diff --git a/portal-BE/pom.xml b/portal-BE/pom.xml index a882f751..94340971 100644 --- a/portal-BE/pom.xml +++ b/portal-BE/pom.xml @@ -141,54 +141,21 @@ compile - io.swagger - swagger-annotations - 2.0.0-rc2 - compile - - - io.swagger - swagger-annotations - 2.0.0-rc2 - compile - - - io.swagger - swagger-annotations - 1.5.20 - - - io.swagger - swagger-annotations - 2.0.0-rc2 - compile - - - io.swagger - swagger-annotations - 1.5.20 - - - io.swagger - swagger-annotations - 2.0.0-rc2 - compile - - - io.swagger - swagger-annotations - 2.0.0-rc2 + org.apache.cxf + cxf-rt-rs-client + 3.3.4 compile + + org.hibernate.validator + hibernate-validator + 6.0.18.Final + compile + io.swagger swagger-annotations - 1.5.20 - - - org.apache.cxf - cxf-rt-rs-client - 3.3.4 + 1.5.13 compile diff --git a/portal-BE/src/main/java/org/onap/portal/PortalApplication.java b/portal-BE/src/main/java/org/onap/portal/PortalApplication.java index cf6f9d7a..047880ab 100644 --- a/portal-BE/src/main/java/org/onap/portal/PortalApplication.java +++ b/portal-BE/src/main/java/org/onap/portal/PortalApplication.java @@ -48,7 +48,7 @@ import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @SpringBootApplication @EntityScan("org.onap.portal.domain") -@EnableJpaRepositories("org.onap.portal.dao") +@EnableJpaRepositories("org.onap.portal.service") public class PortalApplication { public static void main(String[] args) { diff --git a/portal-BE/src/main/java/org/onap/portal/aop/service/FnLanguageServiceAOP.java b/portal-BE/src/main/java/org/onap/portal/aop/service/FnLanguageServiceAOP.java index 4b48ae41..b62e7f7a 100644 --- a/portal-BE/src/main/java/org/onap/portal/aop/service/FnLanguageServiceAOP.java +++ b/portal-BE/src/main/java/org/onap/portal/aop/service/FnLanguageServiceAOP.java @@ -60,7 +60,7 @@ public class FnLanguageServiceAOP { @Autowired private DataValidator dataValidator; - @Before("execution(* org.onap.portal.service.fn.FnLanguageService.save(..)) && args(fnLanguage)") + @Before("execution(* org.onap.portal.service.language.FnLanguageService.save(..)) && args(fnLanguage)") public void save(final FnLanguage fnLanguage) { if (fnLanguage == null) { LOGGER.info("User " + " try to save NULL fnLanguage"); @@ -75,7 +75,7 @@ public class FnLanguageServiceAOP { } } - @Before("execution(* org.onap.portal.service.fn.FnLanguageService.getLanguageList(..)) && args(principal)") + @Before("execution(* org.onap.portal.service.language.FnLanguageService.getLanguageList(..)) && args(principal)") public void getLanguageList(final Principal principal) { LOGGER.info("User " + principal.getName() + " try requested for all language list"); } diff --git a/portal-BE/src/main/java/org/onap/portal/aop/service/FnUserServiceAOP.java b/portal-BE/src/main/java/org/onap/portal/aop/service/FnUserServiceAOP.java index f891392e..5cbec719 100644 --- a/portal-BE/src/main/java/org/onap/portal/aop/service/FnUserServiceAOP.java +++ b/portal-BE/src/main/java/org/onap/portal/aop/service/FnUserServiceAOP.java @@ -68,7 +68,7 @@ public class FnUserServiceAOP { this.fnUserMapper = fnUserMapper; } - @Before("execution(* org.onap.portal.service.fn.FnUserService.saveFnUser(..)) && args(principal, fnUser)") + @Before("execution(* org.onap.portal.service.user.FnUserService.saveFnUser(..)) && args(principal, fnUser)") public void save(final Principal principal, final FnUser fnUser) { FnUser user; if (fnUser == null) { diff --git a/portal-BE/src/main/java/org/onap/portal/aop/service/WidgetServiceAOP.java b/portal-BE/src/main/java/org/onap/portal/aop/service/WidgetServiceAOP.java index 14172937..c1357e2a 100644 --- a/portal-BE/src/main/java/org/onap/portal/aop/service/WidgetServiceAOP.java +++ b/portal-BE/src/main/java/org/onap/portal/aop/service/WidgetServiceAOP.java @@ -23,7 +23,7 @@ public class WidgetServiceAOP { this.dataValidator = dataValidator; } - @Before("execution(* org.onap.portal.service.WidgetService.setOnboardingWidget(..)) && args(userId, onboardingWidget)") + @Before("execution(* org.onap.portal.service.widget.WidgetService.setOnboardingWidget(..)) && args(userId, onboardingWidget)") public void setOnboardingWidget(final Long userId, OnboardingWidget onboardingWidget) { if (!dataValidator.isValid(onboardingWidget)) { throw new IllegalArgumentException(dataValidator.getConstraintViolationsString(onboardingWidget)); diff --git a/portal-BE/src/main/java/org/onap/portal/configuration/DBInitializingBean.java b/portal-BE/src/main/java/org/onap/portal/configuration/DBInitializingBean.java index ebd23cd9..3f5b3883 100644 --- a/portal-BE/src/main/java/org/onap/portal/configuration/DBInitializingBean.java +++ b/portal-BE/src/main/java/org/onap/portal/configuration/DBInitializingBean.java @@ -40,196 +40,142 @@ package org.onap.portal.configuration; +import org.onap.portal.domain.db.ep.*; +import org.onap.portal.domain.db.fn.*; +import org.onap.portal.service.app.FnAppService; +import org.onap.portal.service.appContactUs.FnAppContactUsService; +import org.onap.portal.service.appFunction.EpAppFunctionService; +import org.onap.portal.service.appRoleFunction.EpAppRoleFunctionService; +import org.onap.portal.service.auditLog.FnAuditLogService; +import org.onap.portal.service.basicAuthAccount.EpBasicAuthAccountService; +import org.onap.portal.service.commonWidgetData.FnCommonWidgetDataService; +import org.onap.portal.service.displayText.FnDisplayTextService; +import org.onap.portal.service.function.FnFunctionService; +import org.onap.portal.service.language.FnLanguageService; +import org.onap.portal.service.luActivity.FnLuActivityService; +import org.onap.portal.service.luAlertMethod.FnLuAlertMethodService; +import org.onap.portal.service.luMenuSet.FnLuMenuSetService; +import org.onap.portal.service.luPriority.FnLuPriorityService; +import org.onap.portal.service.luTabSet.FnLuTabSetService; +import org.onap.portal.service.luTimezone.FnLuTimezoneService; +import org.onap.portal.service.menu.FnMenuService; +import org.onap.portal.service.menuFunctional.FnMenuFunctionalService; +import org.onap.portal.service.menuFunctionalAncestors.FnMenuFunctionalAncestorsService; +import org.onap.portal.service.menuFunctionalRoles.FnMenuFunctionalRolesService; +import org.onap.portal.service.microservice.EpMicroserviceService; +import org.onap.portal.service.microserviceParameter.EpMicroserviceParameterService; +import org.onap.portal.service.persUserAppSel.FnPersUserAppSelService; +import org.onap.portal.service.persUserAppSort.EpPersUserAppSortService; +import org.onap.portal.service.qzCronTriggers.FnQzCronTriggersService; +import org.onap.portal.service.qzJobDetails.FnQzJobDetailsService; +import org.onap.portal.service.qzLocks.FnQzLocksService; +import org.onap.portal.service.qzSchedulerState.FnQzSchedulerStateService; +import org.onap.portal.service.qzTriggers.FnQzTriggersService; +import org.onap.portal.service.restrictedUrl.FnRestrictedUrlService; +import org.onap.portal.service.role.FnRoleService; +import org.onap.portal.service.roleComposite.FnRoleCompositeService; +import org.onap.portal.service.roleFunction.FnRoleFunctionService; +import org.onap.portal.service.sharedContext.FnSharedContextService; +import org.onap.portal.service.tab.FnTabService; +import org.onap.portal.service.tabSelected.FnTabSelectedService; +import org.onap.portal.service.user.FnUserService; +import org.onap.portal.service.userRole.FnUserRoleService; +import org.onap.portal.service.widgetCatalog.EpWidgetCatalogService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; + import java.math.BigInteger; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.onap.portal.dao.ep.EpAppFunctionDao; -import org.onap.portal.dao.ep.EpAppRoleFunctionDao; -import org.onap.portal.dao.ep.EpBasicAuthAccountDao; -import org.onap.portal.dao.ep.EpMicroserviceDao; -import org.onap.portal.dao.ep.EpMicroserviceParameterDao; -import org.onap.portal.dao.ep.EpPersUserAppSortDao; -import org.onap.portal.dao.fn.EpWidgetCatalogDao; -import org.onap.portal.dao.fn.FnAppContactUsDao; -import org.onap.portal.dao.fn.FnAppDao; -import org.onap.portal.dao.fn.FnAuditLogDao; -import org.onap.portal.dao.fn.FnCommonWidgetDataDao; -import org.onap.portal.dao.fn.FnDisplayTextDao; -import org.onap.portal.dao.fn.FnFunctionDao; -import org.onap.portal.dao.fn.FnLanguageDao; -import org.onap.portal.dao.fn.FnLuActivityDao; -import org.onap.portal.dao.fn.FnLuAlertMethodDao; -import org.onap.portal.dao.fn.FnLuMenuSetDao; -import org.onap.portal.dao.fn.FnLuPriorityDao; -import org.onap.portal.dao.fn.FnLuTabSetDao; -import org.onap.portal.dao.fn.FnLuTimezoneDao; -import org.onap.portal.dao.fn.FnMenuDao; -import org.onap.portal.dao.fn.FnMenuFunctionalAncestorsDao; -import org.onap.portal.dao.fn.FnMenuFunctionalDao; -import org.onap.portal.dao.fn.FnMenuFunctionalRolesDao; -import org.onap.portal.dao.fn.FnPersUserAppSelDao; -import org.onap.portal.dao.fn.FnQzCronTriggersDao; -import org.onap.portal.dao.fn.FnQzJobDetailsDao; -import org.onap.portal.dao.fn.FnQzLocksDao; -import org.onap.portal.dao.fn.FnQzSchedulerStateDao; -import org.onap.portal.dao.fn.FnQzTriggersDao; -import org.onap.portal.dao.fn.FnRestrictedUrlDao; -import org.onap.portal.dao.fn.FnRoleCompositeDao; -import org.onap.portal.dao.fn.FnRoleDao; -import org.onap.portal.dao.fn.FnRoleFunctionDao; -import org.onap.portal.dao.fn.FnSharedContextDao; -import org.onap.portal.dao.fn.FnTabDao; -import org.onap.portal.dao.fn.FnTabSelectedDao; -import org.onap.portal.dao.fn.FnUserDao; -import org.onap.portal.dao.fn.FnUserRoleDao; -import org.onap.portal.domain.db.ep.EpAppFunction; -import org.onap.portal.domain.db.ep.EpAppRoleFunction; -import org.onap.portal.domain.db.ep.EpBasicAuthAccount; -import org.onap.portal.domain.db.ep.EpMicroservice; -import org.onap.portal.domain.db.ep.EpMicroserviceParameter; -import org.onap.portal.domain.db.ep.EpPersUserAppSort; -import org.onap.portal.domain.db.ep.EpWidgetCatalog; -import org.onap.portal.domain.db.fn.FnApp; -import org.onap.portal.domain.db.fn.FnAppContactUs; -import org.onap.portal.domain.db.fn.FnAuditLog; -import org.onap.portal.domain.db.fn.FnCommonWidgetData; -import org.onap.portal.domain.db.fn.FnDisplayText; -import org.onap.portal.domain.db.fn.FnFunction; -import org.onap.portal.domain.db.fn.FnLanguage; -import org.onap.portal.domain.db.fn.FnLuActivity; -import org.onap.portal.domain.db.fn.FnLuAlertMethod; -import org.onap.portal.domain.db.fn.FnLuMenuSet; -import org.onap.portal.domain.db.fn.FnLuPriority; -import org.onap.portal.domain.db.fn.FnLuTabSet; -import org.onap.portal.domain.db.fn.FnLuTimezone; -import org.onap.portal.domain.db.fn.FnMenu; -import org.onap.portal.domain.db.fn.FnMenuFunctional; -import org.onap.portal.domain.db.fn.FnMenuFunctionalAncestors; -import org.onap.portal.domain.db.fn.FnMenuFunctionalRoles; -import org.onap.portal.domain.db.fn.FnPersUserAppSel; -import org.onap.portal.domain.db.fn.FnQzCronTriggers; -import org.onap.portal.domain.db.fn.FnQzJobDetails; -import org.onap.portal.domain.db.fn.FnQzLocks; -import org.onap.portal.domain.db.fn.FnQzSchedulerState; -import org.onap.portal.domain.db.fn.FnQzTriggers; -import org.onap.portal.domain.db.fn.FnRestrictedUrl; -import org.onap.portal.domain.db.fn.FnRole; -import org.onap.portal.domain.db.fn.FnRoleComposite; -import org.onap.portal.domain.db.fn.FnRoleFunction; -import org.onap.portal.domain.db.fn.FnSharedContext; -import org.onap.portal.domain.db.fn.FnTab; -import org.onap.portal.domain.db.fn.FnTabSelected; -import org.onap.portal.domain.db.fn.FnUser; -import org.onap.portal.domain.db.fn.FnUserRole; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; @Component public class DBInitializingBean implements org.springframework.beans.factory.InitializingBean { - private final FnAppDao fnAppDao; - private final EpAppFunctionDao epAppFunctionDao; - private final FnRoleDao fnRoleDao; - private final EpAppRoleFunctionDao epAppRoleFunctionDao; - private final EpBasicAuthAccountDao epBasicAuthAccountDao; - private final EpMicroserviceDao epMicroserviceDao; - private final EpMicroserviceParameterDao epMicroserviceParameterDao; - private final EpWidgetCatalogDao epWidgetCatalogDao; - private final FnAppContactUsDao fnAppContactUsDao; - private final FnCommonWidgetDataDao fnCommonWidgetDataDao; - private final FnLanguageDao fnLanguageDao; - private final FnDisplayTextDao fnDisplayTextDao; - private final FnFunctionDao fnFunctionDao; - private final FnLuActivityDao fnLuActivityDao; - private final FnLuAlertMethodDao fnLuAlertMethodDao; - private final FnLuMenuSetDao fnLuMenuSetDao; - private final FnLuPriorityDao fnLuPriorityDao; - private final FnLuTimezoneDao fnLuTimezoneDao; - private final FnMenuDao fnMenuDao; - private final FnMenuFunctionalDao fnMenuFunctionalDao; - private final FnMenuFunctionalAncestorsDao fnMenuFunctionalAncestorsDao; - private final FnMenuFunctionalRolesDao fnMenuFunctionalRolesDao; - private final FnQzJobDetailsDao fnQzJobDetailsDao; - private final FnQzLocksDao fnQzLocksDao; - private final FnQzSchedulerStateDao fnQzSchedulerStateDao; - private final FnQzTriggersDao fnQzTriggersDao; - private final FnQzCronTriggersDao fnQzCronTriggersDao; - private final FnRestrictedUrlDao fnRestrictedUrlDao; - private final FnRoleCompositeDao fnRoleCompositeDao; - private final FnRoleFunctionDao fnRoleFunctionDao; - private final FnSharedContextDao fnSharedContextDao; - private final FnLuTabSetDao fnLuTabSetDao; - private final FnTabDao fnTabDao; - private final FnTabSelectedDao fnTabSelectedDao; - private final FnUserDao fnUserDao; - private final EpPersUserAppSortDao epPersUserAppSortDao; - private final FnPersUserAppSelDao fnPersUserAppSelDao; - private final FnAuditLogDao fnAuditLogDao; - private final FnUserRoleDao fnUserRoleDao; + private final FnAppService fnAppService; + private final EpAppFunctionService epAppFunctionService; + private final FnRoleService fnRoleService; + private final EpAppRoleFunctionService epAppRoleFunctionService; + private final EpBasicAuthAccountService epBasicAuthAccountService; + private final EpMicroserviceService epMicroserviceService; + private final EpMicroserviceParameterService epMicroserviceParameterService; + private final EpWidgetCatalogService epWidgetCatalogService; + private final FnAppContactUsService fnAppContactUsService; + private final FnCommonWidgetDataService fnCommonWidgetDataService; + private final FnLanguageService fnLanguageService; + private final FnDisplayTextService fnDisplayTextService; + private final FnFunctionService fnFunctionService; + private final FnLuActivityService fnLuActivityService; + private final FnLuAlertMethodService fnLuAlertMethodService; + private final FnLuMenuSetService fnLuMenuSetService; + private final FnLuPriorityService fnLuPriorityService; + private final FnLuTimezoneService fnLuTimezoneService; + private final FnMenuService fnMenuService; + private final FnMenuFunctionalService fnMenuFunctionalService; + private final FnMenuFunctionalAncestorsService fnMenuFunctionalAncestorsService; + private final FnMenuFunctionalRolesService fnMenuFunctionalRolesService; + private final FnQzJobDetailsService fnQzJobDetailsService; + private final FnQzLocksService fnQzLocksService; + private final FnQzSchedulerStateService fnQzSchedulerStateService; + private final FnQzTriggersService fnQzTriggersService; + private final FnQzCronTriggersService fnQzCronTriggersService; + private final FnRestrictedUrlService fnRestrictedUrlService; + private final FnRoleCompositeService fnRoleCompositeService; + private final FnRoleFunctionService fnRoleFunctionService; + private final FnSharedContextService fnSharedContextService; + private final FnLuTabSetService fnLuTabSetService; + private final FnTabService fnTabService; + private final FnTabSelectedService fnTabSelectedService; + private final FnUserService fnUserService; + private final EpPersUserAppSortService epPersUserAppSortService; + private final FnPersUserAppSelService fnPersUserAppSelService; + private final FnAuditLogService fnAuditLogService; + private final FnUserRoleService fnUserRoleService; @Autowired - public DBInitializingBean(FnAppDao fnAppDao, EpAppFunctionDao epAppFunctionDao, - FnRoleDao fnRoleDao, EpAppRoleFunctionDao epAppRoleFunctionDao, - EpBasicAuthAccountDao epBasicAuthAccountDao, EpMicroserviceDao epMicroserviceDao, - EpMicroserviceParameterDao epMicroserviceParameterDao, - EpWidgetCatalogDao epWidgetCatalogDao, FnAppContactUsDao fnAppContactUsDao, - FnCommonWidgetDataDao fnCommonWidgetDataDao, FnLanguageDao fnLanguageDao, - FnDisplayTextDao fnDisplayTextDao, FnFunctionDao fnFunctionDao, - FnLuActivityDao fnLuActivityDao, FnLuAlertMethodDao fnLuAlertMethodDao, - FnLuMenuSetDao fnLuMenuSetDao, FnLuPriorityDao fnLuPriorityDao, - FnLuTimezoneDao fnLuTimezoneDao, FnMenuDao fnMenuDao, - FnMenuFunctionalDao fnMenuFunctionalDao, - FnMenuFunctionalAncestorsDao fnMenuFunctionalAncestorsDao, - FnMenuFunctionalRolesDao fnMenuFunctionalRolesDao, FnQzJobDetailsDao fnQzJobDetailsDao, - FnQzLocksDao fnQzLocksDao, FnQzSchedulerStateDao fnQzSchedulerStateDao, - FnQzTriggersDao fnQzTriggersDao, FnQzCronTriggersDao fnQzCronTriggersDao, - FnRestrictedUrlDao fnRestrictedUrlDao, FnRoleCompositeDao fnRoleCompositeDao, - FnRoleFunctionDao fnRoleFunctionDao, FnSharedContextDao fnSharedContextDao, - FnLuTabSetDao fnLuTabSetDao, FnTabDao fnTabDao, FnTabSelectedDao fnTabSelectedDao, - FnUserDao fnUserDao, EpPersUserAppSortDao epPersUserAppSortDao, - FnPersUserAppSelDao fnPersUserAppSelDao, FnAuditLogDao fnAuditLogDao, - FnUserRoleDao fnUserRoleDao) { - this.fnAppDao = fnAppDao; - this.epAppFunctionDao = epAppFunctionDao; - this.fnRoleDao = fnRoleDao; - this.epAppRoleFunctionDao = epAppRoleFunctionDao; - this.epBasicAuthAccountDao = epBasicAuthAccountDao; - this.epMicroserviceDao = epMicroserviceDao; - this.epMicroserviceParameterDao = epMicroserviceParameterDao; - this.epWidgetCatalogDao = epWidgetCatalogDao; - this.fnAppContactUsDao = fnAppContactUsDao; - this.fnCommonWidgetDataDao = fnCommonWidgetDataDao; - this.fnLanguageDao = fnLanguageDao; - this.fnDisplayTextDao = fnDisplayTextDao; - this.fnFunctionDao = fnFunctionDao; - this.fnLuActivityDao = fnLuActivityDao; - this.fnLuAlertMethodDao = fnLuAlertMethodDao; - this.fnLuMenuSetDao = fnLuMenuSetDao; - this.fnLuPriorityDao = fnLuPriorityDao; - this.fnLuTimezoneDao = fnLuTimezoneDao; - this.fnMenuDao = fnMenuDao; - this.fnMenuFunctionalDao = fnMenuFunctionalDao; - this.fnMenuFunctionalAncestorsDao = fnMenuFunctionalAncestorsDao; - this.fnMenuFunctionalRolesDao = fnMenuFunctionalRolesDao; - this.fnQzJobDetailsDao = fnQzJobDetailsDao; - this.fnQzLocksDao = fnQzLocksDao; - this.fnQzSchedulerStateDao = fnQzSchedulerStateDao; - this.fnQzTriggersDao = fnQzTriggersDao; - this.fnQzCronTriggersDao = fnQzCronTriggersDao; - this.fnRestrictedUrlDao = fnRestrictedUrlDao; - this.fnRoleCompositeDao = fnRoleCompositeDao; - this.fnRoleFunctionDao = fnRoleFunctionDao; - this.fnSharedContextDao = fnSharedContextDao; - this.fnLuTabSetDao = fnLuTabSetDao; - this.fnTabDao = fnTabDao; - this.fnTabSelectedDao = fnTabSelectedDao; - this.fnUserDao = fnUserDao; - this.epPersUserAppSortDao = epPersUserAppSortDao; - this.fnPersUserAppSelDao = fnPersUserAppSelDao; - this.fnAuditLogDao = fnAuditLogDao; - this.fnUserRoleDao = fnUserRoleDao; + public DBInitializingBean(FnAppService fnAppService, EpAppFunctionService epAppFunctionService, FnRoleService fnRoleService, EpAppRoleFunctionService epAppRoleFunctionService, EpBasicAuthAccountService epBasicAuthAccountService, EpMicroserviceService epMicroserviceService, EpMicroserviceParameterService epMicroserviceParameterService, EpWidgetCatalogService epWidgetCatalogService, FnAppContactUsService fnAppContactUsService, FnCommonWidgetDataService fnCommonWidgetDataService, FnLanguageService fnLanguageService, FnDisplayTextService fnDisplayTextService, FnFunctionService fnFunctionService, FnLuActivityService fnLuActivityService, FnLuAlertMethodService fnLuAlertMethodService, FnLuMenuSetService fnLuMenuSetService, FnLuPriorityService fnLuPriorityService, FnLuTimezoneService fnLuTimezoneService, FnMenuService fnMenuService, FnMenuFunctionalService fnMenuFunctionalService, FnMenuFunctionalAncestorsService fnMenuFunctionalAncestorsService, FnMenuFunctionalRolesService fnMenuFunctionalRolesService, FnQzJobDetailsService fnQzJobDetailsService, FnQzLocksService fnQzLocksService, FnQzSchedulerStateService fnQzSchedulerStateService, FnQzTriggersService fnQzTriggersService, FnQzCronTriggersService fnQzCronTriggersService, FnRestrictedUrlService fnRestrictedUrlService, FnRoleCompositeService fnRoleCompositeService, FnRoleFunctionService fnRoleFunctionService, FnSharedContextService fnSharedContextService, FnLuTabSetService fnLuTabSetService, FnTabService fnTabService, FnTabSelectedService fnTabSelectedService, FnUserService fnUserService, EpPersUserAppSortService epPersUserAppSortService, FnPersUserAppSelService fnPersUserAppSelService, FnAuditLogService fnAuditLogService, FnUserRoleService fnUserRoleService) { + this.fnAppService = fnAppService; + this.epAppFunctionService = epAppFunctionService; + this.fnRoleService = fnRoleService; + this.epAppRoleFunctionService = epAppRoleFunctionService; + this.epBasicAuthAccountService = epBasicAuthAccountService; + this.epMicroserviceService = epMicroserviceService; + this.epMicroserviceParameterService = epMicroserviceParameterService; + this.epWidgetCatalogService = epWidgetCatalogService; + this.fnAppContactUsService = fnAppContactUsService; + this.fnCommonWidgetDataService = fnCommonWidgetDataService; + this.fnLanguageService = fnLanguageService; + this.fnDisplayTextService = fnDisplayTextService; + this.fnFunctionService = fnFunctionService; + this.fnLuActivityService = fnLuActivityService; + this.fnLuAlertMethodService = fnLuAlertMethodService; + this.fnLuMenuSetService = fnLuMenuSetService; + this.fnLuPriorityService = fnLuPriorityService; + this.fnLuTimezoneService = fnLuTimezoneService; + this.fnMenuService = fnMenuService; + this.fnMenuFunctionalService = fnMenuFunctionalService; + this.fnMenuFunctionalAncestorsService = fnMenuFunctionalAncestorsService; + this.fnMenuFunctionalRolesService = fnMenuFunctionalRolesService; + this.fnQzJobDetailsService = fnQzJobDetailsService; + this.fnQzLocksService = fnQzLocksService; + this.fnQzSchedulerStateService = fnQzSchedulerStateService; + this.fnQzTriggersService = fnQzTriggersService; + this.fnQzCronTriggersService = fnQzCronTriggersService; + this.fnRestrictedUrlService = fnRestrictedUrlService; + this.fnRoleCompositeService = fnRoleCompositeService; + this.fnRoleFunctionService = fnRoleFunctionService; + this.fnSharedContextService = fnSharedContextService; + this.fnLuTabSetService = fnLuTabSetService; + this.fnTabService = fnTabService; + this.fnTabSelectedService = fnTabSelectedService; + this.fnUserService = fnUserService; + this.epPersUserAppSortService = epPersUserAppSortService; + this.fnPersUserAppSelService = fnPersUserAppSelService; + this.fnAuditLogService = fnAuditLogService; + this.fnUserRoleService = fnUserRoleService; } @Override @@ -472,7 +418,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini .authNamespace(null) .build(); List fnApps = new ArrayList<>(Arrays.asList(app, app2, app3, app4, app5, app6, app7, app8, app9, app10)); - fnAppDao.saveAll(fnApps); + fnAppService.saveAll(fnApps); // EP_APP_FUNCTION TABLE @@ -535,7 +481,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini function10, function11, function12, function13, function14, function15, function16, function17, function18, function19, function20, function21, function22, function23, function24, function25, function26, function27)); - epAppFunctionDao.saveAll(epAppFunctions); + epAppFunctionService.saveAll(epAppFunctions); // FN_ROLE TABLE @@ -565,7 +511,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnRoles = new ArrayList<>(Arrays .asList(fnRole1, fnRole16, fnRole900, fnRole950, fnRole999, fnRole1000, fnRole1001, fnRole1002, fnRole1003, fnRole1004, fnRole1005, fnRole1006, fnRole1007, fnRole1008, fnRole1009, fnRole1010, fnRole1011, fnRole1012, fnRole2115)); - fnRoleDao.saveAll(fnRoles); + fnRoleService.saveAll(fnRoles); // EP_APP_ROLE_FUNCTION TABLE @@ -634,10 +580,10 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini epAppRoleFunction21, epAppRoleFunction22, epAppRoleFunction23, epAppRoleFunction24, epAppRoleFunction25, epAppRoleFunction26, epAppRoleFunction27, epAppRoleFunction28)); - epAppRoleFunctionDao.saveAll(epAppRoleFunctions); + epAppRoleFunctionService.saveAll(epAppRoleFunctions); EpBasicAuthAccount epBasicAuthAccount = EpBasicAuthAccount.builder().extAppName("JIRA").username("jira").password("6APqvG4AU2rfLgCvMdySwQ==").activeYn(true).build(); - epBasicAuthAccountDao.save(epBasicAuthAccount); + epBasicAuthAccountService.save(epBasicAuthAccount); // EP_MICROSERVICE TABLE @@ -648,7 +594,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List epMicroservices = new ArrayList<>(Arrays.asList(epMicroservice1, epMicroservice2, epMicroservice3, epMicroservice4)); - epMicroserviceDao.saveAll(epMicroservices); + epMicroserviceService.saveAll(epMicroservices); // ep_microservice_parameter table @@ -659,7 +605,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List epMicroserviceParameters = new ArrayList<>(Arrays.asList(parameter1, parameter2, parameter3, parameter4)); - epMicroserviceParameterDao.saveAll(epMicroserviceParameters); + epMicroserviceParameterService.saveAll(epMicroserviceParameters); // ep_widget_catalog table //TODO should we connect serviceId to EpMicroservice? @@ -671,7 +617,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List epWidgetCatalogs = new ArrayList<>(Arrays.asList(epWidgetCatalog1, epWidgetCatalog2, epWidgetCatalog3, epWidgetCatalog4)); - epWidgetCatalogDao.saveAll(epWidgetCatalogs); + epWidgetCatalogService.saveAll(epWidgetCatalogs); // ep_widget_catalog_files table //TODO @@ -691,7 +637,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnAppContactUses = new ArrayList<>(Arrays.asList(fnAppContactUs1, fnAppContactUs2, fnAppContactUs3, fnAppContactUs4, fnAppContactUs5, fnAppContactUs6, fnAppContactUs7, fnAppContactUs8)); - fnAppContactUsDao.saveAll(fnAppContactUses); + fnAppContactUsService.saveAll(fnAppContactUses); // fn_common_widget_data table @@ -708,15 +654,15 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnCommonWidgetDataList = new ArrayList<>(Arrays.asList(fnCommonWidgetData1, fnCommonWidgetData2, fnCommonWidgetData3, fnCommonWidgetData4, fnCommonWidgetData5, fnCommonWidgetData6, fnCommonWidgetData7, fnCommonWidgetData8, fnCommonWidgetData9, fnCommonWidgetData10)); - fnCommonWidgetDataDao.saveAll(fnCommonWidgetDataList); + fnCommonWidgetDataService.saveAll(fnCommonWidgetDataList); // fn_language table //TODO fix china text FnLanguage language1 = new FnLanguage("English", "EN"); FnLanguage language2 = new FnLanguage("简体ä¸\u00ADæ–‡", "CN"); - fnLanguageDao.save(language1); - fnLanguageDao.save(language2); + fnLanguageService.save(language1); + fnLanguageService.save(language2); // fn_display_text table // TODO should we change languageId from long type to FnLanguage? @@ -754,7 +700,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini fnDisplayText18, fnDisplayText19, fnDisplayText20, fnDisplayText21, fnDisplayText22, fnDisplayText23, fnDisplayText24, fnDisplayText25, fnDisplayText26)); - fnDisplayTextDao.saveAll(fnDisplayTexts); + fnDisplayTextService.saveAll(fnDisplayTexts); // fn_function table @@ -792,7 +738,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini menuJobDesigner, menuLogout, menuMap, menuNotes, menuProcess, menuProfile, menuProfileCreate, menuProfileImport, menuReports, menuSample, menuTab, menuTask, menuTaskSearch, menuWebAnalytics, saveNotification, viewReports)); - fnFunctionDao.saveAll(fnFunctions); + fnFunctionService.saveAll(fnFunctions); // fn_lu_activity table @@ -830,7 +776,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini activity16, activity17, activity18, activity19, activity20, activity21, activity22, activity23, activity24, activity25, tabAccess, activity27, activity28)); - fnLuActivityDao.saveAll(luActivities); + fnLuActivityService.saveAll(luActivities); //fn_lu_alert_method table @@ -842,19 +788,19 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List alertMethods = new ArrayList<>(Arrays.asList(alertMethod1, alertMethod2, alertMethod3, alertMethod4, alertMethod5)); - fnLuAlertMethodDao.saveAll(alertMethods); + fnLuAlertMethodService.saveAll(alertMethods); // fn_lu_menu_set table FnLuMenuSet menuSet = FnLuMenuSet.builder().menuSetCd("APP").menuSetName("Application Menu").build(); - fnLuMenuSetDao.save(menuSet); + fnLuMenuSetService.save(menuSet); // fn_lu_tab_set table FnLuTabSet fnLuTabSet = FnLuTabSet.builder().tabSetCd("APP").tabSetName("Application Tabs").build(); - fnLuTabSetDao.save(fnLuTabSet); + fnLuTabSetService.save(fnLuTabSet); // fn_lu_priority table @@ -866,7 +812,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List priorities = new ArrayList<>(Arrays.asList(low, normal, high, urgent, fatal)); - fnLuPriorityDao.saveAll(priorities); + fnLuPriorityService.saveAll(priorities); // fn_lu_timezone table @@ -880,7 +826,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List timezones = new ArrayList<>(Arrays.asList(USEastern, USCentral, USMountain, USArizona, USPacific, USAlaska, USHawaii)); - fnLuTimezoneDao.saveAll(timezones); + fnLuTimezoneService.saveAll(timezones); // fn_menu table @@ -901,7 +847,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnMenus = new ArrayList<>(Arrays.asList(menu1, menu2, menu3, menu4, menu5, menu6, menu7, menu8, menu9, menu10, menu11, menu12, menu13, menu14)); - fnMenuDao.saveAll(fnMenus); + fnMenuService.saveAll(fnMenus); // fn_menu_functional table @@ -953,7 +899,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini menuFunctional313, menuFunctional316, menuFunctional148, menuFunctional317, menuFunctional318, menuFunctional319)); - fnMenuFunctionalDao.saveAll(menuFunctionals); + fnMenuFunctionalService.saveAll(menuFunctionals); // fn_menu_functional_ancestors table @@ -1086,7 +1032,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini ancestors150, ancestors151, ancestors152, ancestors158, ancestors159, ancestors160, ancestors161, ancestors162, ancestors163, ancestors164, ancestors165, ancestors166, ancestors167, ancestors168, ancestors169)); - fnMenuFunctionalAncestorsDao.saveAll(ancestors); + fnMenuFunctionalAncestorsService.saveAll(ancestors); // fn_menu_functional_roles table @@ -1128,7 +1074,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini functionalRoles22, functionalRoles23, functionalRoles24, functionalRoles25, functionalRoles26, functionalRoles27, functionalRoles39, functionalRoles40, functionalRoles42, functionalRoles43)); - fnMenuFunctionalRolesDao.saveAll(functionalRoles); + fnMenuFunctionalRolesService.saveAll(functionalRoles); // fn_qz_job_details table @@ -1142,7 +1088,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List jobDetails = new ArrayList<>(Arrays.asList(fnQzJobDetails1, fnQzJobDetails2)); - fnQzJobDetailsDao.saveAll(jobDetails); + fnQzJobDetailsService.saveAll(jobDetails); // fn_qz_locks table @@ -1151,7 +1097,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List locks = new ArrayList<>(Arrays.asList(fnQzLocks1, fnQzLocks2)); - fnQzLocksDao.saveAll(locks); + fnQzLocksService.saveAll(locks); // fn_qz_scheduler_state table @@ -1159,7 +1105,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini .instanceName("portal-portal-app-76c9f7bfb5-s8rhd1565254283688").lastCheckinTime(BigInteger.valueOf(1565691615399L)) .checkinInterval(BigInteger.valueOf(20000L)).build(); - fnQzSchedulerStateDao.save(schedulerState); + fnQzSchedulerStateService.save(schedulerState); // fn_qz_triggers table //TODO @@ -1168,7 +1114,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnQzTriggers = new ArrayList<>(Arrays.asList(trigger1, trigger2)); - // fnQzTriggersDao.saveAll(fnQzTriggers); + // fnQzTriggersService.saveAll(fnQzTriggers); // fn_qz_cron_triggers table //TODO @@ -1178,7 +1124,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List cronTriggers = new ArrayList<>(Arrays.asList(cronTrigger1, cronTrigger2)); - //fnQzCronTriggersDao.saveAll(cronTriggers); + //fnQzCronTriggersService.saveAll(cronTriggers); // fn_restricted_url table //TODO @@ -1231,13 +1177,13 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini url26, url27, url28, url29, url30, url31, url32, url33, url34, url35, url36, url37, url38, url39, url40, url41, url42, url43)); - //fnRestrictedUrlDao.saveAll(urls); + //fnRestrictedUrlService.saveAll(urls); // fn_role_composite table //TODO FnRoleComposite roleComposite = FnRoleComposite.builder().parentRoles(fnRole1).childRoles(fnRole16).build(); - //fnRoleCompositeDao.save(roleComposite); + //fnRoleCompositeService.save(roleComposite); // fn_role_function table @@ -1283,7 +1229,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini roleFunction23, roleFunction24, roleFunction25, roleFunction26, roleFunction27, roleFunction28, roleFunction29, roleFunction30, roleFunction31, roleFunction32, roleFunction33, roleFunction34)); - fnRoleFunctionDao.saveAll(roleFunctions); + fnRoleFunctionService.saveAll(roleFunctions); // fn_shared_context table @@ -1304,7 +1250,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List sharedContexts = new ArrayList<>(Arrays.asList(sharedContext1, sharedContext2, sharedContext3, sharedContext4, sharedContext5, sharedContext6, sharedContext7, sharedContext8, sharedContext9, sharedContext10, sharedContext11, sharedContext12)); - fnSharedContextDao.saveAll(sharedContexts); + fnSharedContextService.saveAll(sharedContexts); // fn_tab table @@ -1319,7 +1265,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnTabs = new ArrayList<>(Arrays.asList(TAB1, TAB2, TAB2_SUB1, TAB2_SUB1_S1, TAB2_SUB2, TAB2_SUB3, TAB3, TAB4)); - fnTabDao.saveAll(fnTabs); + fnTabService.saveAll(fnTabs); // fn_tab_selected table @@ -1337,7 +1283,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List tabSelecteds = new ArrayList<>(Arrays.asList(tabSelected1, tabSelected2, tabSelected3, tabSelected4, tabSelected5, tabSelected6, tabSelected7, tabSelected8, tabSelected9, tabSelected10)); -// fnTabSelectedDao.saveAll(tabSelecteds); +// fnTabSelectedService.saveAll(tabSelecteds); // fn_user table @@ -1356,13 +1302,13 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List fnUsers = new ArrayList<>(Arrays.asList(fnUser1, fnUser2, fnUser3, fnUser4, fnUser5, fnUser6, fnUser7, fnUser8, fnUser9, fnUser10, fnUser11, fnUser12)); - fnUserDao.saveAll(fnUsers); + fnUserService.saveAll(fnUsers); // ep_pers_user_app_sort table EpPersUserAppSort appSort = EpPersUserAppSort.builder().userID(fnUser1).sortPref(0).build(); - epPersUserAppSortDao.save(appSort); + epPersUserAppSortService.save(appSort); // fn_pers_user_app_sel table @@ -1373,7 +1319,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List appSels = new ArrayList<>(Arrays.asList(appSel1, appSel2, appSel3, appSel4)); - fnPersUserAppSelDao.saveAll(appSels); + fnPersUserAppSelService.saveAll(appSels); // fn_audit_log table @@ -1387,7 +1333,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini List auditLogs = new ArrayList<>(Arrays.asList(fnAuditLog1, fnAuditLog2, fnAuditLog3, fnAuditLog4, fnAuditLog5, fnAuditLog6, fnAuditLog7)); - fnAuditLogDao.saveAll(auditLogs); + fnAuditLogService.saveAll(auditLogs); // fn_user_role table @@ -1437,7 +1383,7 @@ public class DBInitializingBean implements org.springframework.beans.factory.Ini userRole25, userRole26, userRole27, userRole28, userRole29, userRole30, userRole31, userRole32, userRole33, userRole34, userRole35, userRole36, userRole37, userRole38, userRole39)); - fnUserRoleDao.saveAll(userRoles); + fnUserRoleService.saveAll(userRoles); } diff --git a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java index a0542ec4..5fd919ba 100644 --- a/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java +++ b/portal-BE/src/main/java/org/onap/portal/configuration/SecurityConfig.java @@ -40,7 +40,7 @@ package org.onap.portal.configuration; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.user.FnUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; diff --git a/portal-BE/src/main/java/org/onap/portal/configuration/WebMvcConfiguration.java b/portal-BE/src/main/java/org/onap/portal/configuration/WebMvcConfiguration.java index f3b38187..93609844 100644 --- a/portal-BE/src/main/java/org/onap/portal/configuration/WebMvcConfiguration.java +++ b/portal-BE/src/main/java/org/onap/portal/configuration/WebMvcConfiguration.java @@ -40,9 +40,10 @@ package org.onap.portal.configuration; -import org.onap.portal.dao.fn.FnFunctionDao; +import org.onap.portal.service.function.FnFunctionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; import org.springframework.core.Ordered; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; @@ -52,11 +53,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @ComponentScan("org.springframework.security.samples.mvc") public class WebMvcConfiguration implements WebMvcConfigurer { - private final FnFunctionDao fnFunctionDao; + private final FnFunctionService fnFunctionService; @Autowired - public WebMvcConfiguration(FnFunctionDao fnFunctionDao) { - this.fnFunctionDao = fnFunctionDao; + public WebMvcConfiguration(FnFunctionService fnFunctionService) { + this.fnFunctionService = fnFunctionService; } @Override diff --git a/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java b/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java index 4a25e614..28c21d36 100644 --- a/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java +++ b/portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java @@ -50,8 +50,8 @@ import org.onap.portal.domain.dto.PortalRestStatusEnum; import org.onap.portal.domain.dto.fn.FnLanguageDto; import org.onap.portal.domain.mapper.FnLanguageMapper; import org.onap.portal.domain.mapper.FnUserMapper; -import org.onap.portal.service.fn.FnLanguageService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.language.FnLanguageService; +import org.onap.portal.service.user.FnUserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/portal-BE/src/main/java/org/onap/portal/controller/UserController.java b/portal-BE/src/main/java/org/onap/portal/controller/UserController.java index 571ab20a..3f05b0a9 100644 --- a/portal-BE/src/main/java/org/onap/portal/controller/UserController.java +++ b/portal-BE/src/main/java/org/onap/portal/controller/UserController.java @@ -45,7 +45,7 @@ import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.dto.PortalRestResponse; import org.onap.portal.domain.dto.PortalRestStatusEnum; import org.onap.portal.domain.dto.transport.ProfileDetail; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.validation.DataValidator; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.onboarding.util.CipherUtil; diff --git a/portal-BE/src/main/java/org/onap/portal/controller/UserRolesController.java b/portal-BE/src/main/java/org/onap/portal/controller/UserRolesController.java index dbba777e..1a2cb5d0 100644 --- a/portal-BE/src/main/java/org/onap/portal/controller/UserRolesController.java +++ b/portal-BE/src/main/java/org/onap/portal/controller/UserRolesController.java @@ -66,8 +66,8 @@ import org.onap.portal.logging.aop.EPEELFLoggerAdvice; import org.onap.portal.logging.logic.EPLogUtil; import org.onap.portal.service.AdminRolesService; import org.onap.portal.service.ApplicationsRestClientService; -import org.onap.portal.service.fn.FnUserRoleService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.userRole.FnUserRoleService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portal.utils.EcompPortalUtils; import org.onap.portal.utils.PortalConstants; diff --git a/portal-BE/src/main/java/org/onap/portal/controller/WidgetsCatalogController.java b/portal-BE/src/main/java/org/onap/portal/controller/WidgetsCatalogController.java index 59779448..93d6dd56 100644 --- a/portal-BE/src/main/java/org/onap/portal/controller/WidgetsCatalogController.java +++ b/portal-BE/src/main/java/org/onap/portal/controller/WidgetsCatalogController.java @@ -59,9 +59,9 @@ import org.onap.portal.domain.dto.ecomp.WidgetParameterResult; import org.onap.portal.domain.dto.ecomp.WidgetServiceHeaders; import org.onap.portal.logging.aop.EPAuditLog; import org.onap.portal.service.WidgetMService; -import org.onap.portal.service.ep.EpMicroserviceParameterService; -import org.onap.portal.service.ep.EpWidgetCatalogParameterService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.microserviceParameter.EpMicroserviceParameterService; +import org.onap.portal.service.widgetCatalogParameter.EpWidgetCatalogParameterService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portal.utils.EcompPortalUtils; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; diff --git a/portal-BE/src/main/java/org/onap/portal/controller/WidgetsController.java b/portal-BE/src/main/java/org/onap/portal/controller/WidgetsController.java index 6a92fbc3..db7039fe 100644 --- a/portal-BE/src/main/java/org/onap/portal/controller/WidgetsController.java +++ b/portal-BE/src/main/java/org/onap/portal/controller/WidgetsController.java @@ -50,12 +50,10 @@ import org.onap.portal.domain.dto.transport.FieldsValidator; import org.onap.portal.domain.dto.transport.OnboardingWidget; import org.onap.portal.domain.dto.transport.WidgetCatalogPersonalization; import org.onap.portal.logging.aop.EPAuditLog; -import org.onap.portal.service.AdminRolesService; import org.onap.portal.service.PersUserWidgetService; -import org.onap.portal.service.WidgetService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.widget.WidgetService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.utils.EcompPortalUtils; -import org.onap.portal.validation.DataValidator; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/ProfileDetail.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/ProfileDetail.java index 9024bddb..41e6a3ec 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/ProfileDetail.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/dto/transport/ProfileDetail.java @@ -40,15 +40,14 @@ package org.onap.portal.domain.dto.transport; - -import javax.validation.constraints.Email; -import javax.validation.constraints.NotBlank; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; +import org.hibernate.validator.constraints.Email; +import org.hibernate.validator.constraints.NotBlank; @Setter @Getter diff --git a/portal-BE/src/main/java/org/onap/portal/logging/aop/EPEELFLoggerAdvice.java b/portal-BE/src/main/java/org/onap/portal/logging/aop/EPEELFLoggerAdvice.java index 2c7151a2..9c00b7a2 100644 --- a/portal-BE/src/main/java/org/onap/portal/logging/aop/EPEELFLoggerAdvice.java +++ b/portal-BE/src/main/java/org/onap/portal/logging/aop/EPEELFLoggerAdvice.java @@ -50,7 +50,7 @@ import javax.servlet.http.HttpServletRequest; import org.onap.portal.domain.db.fn.FnApp; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.service.AppsCacheService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portal.utils.EcompPortalUtils; import org.onap.portalsdk.core.exception.SessionExpiredException; diff --git a/portal-BE/src/main/java/org/onap/portal/service/AdminRolesService.java b/portal-BE/src/main/java/org/onap/portal/service/AdminRolesService.java index 8049cd65..187e175e 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/AdminRolesService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/AdminRolesService.java @@ -57,7 +57,6 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import java.util.stream.Collectors; -import javax.annotation.PostConstruct; import javax.persistence.EntityManager; import javax.persistence.Query; import javax.persistence.Tuple; @@ -96,15 +95,15 @@ import org.onap.portal.exception.DeleteDomainObjectFailedException; import org.onap.portal.exception.SyncUserRolesException; import org.onap.portal.logging.format.EPAppMessagesEnum; import org.onap.portal.logging.logic.EPLogUtil; -import org.onap.portal.service.ep.EpAppFunctionService; -import org.onap.portal.service.ep.EpUserRolesRequestDetService; -import org.onap.portal.service.ep.EpUserRolesRequestService; -import org.onap.portal.service.fn.FnAppService; -import org.onap.portal.service.fn.FnMenuFunctionalRolesService; -import org.onap.portal.service.fn.FnMenuFunctionalService; -import org.onap.portal.service.fn.FnRoleService; -import org.onap.portal.service.fn.FnUserRoleService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.appFunction.EpAppFunctionService; +import org.onap.portal.service.userRolesRequestDet.EpUserRolesRequestDetService; +import org.onap.portal.service.userRolesRequest.EpUserRolesRequestService; +import org.onap.portal.service.app.FnAppService; +import org.onap.portal.service.menuFunctionalRoles.FnMenuFunctionalRolesService; +import org.onap.portal.service.menuFunctional.FnMenuFunctionalService; +import org.onap.portal.service.role.FnRoleService; +import org.onap.portal.service.userRole.FnUserRoleService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portal.utils.EPUserUtils; import org.onap.portal.utils.EcompPortalUtils; @@ -223,7 +222,7 @@ public class AdminRolesService { return false; } - boolean isUser(FnUser user) { + public boolean isUser(FnUser user) { try { FnUser currentUser = fnUserService.getUser(user.getId()).orElseThrow(Exception::new); if (currentUser != null && currentUser.getId() != null) { diff --git a/portal-BE/src/main/java/org/onap/portal/service/AppsCacheService.java b/portal-BE/src/main/java/org/onap/portal/service/AppsCacheService.java index 83b5df99..b7dd4bfb 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/AppsCacheService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/AppsCacheService.java @@ -48,7 +48,7 @@ import java.util.stream.Collectors; import javax.annotation.PostConstruct; import org.onap.portal.domain.db.fn.FnApp; import org.onap.portal.domain.dto.transport.OnboardingApp; -import org.onap.portal.service.fn.FnAppService; +import org.onap.portal.service.app.FnAppService; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/old/EPRoleFunctionService.java b/portal-BE/src/main/java/org/onap/portal/service/EPRoleFunctionService.java similarity index 98% rename from portal-BE/src/main/java/org/onap/portal/service/fn/old/EPRoleFunctionService.java rename to portal-BE/src/main/java/org/onap/portal/service/EPRoleFunctionService.java index b044dfb9..6023a1c4 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/old/EPRoleFunctionService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/EPRoleFunctionService.java @@ -35,7 +35,7 @@ * * */ -package org.onap.portal.service.fn.old; +package org.onap.portal.service; import java.util.HashMap; import java.util.HashSet; @@ -57,8 +57,6 @@ import org.springframework.transaction.annotation.Transactional; public class EPRoleFunctionService { @Autowired private DataAccessService dataAccessService; - - public DataAccessService getDataAccessService() { return dataAccessService; diff --git a/portal-BE/src/main/java/org/onap/portal/service/ExternalAccessRolesService.java b/portal-BE/src/main/java/org/onap/portal/service/ExternalAccessRolesService.java index b6739234..b9f161fe 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ExternalAccessRolesService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/ExternalAccessRolesService.java @@ -59,9 +59,9 @@ import org.onap.portal.domain.dto.transport.CentralV2Role; import org.onap.portal.domain.dto.transport.GlobalRoleWithApplicationRoleFunction; import org.onap.portal.exception.RoleFunctionException; import org.onap.portal.logging.logic.EPLogUtil; -import org.onap.portal.service.ep.EpAppFunctionService; -import org.onap.portal.service.fn.FnAppService; -import org.onap.portal.service.fn.FnRoleService; +import org.onap.portal.service.appFunction.EpAppFunctionService; +import org.onap.portal.service.app.FnAppService; +import org.onap.portal.service.role.FnRoleService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portal.utils.EPUserUtils; import org.onap.portal.utils.EcompPortalUtils; diff --git a/portal-BE/src/main/java/org/onap/portal/service/PersUserWidgetService.java b/portal-BE/src/main/java/org/onap/portal/service/PersUserWidgetService.java index 28d63eb2..2a5d0aec 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/PersUserWidgetService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/PersUserWidgetService.java @@ -43,13 +43,13 @@ package org.onap.portal.service; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import org.onap.portal.dao.ep.EpPersUserWidgetSelDao; -import org.onap.portal.dao.fn.EpWidgetCatalogDao; import org.onap.portal.domain.db.ep.EpPersUserWidgetSel; import org.onap.portal.domain.db.ep.EpWidgetCatalog; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.dto.ecomp.PersUserWidgetSelection; import org.onap.portal.domain.dto.transport.WidgetCatalogPersonalization; +import org.onap.portal.service.persUserWidgetSel.EpPersUserWidgetSelService; +import org.onap.portal.service.widgetCatalog.EpWidgetCatalogService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -61,14 +61,14 @@ import org.springframework.transaction.annotation.Transactional; public class PersUserWidgetService { private static final Logger LOGGER = LoggerFactory.getLogger(PersUserWidgetService.class); - private final EpPersUserWidgetSelDao epPersUserWidgetSelDao; - private final EpWidgetCatalogDao epWidgetCatalogDao; + private final EpPersUserWidgetSelService epPersUserWidgetSelService; + private final EpWidgetCatalogService epWidgetCatalogService; @Autowired - public PersUserWidgetService(final EpPersUserWidgetSelDao epPersUserWidgetSelDao, - final EpWidgetCatalogDao epWidgetCatalogDao) { - this.epPersUserWidgetSelDao = epPersUserWidgetSelDao; - this.epWidgetCatalogDao = epWidgetCatalogDao; + public PersUserWidgetService(final EpPersUserWidgetSelService epPersUserWidgetSelService, + final EpWidgetCatalogService epWidgetCatalogService) { + this.epPersUserWidgetSelService = epPersUserWidgetSelService; + this.epWidgetCatalogService = epWidgetCatalogService; } public void setPersUserAppValue(FnUser user, WidgetCatalogPersonalization personalization) { @@ -83,19 +83,19 @@ public class PersUserWidgetService { } if (persRow.getId() != null) { - epPersUserWidgetSelDao.deleteById(persRow.getId()); + epPersUserWidgetSelService.deleteById(persRow.getId()); } persRow.setStatusCode(personalization.getSelect() ? "S" : "H"); // Show / Hide EpPersUserWidgetSel epPersUserWidgetSel = new EpPersUserWidgetSel(); epPersUserWidgetSel.setUserId(user); epPersUserWidgetSel.setWidgetId( - epWidgetCatalogDao.findById(personalization.getWidgetId()).orElse(new EpWidgetCatalog())); - epPersUserWidgetSelDao.saveAndFlush(epPersUserWidgetSel); + epWidgetCatalogService.findById(personalization.getWidgetId()).orElse(new EpWidgetCatalog())); + epPersUserWidgetSelService.saveAndFlush(epPersUserWidgetSel); } private List getUserWidgetSelction(FnUser user, Long widgetId) { - return epPersUserWidgetSelDao + return epPersUserWidgetSelService .getEpPersUserWidgetSelForUserIdAndWidgetId(user.getId(), widgetId) .orElse(new ArrayList<>()) .stream() diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnAppDao.java b/portal-BE/src/main/java/org/onap/portal/service/app/FnAppDao.java similarity index 84% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnAppDao.java rename to portal-BE/src/main/java/org/onap/portal/service/app/FnAppDao.java index f86456f2..f57cc246 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnAppDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/app/FnAppDao.java @@ -1,4 +1,4 @@ -package org.onap.portal.dao.fn; +package org.onap.portal.service.app; import java.util.List; import org.onap.portal.domain.db.fn.FnApp; @@ -10,7 +10,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnAppDao extends JpaRepository { +interface FnAppDao extends JpaRepository { @Query List getByUebKey(final @Param("uebKey") String uebKey); diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnAppService.java b/portal-BE/src/main/java/org/onap/portal/service/app/FnAppService.java similarity index 95% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnAppService.java rename to portal-BE/src/main/java/org/onap/portal/service/app/FnAppService.java index 6e3c2879..13d0911a 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnAppService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/app/FnAppService.java @@ -38,14 +38,14 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.app; import java.util.ArrayList; import java.util.List; import java.util.Optional; import javax.persistence.EntityExistsException; import javax.persistence.EntityManager; -import org.onap.portal.dao.fn.FnAppDao; + import org.onap.portal.domain.db.fn.FnApp; import org.onap.portal.domain.dto.transport.OnboardingApp; import org.onap.portal.utils.EPCommonSystemProperties; @@ -66,7 +66,7 @@ public class FnAppService { private final EntityManager entityManager; @Autowired - public FnAppService(final FnAppDao fnAppDao, EntityManager entityManager) { + public FnAppService(FnAppDao fnAppDao, EntityManager entityManager) { this.fnAppDao = fnAppDao; this.entityManager = entityManager; } @@ -123,7 +123,7 @@ public class FnAppService { return result; } - List getUserRemoteApps(String id) { + public List getUserRemoteApps(String id) { /* StringBuilder sb = new StringBuilder(); sb.append("SELECT * FROM FnApp join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where "); sb.append("FN_USER_ROLE.USER_ID = ").append(id).append(" AND FN_USER_ROLE.ROLE_ID != ") @@ -134,4 +134,8 @@ public class FnAppService { List adminApps = query.getResultList();*/ return new ArrayList<>(); } + + public List saveAll(List fnApps) { + return fnAppDao.saveAll(fnApps); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnAppContactUsDao.java b/portal-BE/src/main/java/org/onap/portal/service/appContactUs/FnAppContactUsDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnAppContactUsDao.java rename to portal-BE/src/main/java/org/onap/portal/service/appContactUs/FnAppContactUsDao.java index 39603eb7..7b57e953 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnAppContactUsDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/appContactUs/FnAppContactUsDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.appContactUs; import org.onap.portal.domain.db.fn.FnAppContactUs; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnAppContactUsDao extends JpaRepository { +interface FnAppContactUsDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/appContactUs/FnAppContactUsService.java b/portal-BE/src/main/java/org/onap/portal/service/appContactUs/FnAppContactUsService.java new file mode 100644 index 00000000..600d8325 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/appContactUs/FnAppContactUsService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.appContactUs; + +import org.onap.portal.domain.db.fn.FnAppContactUs; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnAppContactUsService { + + private final FnAppContactUsDao fnAppContactUsDao; + + @Autowired + public FnAppContactUsService(FnAppContactUsDao fnAppContactUsDao) { + this.fnAppContactUsDao = fnAppContactUsDao; + } + + public List saveAll(List fnAppContactUses) { + return fnAppContactUsDao.saveAll(fnAppContactUses); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpAppFunctionDao.java b/portal-BE/src/main/java/org/onap/portal/service/appFunction/EpAppFunctionDao.java similarity index 95% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpAppFunctionDao.java rename to portal-BE/src/main/java/org/onap/portal/service/appFunction/EpAppFunctionDao.java index c7782b56..1f8c64b4 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpAppFunctionDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/appFunction/EpAppFunctionDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.appFunction; import java.util.List; import org.onap.portal.domain.db.ep.EpAppFunction; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpAppFunctionDao extends JpaRepository { +interface EpAppFunctionDao extends JpaRepository { @Query List getAppRoleFunctionList(final @Param("roleId") Long roleId, final @Param("appId") Long appId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/ep/EpAppFunctionService.java b/portal-BE/src/main/java/org/onap/portal/service/appFunction/EpAppFunctionService.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/service/ep/EpAppFunctionService.java rename to portal-BE/src/main/java/org/onap/portal/service/appFunction/EpAppFunctionService.java index 012983d3..aa5e258a 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ep/EpAppFunctionService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/appFunction/EpAppFunctionService.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.service.ep; +package org.onap.portal.service.appFunction; import java.util.ArrayList; import java.util.List; @@ -46,7 +46,7 @@ import java.util.Optional; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; -import org.onap.portal.dao.ep.EpAppFunctionDao; + import org.onap.portal.domain.db.ep.EpAppFunction; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -76,4 +76,8 @@ public class EpAppFunctionService { List seen = new ArrayList<>(); return t -> seen.add(keyExtractor.apply(t)); } + + public List saveAll(List epAppFunctions) { + return epAppFunctionDao.saveAll(epAppFunctions); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpAppRoleFunctionDao.java b/portal-BE/src/main/java/org/onap/portal/service/appRoleFunction/EpAppRoleFunctionDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpAppRoleFunctionDao.java rename to portal-BE/src/main/java/org/onap/portal/service/appRoleFunction/EpAppRoleFunctionDao.java index 3296eb7e..801c9385 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpAppRoleFunctionDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/appRoleFunction/EpAppRoleFunctionDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.appRoleFunction; import org.onap.portal.domain.db.ep.EpAppRoleFunction; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpAppRoleFunctionDao extends JpaRepository { +interface EpAppRoleFunctionDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/appRoleFunction/EpAppRoleFunctionService.java b/portal-BE/src/main/java/org/onap/portal/service/appRoleFunction/EpAppRoleFunctionService.java new file mode 100644 index 00000000..cb5383bf --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/appRoleFunction/EpAppRoleFunctionService.java @@ -0,0 +1,62 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Modifications Copyright (c) 2019 Samsung + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +package org.onap.portal.service.appRoleFunction; + +import org.onap.portal.domain.db.ep.EpAppRoleFunction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class EpAppRoleFunctionService { + + private final EpAppRoleFunctionDao epAppRoleFunctionDao; + + @Autowired + public EpAppRoleFunctionService(EpAppRoleFunctionDao epAppRoleFunctionDao) { + this.epAppRoleFunctionDao = epAppRoleFunctionDao; + } + + public List saveAll(List epAppRoleFunctions) { + return epAppRoleFunctionDao.saveAll(epAppRoleFunctions); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnAuditLogDao.java b/portal-BE/src/main/java/org/onap/portal/service/auditLog/FnAuditLogDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnAuditLogDao.java rename to portal-BE/src/main/java/org/onap/portal/service/auditLog/FnAuditLogDao.java index 4e747b4f..f6f4a336 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnAuditLogDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/auditLog/FnAuditLogDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.auditLog; import org.onap.portal.domain.db.fn.FnAuditLog; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnAuditLogDao extends JpaRepository { +interface FnAuditLogDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/auditLog/FnAuditLogService.java b/portal-BE/src/main/java/org/onap/portal/service/auditLog/FnAuditLogService.java new file mode 100644 index 00000000..ef51aab1 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/auditLog/FnAuditLogService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.auditLog; + +import org.onap.portal.domain.db.fn.FnAuditLog; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnAuditLogService { + + private final FnAuditLogDao fnAuditLogDao; + + @Autowired + public FnAuditLogService(FnAuditLogDao fnAuditLogDao) { + this.fnAuditLogDao = fnAuditLogDao; + } + + public List saveAll(List auditLogs) { + return fnAuditLogDao.saveAll(auditLogs); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpBasicAuthAccountDao.java b/portal-BE/src/main/java/org/onap/portal/service/basicAuthAccount/EpBasicAuthAccountDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpBasicAuthAccountDao.java rename to portal-BE/src/main/java/org/onap/portal/service/basicAuthAccount/EpBasicAuthAccountDao.java index cc3219c0..9c3a0a8e 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpBasicAuthAccountDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/basicAuthAccount/EpBasicAuthAccountDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.basicAuthAccount; import org.onap.portal.domain.db.ep.EpBasicAuthAccount; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface EpBasicAuthAccountDao extends JpaRepository { +interface EpBasicAuthAccountDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/basicAuthAccount/EpBasicAuthAccountService.java b/portal-BE/src/main/java/org/onap/portal/service/basicAuthAccount/EpBasicAuthAccountService.java new file mode 100644 index 00000000..3b23e918 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/basicAuthAccount/EpBasicAuthAccountService.java @@ -0,0 +1,20 @@ +package org.onap.portal.service.basicAuthAccount; + +import org.onap.portal.domain.db.ep.EpBasicAuthAccount; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class EpBasicAuthAccountService { + + private final EpBasicAuthAccountDao epBasicAuthAccountDao; + + @Autowired + public EpBasicAuthAccountService(EpBasicAuthAccountDao epBasicAuthAccountDao) { + this.epBasicAuthAccountDao = epBasicAuthAccountDao; + } + + public EpBasicAuthAccount save(EpBasicAuthAccount epBasicAuthAccount) { + return epBasicAuthAccountDao.save(epBasicAuthAccount); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnCommonWidgetDataDao.java b/portal-BE/src/main/java/org/onap/portal/service/commonWidgetData/FnCommonWidgetDataDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnCommonWidgetDataDao.java rename to portal-BE/src/main/java/org/onap/portal/service/commonWidgetData/FnCommonWidgetDataDao.java index deb062f0..f18082dc 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnCommonWidgetDataDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/commonWidgetData/FnCommonWidgetDataDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.commonWidgetData; import org.onap.portal.domain.db.fn.FnCommonWidgetData; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnCommonWidgetDataDao extends JpaRepository { +interface FnCommonWidgetDataDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/commonWidgetData/FnCommonWidgetDataService.java b/portal-BE/src/main/java/org/onap/portal/service/commonWidgetData/FnCommonWidgetDataService.java new file mode 100644 index 00000000..940d3adc --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/commonWidgetData/FnCommonWidgetDataService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.commonWidgetData; + +import org.onap.portal.domain.db.fn.FnCommonWidgetData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnCommonWidgetDataService { + + private final FnCommonWidgetDataDao fnCommonWidgetDataDao; + + @Autowired + public FnCommonWidgetDataService(FnCommonWidgetDataDao fnCommonWidgetDataDao) { + this.fnCommonWidgetDataDao = fnCommonWidgetDataDao; + } + + public List saveAll(List fnCommonWidgetDataList) { + return fnCommonWidgetDataDao.saveAll(fnCommonWidgetDataList); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnDisplayTextDao.java b/portal-BE/src/main/java/org/onap/portal/service/displayText/FnDisplayTextDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnDisplayTextDao.java rename to portal-BE/src/main/java/org/onap/portal/service/displayText/FnDisplayTextDao.java index fae8d684..00449dc4 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnDisplayTextDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/displayText/FnDisplayTextDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.displayText; import org.onap.portal.domain.db.fn.FnDisplayText; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnDisplayTextDao extends JpaRepository { +interface FnDisplayTextDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/displayText/FnDisplayTextService.java b/portal-BE/src/main/java/org/onap/portal/service/displayText/FnDisplayTextService.java new file mode 100644 index 00000000..45870ca3 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/displayText/FnDisplayTextService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.displayText; + +import org.onap.portal.domain.db.fn.FnDisplayText; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnDisplayTextService { + + private final FnDisplayTextDao fnDisplayTextDao; + + @Autowired + public FnDisplayTextService(FnDisplayTextDao fnDisplayTextDao) { + this.fnDisplayTextDao = fnDisplayTextDao; + } + + public List saveAll(List fnDisplayTexts) { + return fnDisplayTextDao.saveAll(fnDisplayTexts); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnFunctionDao.java b/portal-BE/src/main/java/org/onap/portal/service/function/FnFunctionDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnFunctionDao.java rename to portal-BE/src/main/java/org/onap/portal/service/function/FnFunctionDao.java index 6892de21..29ce30a3 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnFunctionDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/function/FnFunctionDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.function; import org.onap.portal.domain.db.fn.FnFunction; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnFunctionDao extends JpaRepository { +interface FnFunctionDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/function/FnFunctionService.java b/portal-BE/src/main/java/org/onap/portal/service/function/FnFunctionService.java new file mode 100644 index 00000000..d2361bea --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/function/FnFunctionService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.function; + +import org.onap.portal.domain.db.fn.FnFunction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnFunctionService { + + private final FnFunctionDao fnFunctionDao; + + @Autowired + public FnFunctionService(FnFunctionDao fnFunctionDao) { + this.fnFunctionDao = fnFunctionDao; + } + + public List saveAll(List fnFunctions) { + return fnFunctionDao.saveAll(fnFunctions); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLanguageDao.java b/portal-BE/src/main/java/org/onap/portal/service/language/FnLanguageDao.java similarity index 95% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLanguageDao.java rename to portal-BE/src/main/java/org/onap/portal/service/language/FnLanguageDao.java index c79fb0ed..dd6967f0 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLanguageDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/language/FnLanguageDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.language; import org.onap.portal.domain.db.fn.FnLanguage; import org.springframework.data.jpa.repository.JpaRepository; @@ -49,7 +49,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnLanguageDao extends JpaRepository { +interface FnLanguageDao extends JpaRepository { @Query FnLanguage getByLanguageAlias(final @Param("alias") String alias); diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnLanguageService.java b/portal-BE/src/main/java/org/onap/portal/service/language/FnLanguageService.java similarity index 90% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnLanguageService.java rename to portal-BE/src/main/java/org/onap/portal/service/language/FnLanguageService.java index c39a12b6..9221810e 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnLanguageService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/language/FnLanguageService.java @@ -38,12 +38,12 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.language; import java.security.Principal; import java.util.List; import java.util.Optional; -import org.onap.portal.dao.fn.FnLanguageDao; + import org.onap.portal.domain.db.fn.FnLanguage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; @@ -70,4 +70,12 @@ public class FnLanguageService { public FnLanguage save(final FnLanguage fnLanguage){ return fnLanguageDao.saveAndFlush(fnLanguage); } + + public FnLanguage getByLanguageAlias(String language) { + return fnLanguageDao.getByLanguageAlias(language); + } + + public void delete(FnLanguage fnLanguage) { + fnLanguageDao.delete(fnLanguage); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuActivityDao.java b/portal-BE/src/main/java/org/onap/portal/service/luActivity/FnLuActivityDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuActivityDao.java rename to portal-BE/src/main/java/org/onap/portal/service/luActivity/FnLuActivityDao.java index abc8cff1..fd6b37f6 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuActivityDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luActivity/FnLuActivityDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.luActivity; import org.onap.portal.domain.db.fn.FnLuActivity; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnLuActivityDao extends JpaRepository { +interface FnLuActivityDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/luActivity/FnLuActivityService.java b/portal-BE/src/main/java/org/onap/portal/service/luActivity/FnLuActivityService.java new file mode 100644 index 00000000..0ce68009 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/luActivity/FnLuActivityService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.luActivity; + +import org.onap.portal.domain.db.fn.FnLuActivity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnLuActivityService { + + private final FnLuActivityDao fnLuActivityDao; + + @Autowired + public FnLuActivityService(FnLuActivityDao fnLuActivityDao) { + this.fnLuActivityDao = fnLuActivityDao; + } + + public List saveAll(List luActivities) { + return fnLuActivityDao.saveAll(luActivities); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuAlertMethodDao.java b/portal-BE/src/main/java/org/onap/portal/service/luAlertMethod/FnLuAlertMethodDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuAlertMethodDao.java rename to portal-BE/src/main/java/org/onap/portal/service/luAlertMethod/FnLuAlertMethodDao.java index cfd22ce5..026d02f1 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuAlertMethodDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luAlertMethod/FnLuAlertMethodDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.luAlertMethod; import org.onap.portal.domain.db.fn.FnLuAlertMethod; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnLuAlertMethodDao extends JpaRepository { +interface FnLuAlertMethodDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/luAlertMethod/FnLuAlertMethodService.java b/portal-BE/src/main/java/org/onap/portal/service/luAlertMethod/FnLuAlertMethodService.java new file mode 100644 index 00000000..649ea987 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/luAlertMethod/FnLuAlertMethodService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.luAlertMethod; + +import org.onap.portal.domain.db.fn.FnLuAlertMethod; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnLuAlertMethodService { + + private final FnLuAlertMethodDao fnLuAlertMethodDao; + + @Autowired + public FnLuAlertMethodService(FnLuAlertMethodDao fnLuAlertMethodDao) { + this.fnLuAlertMethodDao = fnLuAlertMethodDao; + } + + public List saveAll(List alertMethods) { + return fnLuAlertMethodDao.saveAll(alertMethods); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuMenuSetDao.java b/portal-BE/src/main/java/org/onap/portal/service/luMenuSet/FnLuMenuSetDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuMenuSetDao.java rename to portal-BE/src/main/java/org/onap/portal/service/luMenuSet/FnLuMenuSetDao.java index adcb792a..d925a83c 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuMenuSetDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luMenuSet/FnLuMenuSetDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.luMenuSet; import org.onap.portal.domain.db.fn.FnLuMenuSet; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnLuMenuSetDao extends JpaRepository { +interface FnLuMenuSetDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/luMenuSet/FnLuMenuSetService.java b/portal-BE/src/main/java/org/onap/portal/service/luMenuSet/FnLuMenuSetService.java new file mode 100644 index 00000000..3433cde5 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/luMenuSet/FnLuMenuSetService.java @@ -0,0 +1,20 @@ +package org.onap.portal.service.luMenuSet; + +import org.onap.portal.domain.db.fn.FnLuMenuSet; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnLuMenuSetService { + + private final FnLuMenuSetDao fnLuMenuSetDao; + + @Autowired + public FnLuMenuSetService(FnLuMenuSetDao fnLuMenuSetDao) { + this.fnLuMenuSetDao = fnLuMenuSetDao; + } + + public FnLuMenuSet save(FnLuMenuSet menuSet) { + return fnLuMenuSetDao.save(menuSet); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuPriorityDao.java b/portal-BE/src/main/java/org/onap/portal/service/luPriority/FnLuPriorityDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuPriorityDao.java rename to portal-BE/src/main/java/org/onap/portal/service/luPriority/FnLuPriorityDao.java index 98253ceb..951ca1f3 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuPriorityDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luPriority/FnLuPriorityDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.luPriority; import org.onap.portal.domain.db.fn.FnLuPriority; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnLuPriorityDao extends JpaRepository { +interface FnLuPriorityDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/luPriority/FnLuPriorityService.java b/portal-BE/src/main/java/org/onap/portal/service/luPriority/FnLuPriorityService.java new file mode 100644 index 00000000..998589cb --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/luPriority/FnLuPriorityService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.luPriority; + +import org.onap.portal.domain.db.fn.FnLuPriority; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnLuPriorityService { + + private final FnLuPriorityDao fnLuPriorityDao; + + @Autowired + public FnLuPriorityService(FnLuPriorityDao fnLuPriorityDao) { + this.fnLuPriorityDao = fnLuPriorityDao; + } + + public List saveAll(List priorities) { + return fnLuPriorityDao.saveAll(priorities); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTabSetDao.java b/portal-BE/src/main/java/org/onap/portal/service/luTabSet/FnLuTabSetDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTabSetDao.java rename to portal-BE/src/main/java/org/onap/portal/service/luTabSet/FnLuTabSetDao.java index bcc3a1b8..13388010 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTabSetDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luTabSet/FnLuTabSetDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.luTabSet; import org.onap.portal.domain.db.fn.FnLuTabSet; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnLuTabSetDao extends JpaRepository { +interface FnLuTabSetDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/luTabSet/FnLuTabSetService.java b/portal-BE/src/main/java/org/onap/portal/service/luTabSet/FnLuTabSetService.java new file mode 100644 index 00000000..b9c131a0 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/luTabSet/FnLuTabSetService.java @@ -0,0 +1,20 @@ +package org.onap.portal.service.luTabSet; + +import org.onap.portal.domain.db.fn.FnLuTabSet; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnLuTabSetService { + + private final FnLuTabSetDao fnLuTabSetDao; + + @Autowired + public FnLuTabSetService(FnLuTabSetDao fnLuTabSetDao) { + this.fnLuTabSetDao = fnLuTabSetDao; + } + + public FnLuTabSet save(FnLuTabSet fnLuTabSet) { + return fnLuTabSetDao.save(fnLuTabSet); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTimezoneDao.java b/portal-BE/src/main/java/org/onap/portal/service/luTimezone/FnLuTimezoneDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTimezoneDao.java rename to portal-BE/src/main/java/org/onap/portal/service/luTimezone/FnLuTimezoneDao.java index d98d893b..3c35feef 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTimezoneDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luTimezone/FnLuTimezoneDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.luTimezone; import org.onap.portal.domain.db.fn.FnLuTimezone; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnLuTimezoneDao extends JpaRepository { +interface FnLuTimezoneDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnLuTimezoneService.java b/portal-BE/src/main/java/org/onap/portal/service/luTimezone/FnLuTimezoneService.java similarity index 92% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnLuTimezoneService.java rename to portal-BE/src/main/java/org/onap/portal/service/luTimezone/FnLuTimezoneService.java index ebb5d332..c4180ffa 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnLuTimezoneService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/luTimezone/FnLuTimezoneService.java @@ -38,10 +38,11 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.luTimezone; +import java.util.List; import java.util.Optional; -import org.onap.portal.dao.fn.FnLuTimezoneDao; + import org.onap.portal.domain.db.fn.FnLuTimezone; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -60,4 +61,8 @@ public class FnLuTimezoneService { public Optional getById(Long id){ return fnLuTimezoneDao.findById(id); } + + public List saveAll(List timezones) { + return fnLuTimezoneDao.saveAll(timezones); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuDao.java b/portal-BE/src/main/java/org/onap/portal/service/menu/FnMenuDao.java similarity index 95% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuDao.java rename to portal-BE/src/main/java/org/onap/portal/service/menu/FnMenuDao.java index bbd1b6ad..a861b3db 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/menu/FnMenuDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.menu; import org.onap.portal.domain.db.fn.FnMenu; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnMenuDao extends JpaRepository { +interface FnMenuDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/menu/FnMenuService.java b/portal-BE/src/main/java/org/onap/portal/service/menu/FnMenuService.java new file mode 100644 index 00000000..ad7a34bb --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/menu/FnMenuService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.menu; + +import org.onap.portal.domain.db.fn.FnMenu; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnMenuService { + + private final FnMenuDao fnMenuDao; + + @Autowired + public FnMenuService(FnMenuDao fnMenuDao) { + this.fnMenuDao = fnMenuDao; + } + + public List saveAll(List fnMenus) { + return fnMenuDao.saveAll(fnMenus); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalDao.java b/portal-BE/src/main/java/org/onap/portal/service/menuFunctional/FnMenuFunctionalDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalDao.java rename to portal-BE/src/main/java/org/onap/portal/service/menuFunctional/FnMenuFunctionalDao.java index 0c8ac4a9..424d90df 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/menuFunctional/FnMenuFunctionalDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.menuFunctional; import java.util.List; import org.onap.portal.domain.db.fn.FnMenuFunctional; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnMenuFunctionalDao extends JpaRepository { +interface FnMenuFunctionalDao extends JpaRepository { @Query List retrieveByMenuId(final @Param("menuId") Long menuId); } diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnMenuFunctionalService.java b/portal-BE/src/main/java/org/onap/portal/service/menuFunctional/FnMenuFunctionalService.java similarity index 92% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnMenuFunctionalService.java rename to portal-BE/src/main/java/org/onap/portal/service/menuFunctional/FnMenuFunctionalService.java index 97f3188a..1abf3eef 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnMenuFunctionalService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/menuFunctional/FnMenuFunctionalService.java @@ -38,12 +38,12 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.menuFunctional; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.onap.portal.dao.fn.FnMenuFunctionalDao; + import org.onap.portal.domain.db.fn.FnMenuFunctional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -62,4 +62,7 @@ public class FnMenuFunctionalService { return Optional.of(fnMenuFunctionalDao.retrieveByMenuId(menuId)).orElse(new ArrayList<>()); } + public List saveAll(List menuFunctionals) { + return fnMenuFunctionalDao.saveAll(menuFunctionals); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalAncestorsDao.java b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalAncestors/FnMenuFunctionalAncestorsDao.java similarity index 93% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalAncestorsDao.java rename to portal-BE/src/main/java/org/onap/portal/service/menuFunctionalAncestors/FnMenuFunctionalAncestorsDao.java index 3ffc7bb9..2b248a90 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalAncestorsDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalAncestors/FnMenuFunctionalAncestorsDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.menuFunctionalAncestors; import org.onap.portal.domain.db.fn.FnMenuFunctionalAncestors; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnMenuFunctionalAncestorsDao extends JpaRepository { +interface FnMenuFunctionalAncestorsDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalAncestors/FnMenuFunctionalAncestorsService.java b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalAncestors/FnMenuFunctionalAncestorsService.java new file mode 100644 index 00000000..070169f0 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalAncestors/FnMenuFunctionalAncestorsService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.menuFunctionalAncestors; + +import org.onap.portal.domain.db.fn.FnMenuFunctionalAncestors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnMenuFunctionalAncestorsService { + + private final FnMenuFunctionalAncestorsDao fnMenuFunctionalAncestorsDao; + + @Autowired + public FnMenuFunctionalAncestorsService(FnMenuFunctionalAncestorsDao fnMenuFunctionalAncestorsDao) { + this.fnMenuFunctionalAncestorsDao = fnMenuFunctionalAncestorsDao; + } + + public List saveAll(List ancestors) { + return fnMenuFunctionalAncestorsDao.saveAll(ancestors); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalRolesDao.java b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalRoles/FnMenuFunctionalRolesDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalRolesDao.java rename to portal-BE/src/main/java/org/onap/portal/service/menuFunctionalRoles/FnMenuFunctionalRolesDao.java index 10b189bb..385552d2 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnMenuFunctionalRolesDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalRoles/FnMenuFunctionalRolesDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.menuFunctionalRoles; import java.util.List; import org.onap.portal.domain.db.fn.FnMenuFunctionalRoles; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnMenuFunctionalRolesDao extends JpaRepository { +interface FnMenuFunctionalRolesDao extends JpaRepository { @Query List retrieveByRoleId(final @Param("roleId") Long roleId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnMenuFunctionalRolesService.java b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalRoles/FnMenuFunctionalRolesService.java similarity index 93% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnMenuFunctionalRolesService.java rename to portal-BE/src/main/java/org/onap/portal/service/menuFunctionalRoles/FnMenuFunctionalRolesService.java index c1747da1..3a2c62a5 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnMenuFunctionalRolesService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/menuFunctionalRoles/FnMenuFunctionalRolesService.java @@ -38,12 +38,12 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.menuFunctionalRoles; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.onap.portal.dao.fn.FnMenuFunctionalRolesDao; + import org.onap.portal.domain.db.fn.FnMenuFunctionalRoles; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -73,4 +73,7 @@ public class FnMenuFunctionalRolesService { return Optional.of(fnMenuFunctionalRolesDao.retrieveByMenuId(menuId)).orElse(new ArrayList<>()); } + public List saveAll(List functionalRoles) { + return fnMenuFunctionalRolesDao.saveAll(functionalRoles); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpMicroserviceDao.java b/portal-BE/src/main/java/org/onap/portal/service/microservice/EpMicroserviceDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpMicroserviceDao.java rename to portal-BE/src/main/java/org/onap/portal/service/microservice/EpMicroserviceDao.java index d68e1f84..70c4c05e 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpMicroserviceDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/microservice/EpMicroserviceDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.microservice; import org.onap.portal.domain.db.ep.EpMicroservice; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface EpMicroserviceDao extends JpaRepository { +interface EpMicroserviceDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/microservice/EpMicroserviceService.java b/portal-BE/src/main/java/org/onap/portal/service/microservice/EpMicroserviceService.java new file mode 100644 index 00000000..1b999f85 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/microservice/EpMicroserviceService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.microservice; + +import org.onap.portal.domain.db.ep.EpMicroservice; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class EpMicroserviceService { + + private final EpMicroserviceDao epMicroserviceDao; + + @Autowired + public EpMicroserviceService(EpMicroserviceDao epMicroserviceDao) { + this.epMicroserviceDao = epMicroserviceDao; + } + + public List saveAll(List epMicroservices) { + return epMicroserviceDao.saveAll(epMicroservices); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpMicroserviceParameterDao.java b/portal-BE/src/main/java/org/onap/portal/service/microserviceParameter/EpMicroserviceParameterDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpMicroserviceParameterDao.java rename to portal-BE/src/main/java/org/onap/portal/service/microserviceParameter/EpMicroserviceParameterDao.java index add897c9..ad054d95 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpMicroserviceParameterDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/microserviceParameter/EpMicroserviceParameterDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.microserviceParameter; import java.util.List; import org.onap.portal.domain.db.ep.EpMicroserviceParameter; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpMicroserviceParameterDao extends JpaRepository { +interface EpMicroserviceParameterDao extends JpaRepository { @Query void deleteByServiceId(@Param("SERVICEID") Long userId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/ep/EpMicroserviceParameterService.java b/portal-BE/src/main/java/org/onap/portal/service/microserviceParameter/EpMicroserviceParameterService.java similarity index 93% rename from portal-BE/src/main/java/org/onap/portal/service/ep/EpMicroserviceParameterService.java rename to portal-BE/src/main/java/org/onap/portal/service/microserviceParameter/EpMicroserviceParameterService.java index ea0e69b6..f4359c5d 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ep/EpMicroserviceParameterService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/microserviceParameter/EpMicroserviceParameterService.java @@ -38,16 +38,16 @@ * */ -package org.onap.portal.service.ep; +package org.onap.portal.service.microserviceParameter; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Restrictions; -import org.onap.portal.dao.ep.EpMicroserviceParameterDao; import org.onap.portal.domain.db.ep.EpMicroserviceParameter; import org.onap.portal.domain.dto.ecomp.MicroserviceParameter; +import org.onap.portal.service.widgetCatalogParameter.EpWidgetCatalogParameterService; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -101,4 +101,8 @@ public class EpMicroserviceParameterService { return false; } } + + public List saveAll(List epMicroserviceParameters) { + return epMicroserviceParameterDao.saveAll(epMicroserviceParameters); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnPersUserAppSelDao.java b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSel/FnPersUserAppSelDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnPersUserAppSelDao.java rename to portal-BE/src/main/java/org/onap/portal/service/persUserAppSel/FnPersUserAppSelDao.java index ff7e6e72..b6110748 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnPersUserAppSelDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSel/FnPersUserAppSelDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.persUserAppSel; import org.onap.portal.domain.db.fn.FnPersUserAppSel; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnPersUserAppSelDao extends JpaRepository { +interface FnPersUserAppSelDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/persUserAppSel/FnPersUserAppSelService.java b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSel/FnPersUserAppSelService.java new file mode 100644 index 00000000..41c281dd --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSel/FnPersUserAppSelService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.persUserAppSel; + +import org.onap.portal.domain.db.fn.FnPersUserAppSel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnPersUserAppSelService { + + private final FnPersUserAppSelDao fnPersUserAppSelDao; + + @Autowired + public FnPersUserAppSelService(FnPersUserAppSelDao fnPersUserAppSelDao) { + this.fnPersUserAppSelDao = fnPersUserAppSelDao; + } + + public List saveAll(List appSels) { + return fnPersUserAppSelDao.saveAll(appSels); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpPersUserAppSortDao.java b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSort/EpPersUserAppSortDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpPersUserAppSortDao.java rename to portal-BE/src/main/java/org/onap/portal/service/persUserAppSort/EpPersUserAppSortDao.java index bc9da593..e117fc3f 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpPersUserAppSortDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSort/EpPersUserAppSortDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.persUserAppSort; import org.onap.portal.domain.db.ep.EpPersUserAppSort; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpPersUserAppSortDao extends JpaRepository { +interface EpPersUserAppSortDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/persUserAppSort/EpPersUserAppSortService.java b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSort/EpPersUserAppSortService.java new file mode 100644 index 00000000..05d32e6d --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/persUserAppSort/EpPersUserAppSortService.java @@ -0,0 +1,20 @@ +package org.onap.portal.service.persUserAppSort; + +import org.onap.portal.domain.db.ep.EpPersUserAppSort; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class EpPersUserAppSortService { + + private final EpPersUserAppSortDao epPersUserAppSortDao; + + @Autowired + public EpPersUserAppSortService(EpPersUserAppSortDao epPersUserAppSortDao) { + this.epPersUserAppSortDao = epPersUserAppSortDao; + } + + public EpPersUserAppSort save(EpPersUserAppSort appSort) { + return epPersUserAppSortDao.save(appSort); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpPersUserWidgetSelDao.java b/portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpPersUserWidgetSelDao.java rename to portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelDao.java index 899fc1f0..cab80d83 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpPersUserWidgetSelDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.persUserWidgetSel; import java.util.List; import java.util.Optional; @@ -51,7 +51,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpPersUserWidgetSelDao extends JpaRepository { +interface EpPersUserWidgetSelDao extends JpaRepository { @Query Optional> getEpPersUserWidgetSelForUserIdAndWidgetId(@Param("USERID") Long userId, @Param("WIDGETID") Long widgetId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelService.java b/portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelService.java new file mode 100644 index 00000000..cd940d1c --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/persUserWidgetSel/EpPersUserWidgetSelService.java @@ -0,0 +1,32 @@ +package org.onap.portal.service.persUserWidgetSel; + +import org.onap.portal.domain.db.ep.EpPersUserWidgetSel; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +@Service +public class EpPersUserWidgetSelService { + + private final EpPersUserWidgetSelDao epPersUserWidgetSelDao; + + @Autowired + public EpPersUserWidgetSelService(EpPersUserWidgetSelDao epPersUserWidgetSelDao) { + this.epPersUserWidgetSelDao = epPersUserWidgetSelDao; + } + + public void deleteById(Long id) { + epPersUserWidgetSelDao.deleteById(id); + } + + public EpPersUserWidgetSel saveAndFlush(EpPersUserWidgetSel epPersUserWidgetSel) { + return epPersUserWidgetSelDao.saveAndFlush(epPersUserWidgetSel); + } + + public Optional> getEpPersUserWidgetSelForUserIdAndWidgetId(Long id, Long widgetId) { + return epPersUserWidgetSelDao.getEpPersUserWidgetSelForUserIdAndWidgetId(id, widgetId); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzCronTriggersDao.java b/portal-BE/src/main/java/org/onap/portal/service/qzCronTriggers/FnQzCronTriggersDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzCronTriggersDao.java rename to portal-BE/src/main/java/org/onap/portal/service/qzCronTriggers/FnQzCronTriggersDao.java index ec09ae54..a994050f 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzCronTriggersDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/qzCronTriggers/FnQzCronTriggersDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.qzCronTriggers; import org.onap.portal.domain.db.fn.FnQzCronTriggers; import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnQzCronTriggersDao extends JpaRepository { +interface FnQzCronTriggersDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/qzCronTriggers/FnQzCronTriggersService.java b/portal-BE/src/main/java/org/onap/portal/service/qzCronTriggers/FnQzCronTriggersService.java new file mode 100644 index 00000000..8cfdef24 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/qzCronTriggers/FnQzCronTriggersService.java @@ -0,0 +1,15 @@ +package org.onap.portal.service.qzCronTriggers; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnQzCronTriggersService { + + private final FnQzCronTriggersDao fnQzCronTriggersDao; + + @Autowired + public FnQzCronTriggersService(FnQzCronTriggersDao fnQzCronTriggersDao) { + this.fnQzCronTriggersDao = fnQzCronTriggersDao; + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzJobDetailsDao.java b/portal-BE/src/main/java/org/onap/portal/service/qzJobDetails/FnQzJobDetailsDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzJobDetailsDao.java rename to portal-BE/src/main/java/org/onap/portal/service/qzJobDetails/FnQzJobDetailsDao.java index 3a3a4183..5212031f 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzJobDetailsDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/qzJobDetails/FnQzJobDetailsDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.qzJobDetails; import org.onap.portal.domain.db.fn.FnQzJobDetails; import org.onap.portal.domain.db.fn.FnQzJobDetails.FnQzJobDetailsID; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnQzJobDetailsDao extends JpaRepository { +interface FnQzJobDetailsDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/qzJobDetails/FnQzJobDetailsService.java b/portal-BE/src/main/java/org/onap/portal/service/qzJobDetails/FnQzJobDetailsService.java new file mode 100644 index 00000000..f83f8e75 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/qzJobDetails/FnQzJobDetailsService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.qzJobDetails; + +import org.onap.portal.domain.db.fn.FnQzJobDetails; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnQzJobDetailsService { + + private final FnQzJobDetailsDao fnQzJobDetailsDao; + + @Autowired + public FnQzJobDetailsService(FnQzJobDetailsDao fnQzJobDetailsDao) { + this.fnQzJobDetailsDao = fnQzJobDetailsDao; + } + + public List saveAll(List jobDetails) { + return fnQzJobDetailsDao.saveAll(jobDetails); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzLocksDao.java b/portal-BE/src/main/java/org/onap/portal/service/qzLocks/FnQzLocksDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzLocksDao.java rename to portal-BE/src/main/java/org/onap/portal/service/qzLocks/FnQzLocksDao.java index 7063cf7e..e4df13af 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzLocksDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/qzLocks/FnQzLocksDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.qzLocks; import org.onap.portal.domain.db.fn.FnQzLocks; import org.onap.portal.domain.db.fn.FnQzLocks.FnQzLocksID; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnQzLocksDao extends JpaRepository { +interface FnQzLocksDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/qzLocks/FnQzLocksService.java b/portal-BE/src/main/java/org/onap/portal/service/qzLocks/FnQzLocksService.java new file mode 100644 index 00000000..a582f6df --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/qzLocks/FnQzLocksService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.qzLocks; + +import org.onap.portal.domain.db.fn.FnQzLocks; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnQzLocksService { + + private final FnQzLocksDao fnQzLocksDao; + + @Autowired + public FnQzLocksService(FnQzLocksDao fnQzLocksDao) { + this.fnQzLocksDao = fnQzLocksDao; + } + + public List saveAll(List locks) { + return fnQzLocksDao.saveAll(locks); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzSchedulerStateDao.java b/portal-BE/src/main/java/org/onap/portal/service/qzSchedulerState/FnQzSchedulerStateDao.java similarity index 93% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzSchedulerStateDao.java rename to portal-BE/src/main/java/org/onap/portal/service/qzSchedulerState/FnQzSchedulerStateDao.java index 17bbd7fa..56a2e84f 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzSchedulerStateDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/qzSchedulerState/FnQzSchedulerStateDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.qzSchedulerState; import org.onap.portal.domain.db.fn.FnQzSchedulerState; import org.onap.portal.domain.db.fn.FnQzSchedulerState.FnQzSchedulerStateID; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnQzSchedulerStateDao extends JpaRepository { +interface FnQzSchedulerStateDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/qzSchedulerState/FnQzSchedulerStateService.java b/portal-BE/src/main/java/org/onap/portal/service/qzSchedulerState/FnQzSchedulerStateService.java new file mode 100644 index 00000000..54519793 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/qzSchedulerState/FnQzSchedulerStateService.java @@ -0,0 +1,20 @@ +package org.onap.portal.service.qzSchedulerState; + +import org.onap.portal.domain.db.fn.FnQzSchedulerState; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnQzSchedulerStateService { + + private final FnQzSchedulerStateDao fnQzSchedulerStateDao; + + @Autowired + public FnQzSchedulerStateService(FnQzSchedulerStateDao fnQzSchedulerStateDao) { + this.fnQzSchedulerStateDao = fnQzSchedulerStateDao; + } + + public FnQzSchedulerState save(FnQzSchedulerState schedulerState) { + return fnQzSchedulerStateDao.save(schedulerState); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzTriggersDao.java b/portal-BE/src/main/java/org/onap/portal/service/qzTriggers/FnQzTriggersDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzTriggersDao.java rename to portal-BE/src/main/java/org/onap/portal/service/qzTriggers/FnQzTriggersDao.java index 55a86de2..c731f70d 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnQzTriggersDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/qzTriggers/FnQzTriggersDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.qzTriggers; import org.onap.portal.domain.db.fn.FnQzTriggers; import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnQzTriggersDao extends JpaRepository { +interface FnQzTriggersDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/qzTriggers/FnQzTriggersService.java b/portal-BE/src/main/java/org/onap/portal/service/qzTriggers/FnQzTriggersService.java new file mode 100644 index 00000000..4f175afe --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/qzTriggers/FnQzTriggersService.java @@ -0,0 +1,15 @@ +package org.onap.portal.service.qzTriggers; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnQzTriggersService { + + private final FnQzTriggersDao fnQzTriggersDao; + + @Autowired + public FnQzTriggersService(FnQzTriggersDao fnQzTriggersDao) { + this.fnQzTriggersDao = fnQzTriggersDao; + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRestrictedUrlDao.java b/portal-BE/src/main/java/org/onap/portal/service/restrictedUrl/FnRestrictedUrlDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnRestrictedUrlDao.java rename to portal-BE/src/main/java/org/onap/portal/service/restrictedUrl/FnRestrictedUrlDao.java index 1bf54d6d..d836c488 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRestrictedUrlDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/restrictedUrl/FnRestrictedUrlDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.restrictedUrl; import org.onap.portal.domain.db.fn.FnRestrictedUrl; import org.onap.portal.domain.db.fn.FnRestrictedUrl.FnRestrictedUrlId; @@ -48,6 +48,5 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnRestrictedUrlDao extends JpaRepository { - +interface FnRestrictedUrlDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/restrictedUrl/FnRestrictedUrlService.java b/portal-BE/src/main/java/org/onap/portal/service/restrictedUrl/FnRestrictedUrlService.java new file mode 100644 index 00000000..8f04dbfe --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/restrictedUrl/FnRestrictedUrlService.java @@ -0,0 +1,15 @@ +package org.onap.portal.service.restrictedUrl; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnRestrictedUrlService { + + private final FnRestrictedUrlDao fnRestrictedUrlDao; + + @Autowired + public FnRestrictedUrlService(FnRestrictedUrlDao fnRestrictedUrlDao) { + this.fnRestrictedUrlDao = fnRestrictedUrlDao; + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleDao.java b/portal-BE/src/main/java/org/onap/portal/service/role/FnRoleDao.java similarity index 96% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleDao.java rename to portal-BE/src/main/java/org/onap/portal/service/role/FnRoleDao.java index f979be6e..e12391d8 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/role/FnRoleDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.role; import java.util.List; import org.onap.portal.domain.db.fn.FnRole; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnRoleDao extends JpaRepository { +interface FnRoleDao extends JpaRepository { @Query List retrieveAppRoleByAppRoleIdAndByAppId(final @Param("appId") Long appId, diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnRoleService.java b/portal-BE/src/main/java/org/onap/portal/service/role/FnRoleService.java similarity index 97% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnRoleService.java rename to portal-BE/src/main/java/org/onap/portal/service/role/FnRoleService.java index 39a886c2..d73ae66e 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnRoleService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/role/FnRoleService.java @@ -38,13 +38,13 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.role; import java.util.ArrayList; import java.util.List; import java.util.Optional; import javax.persistence.EntityExistsException; -import org.onap.portal.dao.fn.FnRoleDao; + import org.onap.portal.domain.db.fn.FnRole; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; @@ -57,7 +57,6 @@ public class FnRoleService { private final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FnRoleService.class); - private final FnRoleDao fnRoleDao; @Autowired @@ -149,4 +148,8 @@ public class FnRoleService { public FnRole saveOne(final FnRole role){ return fnRoleDao.save(role); } + + public List saveAll(List fnRoles) { + return fnRoleDao.saveAll(fnRoles); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleCompositeDao.java b/portal-BE/src/main/java/org/onap/portal/service/roleComposite/FnRoleCompositeDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleCompositeDao.java rename to portal-BE/src/main/java/org/onap/portal/service/roleComposite/FnRoleCompositeDao.java index 89df2c41..61c4e139 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleCompositeDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/roleComposite/FnRoleCompositeDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.roleComposite; import org.onap.portal.domain.db.fn.FnRoleComposite; import org.onap.portal.domain.db.fn.compositePK.FnRoleCompositeId; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnRoleCompositeDao extends JpaRepository { +interface FnRoleCompositeDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/roleComposite/FnRoleCompositeService.java b/portal-BE/src/main/java/org/onap/portal/service/roleComposite/FnRoleCompositeService.java new file mode 100644 index 00000000..ed15259e --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/roleComposite/FnRoleCompositeService.java @@ -0,0 +1,15 @@ +package org.onap.portal.service.roleComposite; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnRoleCompositeService { + + private final FnRoleCompositeDao fnRoleCompositeDao; + + @Autowired + public FnRoleCompositeService(FnRoleCompositeDao fnRoleCompositeDao) { + this.fnRoleCompositeDao = fnRoleCompositeDao; + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleFunctionDao.java b/portal-BE/src/main/java/org/onap/portal/service/roleFunction/FnRoleFunctionDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleFunctionDao.java rename to portal-BE/src/main/java/org/onap/portal/service/roleFunction/FnRoleFunctionDao.java index eaafb78d..2928d8a1 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnRoleFunctionDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/roleFunction/FnRoleFunctionDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.roleFunction; import org.onap.portal.domain.db.fn.FnRoleFunction; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Transactional @Repository -public interface FnRoleFunctionDao extends JpaRepository { +interface FnRoleFunctionDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/roleFunction/FnRoleFunctionService.java b/portal-BE/src/main/java/org/onap/portal/service/roleFunction/FnRoleFunctionService.java new file mode 100644 index 00000000..a91dee82 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/roleFunction/FnRoleFunctionService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.roleFunction; + +import org.onap.portal.domain.db.fn.FnRoleFunction; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnRoleFunctionService { + + private final FnRoleFunctionDao fnRoleFunctionDao; + + @Autowired + public FnRoleFunctionService(FnRoleFunctionDao fnRoleFunctionDao) { + this.fnRoleFunctionDao = fnRoleFunctionDao; + } + + public List saveAll(List roleFunctions) { + return fnRoleFunctionDao.saveAll(roleFunctions); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnSharedContextDao.java b/portal-BE/src/main/java/org/onap/portal/service/sharedContext/FnSharedContextDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnSharedContextDao.java rename to portal-BE/src/main/java/org/onap/portal/service/sharedContext/FnSharedContextDao.java index 765bc1dd..8faac5b6 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnSharedContextDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/sharedContext/FnSharedContextDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.sharedContext; import org.onap.portal.domain.db.fn.FnSharedContext; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnSharedContextDao extends JpaRepository { +interface FnSharedContextDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/sharedContext/FnSharedContextService.java b/portal-BE/src/main/java/org/onap/portal/service/sharedContext/FnSharedContextService.java new file mode 100644 index 00000000..7a427ae9 --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/sharedContext/FnSharedContextService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.sharedContext; + +import org.onap.portal.domain.db.fn.FnSharedContext; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnSharedContextService { + + private final FnSharedContextDao fnSharedContextDao; + + @Autowired + public FnSharedContextService(FnSharedContextDao fnSharedContextDao) { + this.fnSharedContextDao = fnSharedContextDao; + } + + public List saveAll(List sharedContexts) { + return fnSharedContextDao.saveAll(sharedContexts); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnTabDao.java b/portal-BE/src/main/java/org/onap/portal/service/tab/FnTabDao.java similarity index 95% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnTabDao.java rename to portal-BE/src/main/java/org/onap/portal/service/tab/FnTabDao.java index c6518a99..ad9e7b6f 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnTabDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/tab/FnTabDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.tab; import org.onap.portal.domain.db.fn.FnTab; import org.springframework.data.jpa.repository.JpaRepository; @@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnTabDao extends JpaRepository { +interface FnTabDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/tab/FnTabService.java b/portal-BE/src/main/java/org/onap/portal/service/tab/FnTabService.java new file mode 100644 index 00000000..ed90831d --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/tab/FnTabService.java @@ -0,0 +1,22 @@ +package org.onap.portal.service.tab; + +import org.onap.portal.domain.db.fn.FnTab; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class FnTabService { + + private final FnTabDao fnTabDao; + + @Autowired + public FnTabService(FnTabDao fnTabDao) { + this.fnTabDao = fnTabDao; + } + + public List saveAll(List fnTabs) { + return fnTabDao.saveAll(fnTabs); + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnTabSelectedDao.java b/portal-BE/src/main/java/org/onap/portal/service/tabSelected/FnTabSelectedDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnTabSelectedDao.java rename to portal-BE/src/main/java/org/onap/portal/service/tabSelected/FnTabSelectedDao.java index 42da97e0..a11b30c3 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnTabSelectedDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/tabSelected/FnTabSelectedDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.tabSelected; import org.onap.portal.domain.db.fn.FnTabSelected; import org.onap.portal.domain.db.fn.FnTabSelected.FnTabSelectedId; @@ -48,6 +48,6 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnTabSelectedDao extends JpaRepository { +interface FnTabSelectedDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/tabSelected/FnTabSelectedService.java b/portal-BE/src/main/java/org/onap/portal/service/tabSelected/FnTabSelectedService.java new file mode 100644 index 00000000..92c6f56b --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/service/tabSelected/FnTabSelectedService.java @@ -0,0 +1,15 @@ +package org.onap.portal.service.tabSelected; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class FnTabSelectedService { + + private final FnTabSelectedDao fnTabSelectedDao; + + @Autowired + public FnTabSelectedService(FnTabSelectedDao fnTabSelectedDao) { + this.fnTabSelectedDao = fnTabSelectedDao; + } +} diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnUserDao.java b/portal-BE/src/main/java/org/onap/portal/service/user/FnUserDao.java similarity index 96% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnUserDao.java rename to portal-BE/src/main/java/org/onap/portal/service/user/FnUserDao.java index f52075c1..f7a150d3 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnUserDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/user/FnUserDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.user; import java.util.List; import java.util.Optional; @@ -51,7 +51,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnUserDao extends JpaRepository { +interface FnUserDao extends JpaRepository { @Query Optional findByLoginId(final @Param("loginId") String username); diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnUserService.java b/portal-BE/src/main/java/org/onap/portal/service/user/FnUserService.java similarity index 89% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnUserService.java rename to portal-BE/src/main/java/org/onap/portal/service/user/FnUserService.java index 16d32a67..975bd219 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnUserService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/user/FnUserService.java @@ -38,12 +38,12 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.user; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.onap.portal.dao.fn.FnUserDao; + import org.onap.portal.domain.db.fn.FnUser; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; @@ -89,12 +89,12 @@ public class FnUserService implements UserDetailsService { return fnUserDao.getUserWithOrgUserId(orgUserIdValue).orElse(new ArrayList<>()); } - List getUsersByOrgIds(final List orgIds) { + public List getUsersByOrgIds(final List orgIds) { return fnUserDao.getUsersByOrgIds(orgIds).orElse(new ArrayList<>()); } - List getActiveUsers() { + public List getActiveUsers() { return fnUserDao.getActiveUsers().orElse(new ArrayList<>()); } @@ -109,4 +109,16 @@ public class FnUserService implements UserDetailsService { public List findAll() { return fnUserDao.findAll(); } - } \ No newline at end of file + + public List saveAll(List fnUsers) { + return fnUserDao.saveAll(fnUsers); + } + + public FnUser save(FnUser user) { + return fnUserDao.save(user); + } + + public void delete(FnUser user) { + fnUserDao.delete(user); + } +} \ No newline at end of file diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnUserRoleDao.java b/portal-BE/src/main/java/org/onap/portal/service/userRole/FnUserRoleDao.java similarity index 96% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnUserRoleDao.java rename to portal-BE/src/main/java/org/onap/portal/service/userRole/FnUserRoleDao.java index 402304b8..141658a2 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnUserRoleDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/userRole/FnUserRoleDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.userRole; import java.util.List; import java.util.Optional; @@ -52,7 +52,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnUserRoleDao extends JpaRepository { +interface FnUserRoleDao extends JpaRepository { @Query Optional> getAdminUserRoles(final @Param("userId") Long userId, final @Param("roleId") Long roleId, final @Param("appId") Long appId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/fn/FnUserRoleService.java b/portal-BE/src/main/java/org/onap/portal/service/userRole/FnUserRoleService.java similarity index 98% rename from portal-BE/src/main/java/org/onap/portal/service/fn/FnUserRoleService.java rename to portal-BE/src/main/java/org/onap/portal/service/userRole/FnUserRoleService.java index fac4b14a..eb7ece2b 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/fn/FnUserRoleService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/userRole/FnUserRoleService.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.service.fn; +package org.onap.portal.service.userRole; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; @@ -58,7 +58,6 @@ import javax.persistence.EntityManager; import javax.persistence.Tuple; import javax.servlet.http.HttpServletResponse; import org.apache.cxf.transport.http.HTTPException; -import org.onap.portal.dao.fn.FnUserRoleDao; import org.onap.portal.domain.db.ep.EpUserRolesRequest; import org.onap.portal.domain.db.ep.EpUserRolesRequestDet; import org.onap.portal.domain.db.fn.FnApp; @@ -75,9 +74,11 @@ import org.onap.portal.domain.dto.transport.Role; import org.onap.portal.domain.dto.transport.RoleInAppForUser; import org.onap.portal.domain.dto.transport.UserApplicationRoles; import org.onap.portal.service.ApplicationsRestClientService; -import org.onap.portal.service.ep.EpAppFunctionService; -import org.onap.portal.service.ep.EpUserRolesRequestDetService; -import org.onap.portal.service.ep.EpUserRolesRequestService; +import org.onap.portal.service.userRolesRequestDet.EpUserRolesRequestDetService; +import org.onap.portal.service.userRolesRequest.EpUserRolesRequestService; +import org.onap.portal.service.app.FnAppService; +import org.onap.portal.service.role.FnRoleService; +import org.onap.portal.service.user.FnUserService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portal.utils.PortalConstants; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; @@ -536,4 +537,8 @@ public class FnUserRoleService { } return rolesInAppForUser; } + + public List saveAll(List userRoles) { + return fnUserRoleDao.saveAll(userRoles); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpUserRolesRequestDao.java b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequest/EpUserRolesRequestDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpUserRolesRequestDao.java rename to portal-BE/src/main/java/org/onap/portal/service/userRolesRequest/EpUserRolesRequestDao.java index 7924d431..5fefa885 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpUserRolesRequestDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequest/EpUserRolesRequestDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.userRolesRequest; import java.util.List; import org.onap.portal.domain.db.ep.EpUserRolesRequest; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpUserRolesRequestDao extends JpaRepository { +interface EpUserRolesRequestDao extends JpaRepository { @Query List userAppRolesRequestList(final @Param("userId") Long userId, final @Param("appId") Long appId); } diff --git a/portal-BE/src/main/java/org/onap/portal/service/ep/EpUserRolesRequestService.java b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequest/EpUserRolesRequestService.java similarity index 96% rename from portal-BE/src/main/java/org/onap/portal/service/ep/EpUserRolesRequestService.java rename to portal-BE/src/main/java/org/onap/portal/service/userRolesRequest/EpUserRolesRequestService.java index 4f5326d7..ab363266 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ep/EpUserRolesRequestService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequest/EpUserRolesRequestService.java @@ -38,12 +38,12 @@ * */ -package org.onap.portal.service.ep; +package org.onap.portal.service.userRolesRequest; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.onap.portal.dao.ep.EpUserRolesRequestDao; + import org.onap.portal.domain.db.ep.EpUserRolesRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpUserRolesRequestDetDao.java b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequestDet/EpUserRolesRequestDetDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpUserRolesRequestDetDao.java rename to portal-BE/src/main/java/org/onap/portal/service/userRolesRequestDet/EpUserRolesRequestDetDao.java index cfc97baa..8d04bf92 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpUserRolesRequestDetDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequestDet/EpUserRolesRequestDetDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.ep; +package org.onap.portal.service.userRolesRequestDet; import java.util.List; import org.onap.portal.domain.db.ep.EpUserRolesRequestDet; @@ -50,7 +50,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpUserRolesRequestDetDao extends JpaRepository { +interface EpUserRolesRequestDetDao extends JpaRepository { @Query List appRolesRequestDetailList(final @Param("reqId") Long reqId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/ep/EpUserRolesRequestDetService.java b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequestDet/EpUserRolesRequestDetService.java similarity index 96% rename from portal-BE/src/main/java/org/onap/portal/service/ep/EpUserRolesRequestDetService.java rename to portal-BE/src/main/java/org/onap/portal/service/userRolesRequestDet/EpUserRolesRequestDetService.java index 11c78b46..f8641f06 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ep/EpUserRolesRequestDetService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/userRolesRequestDet/EpUserRolesRequestDetService.java @@ -38,12 +38,11 @@ * */ -package org.onap.portal.service.ep; +package org.onap.portal.service.userRolesRequestDet; import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.onap.portal.dao.ep.EpUserRolesRequestDetDao; import org.onap.portal.domain.db.ep.EpUserRolesRequestDet; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnWidgetDao.java b/portal-BE/src/main/java/org/onap/portal/service/widget/FnWidgetDao.java similarity index 95% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/FnWidgetDao.java rename to portal-BE/src/main/java/org/onap/portal/service/widget/FnWidgetDao.java index 9c3e7a1f..053479ea 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/FnWidgetDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/widget/FnWidgetDao.java @@ -38,7 +38,7 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.widget; import java.util.List; import java.util.Optional; @@ -51,7 +51,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface FnWidgetDao extends JpaRepository { +interface FnWidgetDao extends JpaRepository { @Query Optional> getForUrlNameAndAppId(final @Param("URL") String url, final @Param("NAME") String name, final @Param("APPID") Long appId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/WidgetService.java b/portal-BE/src/main/java/org/onap/portal/service/widget/WidgetService.java similarity index 98% rename from portal-BE/src/main/java/org/onap/portal/service/WidgetService.java rename to portal-BE/src/main/java/org/onap/portal/service/widget/WidgetService.java index 6f8440e6..05917eb4 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/WidgetService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/widget/WidgetService.java @@ -38,19 +38,20 @@ * */ -package org.onap.portal.service; +package org.onap.portal.service.widget; import java.util.ArrayList; import java.util.List; import javax.persistence.EntityManager; import javax.servlet.http.HttpServletResponse; -import org.onap.portal.dao.fn.FnWidgetDao; + import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.db.fn.FnUserRole; import org.onap.portal.domain.db.fn.FnWidget; import org.onap.portal.domain.dto.transport.FieldsValidator; import org.onap.portal.domain.dto.transport.OnboardingWidget; -import org.onap.portal.service.fn.FnUserRoleService; +import org.onap.portal.service.AdminRolesService; +import org.onap.portal.service.userRole.FnUserRoleService; import org.onap.portal.utils.EPCommonSystemProperties; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; diff --git a/portal-BE/src/main/java/org/onap/portal/dao/fn/EpWidgetCatalogDao.java b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalog/EpWidgetCatalogDao.java similarity index 94% rename from portal-BE/src/main/java/org/onap/portal/dao/fn/EpWidgetCatalogDao.java rename to portal-BE/src/main/java/org/onap/portal/service/widgetCatalog/EpWidgetCatalogDao.java index 1e8de2bb..63bc5de8 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/fn/EpWidgetCatalogDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalog/EpWidgetCatalogDao.java @@ -38,11 +38,11 @@ * */ -package org.onap.portal.dao.fn; +package org.onap.portal.service.widgetCatalog; import org.onap.portal.domain.db.ep.EpWidgetCatalog; import org.springframework.data.jpa.repository.JpaRepository; -public interface EpWidgetCatalogDao extends JpaRepository { +interface EpWidgetCatalogDao extends JpaRepository { } diff --git a/portal-BE/src/main/java/org/onap/portal/service/ep/EpWidgetCatalogService.java b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalog/EpWidgetCatalogService.java similarity index 59% rename from portal-BE/src/main/java/org/onap/portal/service/ep/EpWidgetCatalogService.java rename to portal-BE/src/main/java/org/onap/portal/service/widgetCatalog/EpWidgetCatalogService.java index f0c273ad..2b17ea79 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ep/EpWidgetCatalogService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalog/EpWidgetCatalogService.java @@ -1,10 +1,12 @@ -package org.onap.portal.service.ep; +package org.onap.portal.service.widgetCatalog; -import org.onap.portal.dao.fn.EpWidgetCatalogDao; import org.onap.portal.domain.db.ep.EpWidgetCatalog; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Optional; + @Service public class EpWidgetCatalogService { @@ -18,4 +20,12 @@ public class EpWidgetCatalogService { public EpWidgetCatalog save(final EpWidgetCatalog epWidgetCatalog){ return epWidgetCatalogDao.save(epWidgetCatalog); } + + public Optional findById(Long widgetId) { + return epWidgetCatalogDao.findById(widgetId); + } + + public List saveAll(List epWidgetCatalogs) { + return epWidgetCatalogDao.saveAll(epWidgetCatalogs); + } } diff --git a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpWidgetCatalogParameterDao.java b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalogParameter/EpWidgetCatalogParameterDao.java similarity index 85% rename from portal-BE/src/main/java/org/onap/portal/dao/ep/EpWidgetCatalogParameterDao.java rename to portal-BE/src/main/java/org/onap/portal/service/widgetCatalogParameter/EpWidgetCatalogParameterDao.java index c5ec1248..6f388372 100644 --- a/portal-BE/src/main/java/org/onap/portal/dao/ep/EpWidgetCatalogParameterDao.java +++ b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalogParameter/EpWidgetCatalogParameterDao.java @@ -1,4 +1,4 @@ -package org.onap.portal.dao.ep; +package org.onap.portal.service.widgetCatalogParameter; import java.util.List; import java.util.Optional; @@ -12,7 +12,7 @@ import org.springframework.transaction.annotation.Transactional; @Repository @Transactional -public interface EpWidgetCatalogParameterDao extends JpaRepository { +interface EpWidgetCatalogParameterDao extends JpaRepository { @Query Optional> retrieveByParamId(@Param("PARAMID") Long paramId); diff --git a/portal-BE/src/main/java/org/onap/portal/service/ep/EpWidgetCatalogParameterService.java b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalogParameter/EpWidgetCatalogParameterService.java similarity index 97% rename from portal-BE/src/main/java/org/onap/portal/service/ep/EpWidgetCatalogParameterService.java rename to portal-BE/src/main/java/org/onap/portal/service/widgetCatalogParameter/EpWidgetCatalogParameterService.java index 029c316e..cf9b9fc7 100644 --- a/portal-BE/src/main/java/org/onap/portal/service/ep/EpWidgetCatalogParameterService.java +++ b/portal-BE/src/main/java/org/onap/portal/service/widgetCatalogParameter/EpWidgetCatalogParameterService.java @@ -38,12 +38,12 @@ * */ -package org.onap.portal.service.ep; +package org.onap.portal.service.widgetCatalogParameter; import java.util.ArrayList; import java.util.List; -import org.onap.portal.dao.ep.EpWidgetCatalogParameterDao; import org.onap.portal.domain.db.ep.EpWidgetCatalogParameter; +import org.onap.portal.service.microserviceParameter.EpMicroserviceParameterService; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java b/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java index fea71337..027cebe7 100644 --- a/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java +++ b/portal-BE/src/main/java/org/onap/portal/utils/EPUserUtils.java @@ -63,7 +63,7 @@ import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.db.fn.FnUserRole; import org.onap.portal.domain.dto.transport.Role; import org.onap.portal.exception.RoleFunctionException; -import org.onap.portal.service.fn.old.EPRoleFunctionService; +import org.onap.portal.service.EPRoleFunctionService; import org.onap.portalsdk.core.domain.RoleFunction; import org.onap.portalsdk.core.exception.SessionExpiredException; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; diff --git a/portal-BE/src/test/java/org/onap/portal/controller/LanguageControllerTest.java b/portal-BE/src/test/java/org/onap/portal/controller/LanguageControllerTest.java index e00dc5ca..ca0cf920 100644 --- a/portal-BE/src/test/java/org/onap/portal/controller/LanguageControllerTest.java +++ b/portal-BE/src/test/java/org/onap/portal/controller/LanguageControllerTest.java @@ -45,13 +45,13 @@ import static org.junit.jupiter.api.Assertions.assertNull; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; -import org.onap.portal.dao.fn.FnLanguageDao; import org.onap.portal.domain.db.fn.FnLanguage; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.dto.PortalRestResponse; import org.onap.portal.domain.dto.PortalRestStatusEnum; import org.onap.portal.domain.dto.fn.FnLanguageDto; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.language.FnLanguageService; +import org.onap.portal.service.user.FnUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -69,7 +69,7 @@ class LanguageControllerTest { @Autowired private LanguageController languageController; @Autowired - private FnLanguageDao fnLanguageDao; + private FnLanguageService fnLanguageService; @Autowired private FnUserService fnUserService; @@ -89,7 +89,7 @@ class LanguageControllerTest { assertEquals(expected.getMessage(), actual.getMessage()); assertEquals(expected.getStatus(), actual.getStatus()); //Clean up - fnLanguageDao.delete(fnLanguage); + fnLanguageService.delete(fnLanguage); } @Test @@ -109,7 +109,7 @@ class LanguageControllerTest { assertEquals(expected.getMessage(), actual.getMessage()); assertEquals(expected.getStatus(), actual.getStatus()); //Clean up - fnLanguageDao.delete(fnLanguage); + fnLanguageService.delete(fnLanguage); } @Test @@ -138,7 +138,7 @@ class LanguageControllerTest { //Clean up - fnLanguageDao.delete(fnLanguage); + fnLanguageService.delete(fnLanguage); } @Test @@ -162,7 +162,7 @@ class LanguageControllerTest { //Clean up - fnLanguageDao.delete(fnLanguage); + fnLanguageService.delete(fnLanguage); } diff --git a/portal-BE/src/test/java/org/onap/portal/controller/UserControllerTest.java b/portal-BE/src/test/java/org/onap/portal/controller/UserControllerTest.java index 0316683f..7c654ad4 100644 --- a/portal-BE/src/test/java/org/onap/portal/controller/UserControllerTest.java +++ b/portal-BE/src/test/java/org/onap/portal/controller/UserControllerTest.java @@ -47,7 +47,7 @@ import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.dto.PortalRestResponse; import org.onap.portal.domain.dto.PortalRestStatusEnum; import org.onap.portal.domain.dto.transport.ProfileDetail; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.user.FnUserService; import org.onap.portalsdk.core.onboarding.exception.CipherUtilException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; diff --git a/portal-BE/src/test/java/org/onap/portal/controller/UserRolesControllerTest.java b/portal-BE/src/test/java/org/onap/portal/controller/UserRolesControllerTest.java index e83c2470..e9f9627e 100644 --- a/portal-BE/src/test/java/org/onap/portal/controller/UserRolesControllerTest.java +++ b/portal-BE/src/test/java/org/onap/portal/controller/UserRolesControllerTest.java @@ -45,11 +45,11 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.onap.portal.domain.dto.ecomp.ExternalSystemAccess; -import org.onap.portal.service.fn.FnAppService; -import org.onap.portal.service.fn.FnLanguageService; -import org.onap.portal.service.fn.FnRoleService; -import org.onap.portal.service.fn.FnUserRoleService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.app.FnAppService; +import org.onap.portal.service.language.FnLanguageService; +import org.onap.portal.service.role.FnRoleService; +import org.onap.portal.service.userRole.FnUserRoleService; +import org.onap.portal.service.user.FnUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; diff --git a/portal-BE/src/test/java/org/onap/portal/controller/WidgetsCatalogControllerTest.java b/portal-BE/src/test/java/org/onap/portal/controller/WidgetsCatalogControllerTest.java index 27ce3484..65525dbe 100644 --- a/portal-BE/src/test/java/org/onap/portal/controller/WidgetsCatalogControllerTest.java +++ b/portal-BE/src/test/java/org/onap/portal/controller/WidgetsCatalogControllerTest.java @@ -51,18 +51,17 @@ import java.util.List; import javax.transaction.Transactional; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.portal.dao.fn.FnLanguageDao; import org.onap.portal.domain.db.ep.EpMicroserviceParameter; import org.onap.portal.domain.db.ep.EpWidgetCatalog; import org.onap.portal.domain.db.ep.EpWidgetCatalogParameter; import org.onap.portal.domain.db.fn.FnLanguage; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.dto.ecomp.WidgetCatalog; -import org.onap.portal.service.ep.EpMicroserviceParameterService; -import org.onap.portal.service.ep.EpWidgetCatalogParameterService; -import org.onap.portal.service.ep.EpWidgetCatalogService; -import org.onap.portal.service.fn.FnLanguageService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.microserviceParameter.EpMicroserviceParameterService; +import org.onap.portal.service.widgetCatalogParameter.EpWidgetCatalogParameterService; +import org.onap.portal.service.widgetCatalog.EpWidgetCatalogService; +import org.onap.portal.service.language.FnLanguageService; +import org.onap.portal.service.user.FnUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -88,8 +87,6 @@ public class WidgetsCatalogControllerTest { private EpMicroserviceParameterService epMicroserviceParameterService; @Autowired private EpWidgetCatalogService epWidgetCatalogService; - @Autowired - private FnLanguageDao fnLanguageDao; @Test public void getUserWidgetCatalog() { @@ -172,7 +169,7 @@ public class WidgetsCatalogControllerTest { EpMicroserviceParameter parameter = new EpMicroserviceParameter(); epMicroserviceParameterService.save(parameter); FnUser user = buildFnUser(); - FnLanguage language = fnLanguageDao.getByLanguageAlias("EN"); + FnLanguage language = fnLanguageService.getByLanguageAlias("EN"); user.setLanguageId(language); fnUserService.saveFnUser(user); EpWidgetCatalogParameter data = EpWidgetCatalogParameter.builder() diff --git a/portal-BE/src/test/java/org/onap/portal/controller/WidgetsControllerTest.java b/portal-BE/src/test/java/org/onap/portal/controller/WidgetsControllerTest.java index 168fcc7a..9da6e733 100644 --- a/portal-BE/src/test/java/org/onap/portal/controller/WidgetsControllerTest.java +++ b/portal-BE/src/test/java/org/onap/portal/controller/WidgetsControllerTest.java @@ -53,8 +53,6 @@ import javax.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.portal.dao.fn.FnLanguageDao; -import org.onap.portal.dao.fn.FnUserDao; import org.onap.portal.domain.db.fn.FnLanguage; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.db.fn.FnWidget; @@ -62,8 +60,9 @@ import org.onap.portal.domain.dto.transport.FieldsValidator; import org.onap.portal.domain.dto.transport.OnboardingWidget; import org.onap.portal.domain.dto.transport.WidgetCatalogPersonalization; import org.onap.portal.framework.MockitoTestSuite; -import org.onap.portal.service.WidgetService; -import org.onap.portal.service.fn.FnLanguageService; +import org.onap.portal.service.user.FnUserService; +import org.onap.portal.service.widget.WidgetService; +import org.onap.portal.service.language.FnLanguageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -89,14 +88,11 @@ public class WidgetsControllerTest { @Autowired private WidgetsController widgetsController; @Autowired - private FnUserDao fnUserDao; - @Autowired - private FnLanguageDao fnLanguageDao; - @Autowired private WidgetService widgetService; @Autowired private FnLanguageService fnLanguageService; - + @Autowired + FnUserService fnUserService; private FnLanguage language; private FnUser questUser; private FnUser notQuestUser; @@ -120,14 +116,14 @@ public class WidgetsControllerTest { public void getOnboardingWidgetsQuestUserTest() { UsernamePasswordAuthenticationToken questPrincipal = new UsernamePasswordAuthenticationToken("questUser", "demo123"); - fnUserDao.save(questUser); + fnUserService.save(questUser); List onboardingWidgets = widgetsController .getOnboardingWidgets(questPrincipal, request, response); assertNull(onboardingWidgets); //Clean up - fnUserDao.delete(questUser); - fnLanguageDao.delete(language); + fnUserService.delete(questUser); + fnLanguageService.delete(language); } @Test @@ -135,7 +131,7 @@ public class WidgetsControllerTest { UsernamePasswordAuthenticationToken notQuestprincipal = new UsernamePasswordAuthenticationToken( "notQuestUser", "demo123"); - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); List expected = new ArrayList<>(); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); @@ -143,7 +139,7 @@ public class WidgetsControllerTest { .getOnboardingWidgets(notQuestprincipal, request, response); assertEquals(expected, actual); - fnUserDao.delete(notQuestUser); + fnUserService.delete(notQuestUser); } @Test @@ -151,19 +147,19 @@ public class WidgetsControllerTest { UsernamePasswordAuthenticationToken notQuestprincipal = new UsernamePasswordAuthenticationToken( "notQuestUser", "demo123"); - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("test"); List actual = widgetsController .getOnboardingWidgets(notQuestprincipal, request, response); assertNull(actual); - fnUserDao.delete(notQuestUser); + fnUserService.delete(notQuestUser); } @Test public void putOnboardingWidgetSameWidget() { //Given - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); OnboardingWidget onboardingWidget = OnboardingWidget.builder() @@ -199,7 +195,7 @@ public class WidgetsControllerTest { @Test public void putOnboardingWidgetAOP() { //Given - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); OnboardingWidget onboardingWidget = OnboardingWidget.builder() @@ -236,7 +232,7 @@ public class WidgetsControllerTest { @Test public void putOnboardingWidgetAOPXSSTest() { //Given - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); OnboardingWidget onboardingWidget = OnboardingWidget.builder() @@ -264,7 +260,7 @@ public class WidgetsControllerTest { @Test public void postOnboardingWidgetXSS() { //Given - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); OnboardingWidget onboardingWidget = OnboardingWidget.builder() @@ -290,7 +286,7 @@ public class WidgetsControllerTest { @Test public void postOnboardingWidget() { //Given - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); OnboardingWidget onboardingWidget = OnboardingWidget.builder() @@ -315,7 +311,7 @@ public class WidgetsControllerTest { @Test public void deleteOnboardingWidgetSCFORBIDDEN() { //Given - fnUserDao.save(notQuestUser); + fnUserService.save(notQuestUser); when(request.getHeader("X-Widgets-Type")).thenReturn("managed"); OnboardingWidget onboardingWidget = OnboardingWidget.builder() diff --git a/portal-BE/src/test/java/org/onap/portal/exception/NotValidDataExceptionTest.java b/portal-BE/src/test/java/org/onap/portal/exception/NotValidDataExceptionTest.java new file mode 100644 index 00000000..df898f13 --- /dev/null +++ b/portal-BE/src/test/java/org/onap/portal/exception/NotValidDataExceptionTest.java @@ -0,0 +1,62 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Modifications Copyright (c) 2019 IBM + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +package org.onap.portal.exception; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class NotValidDataExceptionTest { + + + @Test + public void TestException2() { + String s1 = "Value1"; + String s2 = "value2"; + try { + if (!s1.equalsIgnoreCase(s2)) { + throw new NotValidDataException("Exception occured.."); + } + } catch (NotValidDataException mde) { + assertEquals(mde.getMessage(),"Exception occured.."); + } + + } +} diff --git a/portal-BE/src/test/java/org/onap/portal/framework/MockitoTestSuite.java b/portal-BE/src/test/java/org/onap/portal/framework/MockitoTestSuite.java index 1825e401..49c4829b 100644 --- a/portal-BE/src/test/java/org/onap/portal/framework/MockitoTestSuite.java +++ b/portal-BE/src/test/java/org/onap/portal/framework/MockitoTestSuite.java @@ -37,16 +37,17 @@ */ package org.onap.portal.framework; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; +import org.springframework.test.context.junit4.SpringRunner; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.mockito.runners.MockitoJUnitRunner; -@RunWith(MockitoJUnitRunner.class) +@RunWith(SpringRunner.class) public class MockitoTestSuite { diff --git a/portal-BE/src/test/java/org/onap/portal/service/ep/EpMicroserviceParameterServiceTest.java b/portal-BE/src/test/java/org/onap/portal/service/ep/EpMicroserviceParameterServiceTest.java index b4427ef3..e11a696c 100644 --- a/portal-BE/src/test/java/org/onap/portal/service/ep/EpMicroserviceParameterServiceTest.java +++ b/portal-BE/src/test/java/org/onap/portal/service/ep/EpMicroserviceParameterServiceTest.java @@ -45,6 +45,7 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.onap.portal.domain.db.ep.EpMicroserviceParameter; +import org.onap.portal.service.microserviceParameter.EpMicroserviceParameterService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.TestPropertySource; diff --git a/portal-BE/src/test/java/org/onap/portal/service/ep/EpWidgetCatalogParameterServiceTest.java b/portal-BE/src/test/java/org/onap/portal/service/ep/EpWidgetCatalogParameterServiceTest.java index ad1ee60d..7c7b0b7a 100644 --- a/portal-BE/src/test/java/org/onap/portal/service/ep/EpWidgetCatalogParameterServiceTest.java +++ b/portal-BE/src/test/java/org/onap/portal/service/ep/EpWidgetCatalogParameterServiceTest.java @@ -43,19 +43,20 @@ package org.onap.portal.service.ep; import static org.junit.jupiter.api.Assertions.assertEquals; import java.time.LocalDateTime; -import java.util.Collections; -import java.util.HashSet; + import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.onap.portal.controller.WidgetsCatalogController; -import org.onap.portal.dao.fn.FnLanguageDao; import org.onap.portal.domain.db.ep.EpMicroserviceParameter; import org.onap.portal.domain.db.ep.EpWidgetCatalog; import org.onap.portal.domain.db.ep.EpWidgetCatalogParameter; import org.onap.portal.domain.db.fn.FnLanguage; import org.onap.portal.domain.db.fn.FnUser; -import org.onap.portal.service.fn.FnLanguageService; -import org.onap.portal.service.fn.FnUserService; +import org.onap.portal.service.language.FnLanguageService; +import org.onap.portal.service.microserviceParameter.EpMicroserviceParameterService; +import org.onap.portal.service.user.FnUserService; +import org.onap.portal.service.widgetCatalog.EpWidgetCatalogService; +import org.onap.portal.service.widgetCatalogParameter.EpWidgetCatalogParameterService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -77,7 +78,7 @@ class EpWidgetCatalogParameterServiceTest { private final FnUserService fnUserService; private final EpMicroserviceParameterService epMicroserviceParameterService; private final EpWidgetCatalogService epWidgetCatalogService; - private final FnLanguageDao fnLanguageDao; + private final FnLanguageService fnLanguageService; @Autowired public EpWidgetCatalogParameterServiceTest( @@ -85,13 +86,13 @@ class EpWidgetCatalogParameterServiceTest { WidgetsCatalogController widgetsCatalogController, FnUserService fnUserService, EpMicroserviceParameterService epMicroserviceParameterService, - EpWidgetCatalogService epWidgetCatalogService, FnLanguageDao fnLanguageDao) { + EpWidgetCatalogService epWidgetCatalogService, FnLanguageService fnLanguageService) { this.epWidgetCatalogParameterService = epWidgetCatalogParameterService; this.widgetsCatalogController = widgetsCatalogController; this.fnUserService = fnUserService; this.epMicroserviceParameterService = epMicroserviceParameterService; this.epWidgetCatalogService = epWidgetCatalogService; - this.fnLanguageDao = fnLanguageDao; + this.fnLanguageService = fnLanguageService; } @Test @@ -154,7 +155,7 @@ class EpWidgetCatalogParameterServiceTest { } private FnUser buildFnUser() { - FnLanguage language = fnLanguageDao.getByLanguageAlias("EN"); + FnLanguage language = fnLanguageService.getByLanguageAlias("EN"); return FnUser.builder() .lastLoginDate(LocalDateTime.now()) .activeYn(true) diff --git a/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserRoleServiceTest.java b/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserRoleServiceTest.java index fbb09e15..68b1a80b 100644 --- a/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserRoleServiceTest.java +++ b/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserRoleServiceTest.java @@ -49,6 +49,8 @@ import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.onap.portal.domain.db.fn.FnUser; import org.onap.portal.domain.dto.ecomp.EPUserAppCatalogRoles; +import org.onap.portal.service.user.FnUserService; +import org.onap.portal.service.userRole.FnUserRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.TestPropertySource; diff --git a/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserServiceTest.java b/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserServiceTest.java index 56cbe815..49c018e7 100644 --- a/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserServiceTest.java +++ b/portal-BE/src/test/java/org/onap/portal/service/fn/FnUserServiceTest.java @@ -48,10 +48,12 @@ import java.util.Arrays; import java.util.List; import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; -import org.onap.portal.dao.fn.FnLanguageDao; +import org.onap.portal.service.language.FnLanguageService; import org.onap.portal.domain.db.fn.FnLanguage; import org.onap.portal.domain.db.fn.FnLuTimezone; import org.onap.portal.domain.db.fn.FnUser; +import org.onap.portal.service.luTimezone.FnLuTimezoneService; +import org.onap.portal.service.user.FnUserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -71,8 +73,6 @@ class FnUserServiceTest { private FnLuTimezoneService fnLuTimezoneService; @Autowired private FnLanguageService fnLanguageService; - @Autowired - private FnLanguageDao fnLanguageDao; @Test void saveUser(){ @@ -96,7 +96,7 @@ class FnUserServiceTest { expected.setCountryCd("US"); expected.setLanguageId(fnLanguageService.findById(1L).orElse(new FnLanguage())); expected.setGuest(false); - FnLanguage language = fnLanguageDao.getByLanguageAlias("EN"); + FnLanguage language = fnLanguageService.getByLanguageAlias("EN"); expected.setLanguageId(language); //When diff --git a/portal-FE-common/.gitignore b/portal-FE-common/.gitignore new file mode 100644 index 00000000..72d97b7a --- /dev/null +++ b/portal-FE-common/.gitignore @@ -0,0 +1,4 @@ +/target/ +/.classpath +/.settings +/.history \ No newline at end of file diff --git a/portal-FE-common/pom.xml b/portal-FE-common/pom.xml new file mode 100644 index 00000000..79aad950 --- /dev/null +++ b/portal-FE-common/pom.xml @@ -0,0 +1,7 @@ + + 4.0.0 + org.onap.portal + portal-FE-common + 0 + + diff --git a/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.html b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.html new file mode 100644 index 00000000..64b6bbd7 --- /dev/null +++ b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.html @@ -0,0 +1,52 @@ + + +
+ + + +
\ No newline at end of file diff --git a/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.scss b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.scss new file mode 100644 index 00000000..3c1a547b --- /dev/null +++ b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.scss @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +@import '../../pages/pages.component'; \ No newline at end of file diff --git a/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.spec.ts b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.spec.ts new file mode 100644 index 00000000..bc3516e8 --- /dev/null +++ b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConfirmationModalComponent } from './confirmation-modal.component'; + +describe('ConfirmationModalComponent', () => { + let component: ConfirmationModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ConfirmationModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ConfirmationModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.ts b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.ts new file mode 100644 index 00000000..774cff23 --- /dev/null +++ b/portal-FE-common/src/app/modals/confirmation-modal/confirmation-modal.component.ts @@ -0,0 +1,55 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit, Input } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'app-confirmation-modal', + templateUrl: './confirmation-modal.component.html', + styleUrls: ['./confirmation-modal.component.scss'] +}) +export class ConfirmationModalComponent implements OnInit { + + @Input() title: string; + @Input() message: string; + constructor(public activeModal: NgbActiveModal) { } + + ngOnInit() { + } + +} \ No newline at end of file diff --git a/portal-FE-common/src/app/modals/information-modal/information-modal.component.html b/portal-FE-common/src/app/modals/information-modal/information-modal.component.html new file mode 100644 index 00000000..77312cf2 --- /dev/null +++ b/portal-FE-common/src/app/modals/information-modal/information-modal.component.html @@ -0,0 +1,52 @@ + +
+ + + +
\ No newline at end of file diff --git a/portal-FE-common/src/app/modals/information-modal/information-modal.component.scss b/portal-FE-common/src/app/modals/information-modal/information-modal.component.scss new file mode 100644 index 00000000..3c1a547b --- /dev/null +++ b/portal-FE-common/src/app/modals/information-modal/information-modal.component.scss @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +@import '../../pages/pages.component'; \ No newline at end of file diff --git a/portal-FE-common/src/app/modals/information-modal/information-modal.component.spec.ts b/portal-FE-common/src/app/modals/information-modal/information-modal.component.spec.ts new file mode 100644 index 00000000..fa3596fe --- /dev/null +++ b/portal-FE-common/src/app/modals/information-modal/information-modal.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InformationModalComponent } from './information-modal.component'; + +describe('InformationModalComponent', () => { + let component: InformationModalComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ InformationModalComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(InformationModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/modals/information-modal/information-modal.component.ts b/portal-FE-common/src/app/modals/information-modal/information-modal.component.ts new file mode 100644 index 00000000..54e120dc --- /dev/null +++ b/portal-FE-common/src/app/modals/information-modal/information-modal.component.ts @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit, Input } from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'app-information-modal', + templateUrl: './information-modal.component.html', + styleUrls: ['./information-modal.component.scss'] +}) +export class InformationModalComponent implements OnInit { + + @Input() title: string; + @Input() message: string; + + constructor(public activeModal: NgbActiveModal) { } + + ngOnInit() { + } + +} \ No newline at end of file diff --git a/portal-FE-common/src/app/ng-material-module.ts b/portal-FE-common/src/app/ng-material-module.ts new file mode 100644 index 00000000..0385598f --- /dev/null +++ b/portal-FE-common/src/app/ng-material-module.ts @@ -0,0 +1,96 @@ +/** Copyright 2019 Google Inc. All Rights Reserved. + Use of this source code is governed by an MIT-style license that + can be found in the LICENSE file at http://angular.io/license */ +import {NgModule} from '@angular/core'; +import {A11yModule} from '@angular/cdk/a11y'; +import {DragDropModule} from '@angular/cdk/drag-drop'; +import {PortalModule} from '@angular/cdk/portal'; +import {ScrollingModule} from '@angular/cdk/scrolling'; +import {CdkStepperModule} from '@angular/cdk/stepper'; +import {CdkTableModule} from '@angular/cdk/table'; +import {CdkTreeModule} from '@angular/cdk/tree'; +import {MatAutocompleteModule} from '@angular/material/autocomplete'; +import {MatBadgeModule} from '@angular/material/badge'; +import {MatBottomSheetModule} from '@angular/material/bottom-sheet'; +import {MatButtonModule} from '@angular/material/button'; +import {MatButtonToggleModule} from '@angular/material/button-toggle'; +import {MatCardModule} from '@angular/material/card'; +import {MatCheckboxModule} from '@angular/material/checkbox'; +import {MatChipsModule} from '@angular/material/chips'; +import {MatStepperModule} from '@angular/material/stepper'; +import {MatDatepickerModule} from '@angular/material/datepicker'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatDividerModule} from '@angular/material/divider'; +import {MatExpansionModule} from '@angular/material/expansion'; +import {MatFormFieldModule} from '@angular/material'; +import {MatGridListModule} from '@angular/material/grid-list'; +import {MatIconModule} from '@angular/material/icon'; +import {MatInputModule} from '@angular/material/input'; +import {MatListModule} from '@angular/material/list'; +import {MatMenuModule} from '@angular/material/menu'; +import {MatNativeDateModule, MatRippleModule} from '@angular/material/core'; +import {MatPaginatorModule} from '@angular/material/paginator'; +import {MatProgressBarModule} from '@angular/material/progress-bar'; +import {MatProgressSpinnerModule} from '@angular/material/progress-spinner'; +import {MatRadioModule} from '@angular/material/radio'; +import {MatSelectModule} from '@angular/material/select'; +import {MatSidenavModule} from '@angular/material/sidenav'; +import {MatSliderModule} from '@angular/material/slider'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import {MatSnackBarModule} from '@angular/material/snack-bar'; +import {MatSortModule} from '@angular/material/sort'; +import {MatTableModule} from '@angular/material/table'; +import {MatTabsModule} from '@angular/material/tabs'; +import {MatToolbarModule} from '@angular/material/toolbar'; +import {MatTooltipModule} from '@angular/material/tooltip'; +import {MatTreeModule} from '@angular/material/tree'; + + +@NgModule({ + exports: [ + A11yModule, + CdkStepperModule, + CdkTableModule, + CdkTreeModule, + DragDropModule, + MatAutocompleteModule, + MatBadgeModule, + MatBottomSheetModule, + MatButtonModule, + MatButtonToggleModule, + MatCardModule, + MatCheckboxModule, + MatChipsModule, + MatStepperModule, + MatDatepickerModule, + MatDialogModule, + MatDividerModule, + MatExpansionModule, + MatFormFieldModule, + MatGridListModule, + MatIconModule, + MatInputModule, + MatListModule, + MatMenuModule, + MatNativeDateModule, + MatPaginatorModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatRadioModule, + MatRippleModule, + MatSelectModule, + MatSidenavModule, + MatSliderModule, + MatSlideToggleModule, + MatSnackBarModule, + MatSortModule, + MatTableModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule, + MatTreeModule, + PortalModule, + ScrollingModule, + ] +}) +export class NgMaterialModule {} \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.html b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.html new file mode 100644 index 00000000..31f28615 --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.html @@ -0,0 +1,132 @@ + + +
+ + + + + + + +
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.scss b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.scss new file mode 100644 index 00000000..4a490b1c --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.scss @@ -0,0 +1,77 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +.account-properties-main { + padding-left: 20px; + padding-right: 20px; + margin-bottom: 50px; + height: 320px; + width: 100%; + overflow-x: auto; +} + +.required:before { + color: #cf2a2a; + margin-right: 2px; + content: "* "; + position: absolute; + top: 45px; + left: 28px; +} + +.account-properties-main input[type="text"] { + width: 20em; + margin-bottom: 10px; +} + +.account-properties-main input[type="password"] { + width: 20em; + margin-bottom: 10px; +} + +.add-endpoint-item .add-label-right{ + margin-left: 13em; +} + +.add-endpoint-item{ + display: inline-flex; +} + +.account-property{ + margin-top: 8px; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts new file mode 100644 index 00000000..fd568194 --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccountAddDetailsComponent } from './account-add-details.component'; + +describe('AccountAddDetailsComponent', () => { + let component: AccountAddDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AccountAddDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountAddDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.ts b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.ts new file mode 100644 index 00000000..e2c408a1 --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-add-details/account-add-details.component.ts @@ -0,0 +1,159 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { BasicAuthAccountService } from 'src/app/shared/services'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; + +@Component({ + selector: 'app-account-add-details', + templateUrl: './account-add-details.component.html', + styleUrls: ['./account-add-details.component.scss'] +}) +export class AccountAddDetailsComponent implements OnInit { + + result: any; + isEditMode: boolean = false; + dupliateName: boolean = false; + emptyAccountName: boolean = false; + emptyAccountUsername: boolean = false; + passwordMatched: boolean = false; + + @Input() accountOnboarding: any; + @Output() passEntry: EventEmitter = new EventEmitter(); + + constructor(public basicAuthAccountService: BasicAuthAccountService, public activeModal: NgbActiveModal, public ngbModal: NgbModal) { } + + ngOnInit() { + this.passwordMatched = true; + this.dupliateName = false; + this.emptyAccountName = false; + this.emptyAccountUsername = false; + + if(this.accountOnboarding.applicationName){ + this.isEditMode = true; + }else{ + this.isEditMode = false; + this.accountOnboarding.isActive = true; + this.accountOnboarding.endpointList = []; + } + //console.log("IsEditMode in Add account Dialog :: ",this.isEditMode) + + } + + addEndpoint(){ + const modalRef = this.ngbModal.open(ConfirmationModalComponent); + modalRef.componentInstance.title = ""; + modalRef.componentInstance.message = 'Please add the roles to this Username/MechId through AAF Screen'; + modalRef.result.then((result) => { }, (resut) => {return;}); + + /*this.accountOnboarding.endpointList.push({ + valid: true + });*/ + } + + //Add Or Update Account. + saveChanges(){ + var isValid = true; + //console.log("saveChanges called Account Onboarding"); + + if(this.accountOnboarding.applicationName == '' + || this.accountOnboarding.applicationName == undefined){ + this.emptyAccountName = true; + isValid = false; + } + + if(this.accountOnboarding.username == '' + || this.accountOnboarding.username == undefined){ + this.emptyAccountUsername = true; + isValid = false; + } + + if(this.dupliateName == true){ + isValid = false; + } + + if(this.dupliateName == true){ + isValid = false; + } + + if(this.accountOnboarding.password != this.accountOnboarding.repassword){ + this.passwordMatched = false; + isValid = false; + } + //console.log("isValid....",isValid) + if(!isValid) + return; + + var active = 'N'; + if(this.accountOnboarding.isActive == true) + active = 'Y'; + + var newAccount = { + applicationName: this.accountOnboarding.applicationName, + username: this.accountOnboarding.username, + password: this.accountOnboarding.password, + endpoints: this.accountOnboarding.endpoints, + isActive: active + }; + + if(this.isEditMode){ + var message = "Are you sure you want to change '" + this.accountOnboarding.applicationName + "'?" + this.basicAuthAccountService.updateAccount(this.accountOnboarding.id, newAccount) + .subscribe( _data => { + this.result = _data; + //console.log("updateAccount response :: ",this.result); + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }, error => { + console.log(error); + }); + }else{ + this.basicAuthAccountService.createAccount(newAccount) + .subscribe( _data => { + this.result = _data; + //console.log("createAccount response :: ",this.result); + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }, error => { + console.log(error); + }); + } + } +} diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.html b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.html new file mode 100644 index 00000000..31f631eb --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.html @@ -0,0 +1,78 @@ + + +
+
+

App Account Management

+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Account Name {{element.applicationName}} + Username {{element.username}} Delete + + + +
+ +
+
diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.scss b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.scss new file mode 100644 index 00000000..05d0cd22 --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.scss @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + + .container th{ + padding-bottom: 15px; + font-weight: bold; +} + +.ion-md-trash{ + cursor: pointer; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts new file mode 100644 index 00000000..8e6e79ea --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AccountOnboardingComponent } from './account-onboarding.component'; + +describe('AccountOnboardingComponent', () => { + let component: AccountOnboardingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ AccountOnboardingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(AccountOnboardingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.ts b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.ts new file mode 100644 index 00000000..9ed4f9da --- /dev/null +++ b/portal-FE-common/src/app/pages/account-onboarding/account-onboarding.component.ts @@ -0,0 +1,153 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, ViewChild, Input} from '@angular/core'; +import { MatTableDataSource } from '@angular/material'; +import { MatSort, MatPaginator } from '@angular/material'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { BasicAuthAccountService } from '../../shared/services/index'; +import { IAccountOnboarding } from 'src/app/shared/model/account-onboarding/accountOnboarding'; +import { AccountAddDetailsComponent } from './account-add-details/account-add-details.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; + +@Component({ + selector: 'app-account-onboarding', + templateUrl: './account-onboarding.component.html', + styleUrls: ['./account-onboarding.component.scss'] +}) +export class AccountOnboardingComponent implements OnInit { + + accountList: Array = []; + result: any; + isEditMode: boolean = false; + displayedColumns: string[] = ['accountName', 'userName','delete']; + dataSource = new MatTableDataSource(this.accountList); + @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + + constructor(public basicAuthAccountService: BasicAuthAccountService, public ngbModal: NgbModal) { } + + ngOnInit() { + this.getOnboardingAccounts(); + } + + populateTableData(wigetList: Array){ + this.dataSource = new MatTableDataSource(wigetList); + this.dataSource.sort = this.sort; + this.dataSource.paginator = this.paginator; + }; + + getOnboardingAccounts(){ + //console.log("getOnboardingAccounts called"); + this.basicAuthAccountService.getAccountList() + .subscribe(_data => { + this.result = _data; + //console.log("getOnboardingAccounts Data :: ", _data); + if (this.result == null || this.result == 'undefined') { + //console.log('BasicAuthAccountService::getOnboardingAccounts Failed: Result or result.data is null'); + }else { + this.accountList = this.result.response; + this.populateTableData(this.accountList); + } + }, error =>{ + console.log(error); + }); + + }; + + openAddNewAccountModal(rowData: any){ + //console.log("openAddNewAccountModal getting called..."); + const modalRef = this.ngbModal.open(AccountAddDetailsComponent, { size: 'lg' }); + modalRef.componentInstance.title = 'Account Details'; + if(rowData != 'undefined' && rowData){ + rowData.repassword = rowData.password; + modalRef.componentInstance.accountOnboarding = rowData; + this.isEditMode = true; + }else{ + modalRef.componentInstance.accountOnboarding = {}; + this.isEditMode = false; + } + modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + //console.log("receivedEntry >>> ",receivedEntry); + if(receivedEntry){ + this.accountList = []; + this.getOnboardingAccounts(); + } + }); + } + + deleteAccount(selectedAccount : any){ + let confirmationMsg = 'You are about to delete this account : ' + selectedAccount.applicationName + '. Click OK to continue.'; + this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => { + if (result === 'Ok') { + //console.log("deleteAccount called Account Onboarding"); + if(!selectedAccount || selectedAccount == null || selectedAccount =='undefined'){ + console.log('AccountOnboardingCtrl::deleteAccount: No Account or ID... cannot delete'); + return; + } + //console.log("deleteAccount>>id",selectedAccount.id) + this.basicAuthAccountService.deleteAccount(selectedAccount.id) + .subscribe( _data => { + this.result = _data; + //console.log("deleteAccount response :: ",this.result); + this.accountList.splice(this.accountList.indexOf(selectedAccount), 1); + this.getOnboardingAccounts(); + }, error => { + console.log(error); + }); + } + }, (resut) => { + return; + }) + } + + openConfirmationModal(_title: string, _message: string) { + const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + } + + openInformationModal(_title: string, _message: string){ + const modalInfoRef = this.ngbModal.open(InformationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + return modalInfoRef; + } + +} diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.html b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.html new file mode 100644 index 00000000..af54d276 --- /dev/null +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.html @@ -0,0 +1,143 @@ + +
+
+
+

{{'Application Catalog'}}

+
+
+
+
+ Click the check + boxes below to choose which applications are shown on the home + page. +

+
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+ + + +
+ +
+
+ + drag_handle +

{{ item.name | elipsis: 13}}

+ + + + + +
+
+
+ +
+
+
+ + + +
+
+
+ +
+ +
+ To request access to an application widget, please visit the Get Access page. +
+
+
+
+ +
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.scss b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.scss new file mode 100644 index 00000000..29198a52 --- /dev/null +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.scss @@ -0,0 +1,174 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + + + + :host { .toolbar { + height: 100px; + display: flex; +} gridster { + display: flex; + height: calc(100vh - 115px); + flex-direction: column; +}} +.icon-content-gridguide{ + cursor:move; + font-size: 14px; + } + .form-row { + margin-top: -14px; +} +.griditem-header{ + + + border-bottom: 1px; + border-bottom-color: solid gray; + + + +} + +.checkbox, .radio { +min-height: 10px; +padding-left: 0px; +} + +.simulateCatGridHeader{ + position: relative; + height: 70px !important; + border: 1px solid #d3d3d3; + border-bottom: 0; + background-color: #E5E5E5; + white-space: nowrap; + text-overflow: ellipsis; + z-index: 1; +} + +.simulateCatGridHeaderTitle{ + line-height: 20px; + margin-top: 10px; + margin-left: 26px; + font-family: "Omnes-ECOMP-W02", Arial; + font-size: 18px; + color: #444444; + float: left; +} + +.simulateCatGridHeaderRadio{ + line-height: 20px; + margin-top: 10px; + margin-left: 10px; + font-family: "Omnes-ECOMP-W02", Arial; + font-size: 12px; + color: #444444; + float: left; +} + +.simulateCatGridHeaderDetails{ + line-height: 20px; + margin-left: 10px; + font-family: "Omnes-ECOMP-W02", Arial; + font-size: 12px; + color: #444444; + float: left; +} + +.simulateGridHeaderHandle{ + cursor: move; + margin: 12px; + position: absolute; + top: 0; + left: 0; + border: 0; + vertical-align: middle; + -ms-interpolation-mode: bicubic; + display: block; +} + +.catalog-radio-div{ + display:inline-block; + margin-right:5px; +} + +.appCatalogue-boarder{ + background-color: #eee; + border: 1px dashed white; + + overflow-y: auto; + overflow-x: hidden; + } + + .gridster-box { + height: 100%; + border: 1px solid #ccc; + background-color: #fff; + transition: transform 0.5s ease-out; +} +.gridster-box-header { + background-color: #fff; + padding: 0 0px 0 10px; + border-bottom: 1px solid #ccc; + position: relative; + height: 50px !important; +} +.gridster-box-header h3 { + margin-top: 15px; + display: inline-block; + font-size: 70%; + font-family: "Omnes-ECOMP-W02", Arial; +} +.gridster-box-content { + padding: 59px; +} +.gridster-box:hover{ + transform: scale(1.1); +} +.gridster-box-header-btns { + top: 15px; + right: 10px; + position: absolute; +} +.checkbox input{ + margin: 6px; + left: 112px; + top: -20px; + } +.checkbox .skin { + left: 125px; + top: -18px; +} diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts new file mode 100644 index 00000000..1967d254 --- /dev/null +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ApplicationCatalogComponent } from './application-catalog.component'; + +describe('ApplicationCatalogComponent', () => { + let component: ApplicationCatalogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ApplicationCatalogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ApplicationCatalogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts new file mode 100644 index 00000000..f571dcaa --- /dev/null +++ b/portal-FE-common/src/app/pages/application-catalog/application-catalog.component.ts @@ -0,0 +1,179 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit } from '@angular/core'; +import { GridsterConfig, GridsterItem } from 'angular-gridster2'; +import { ApplicationCatalogService } from '../../shared/services/application-catalog/application-catalog.service'; +import { IApplicationCatalog } from '../../shared/model/application-catalog.model'; +import { IWidgetCatalog } from '../../shared/model/widget-catalog.model'; +import { environment } from 'src/environments/environment'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { CatalogModalComponent } from '../catalog-modal/catalog-modal.component'; +import { ExternalRequestAccessService } from 'src/app/shared/services/external-request-access-service/external-request-access.service'; +import { UsersService } from 'src/app/shared/services/users/users.service'; + +@Component({ + selector: 'app-application-catalog', + templateUrl: './application-catalog.component.html', + styleUrls: ['./application-catalog.component.scss'] +}) +export class ApplicationCatalogComponent implements OnInit { + widgetCatalogData: IWidgetCatalog[]; + appCatalogData: IApplicationCatalog[]; + resultAccessValue: string; + orgUserId: string; + firstName: string; + lastName: string; + radioValue: any; + isUserSuperAdmin: boolean; + + get options(): GridsterConfig { + return this.applicationCatalogService.options; + } get layout(): GridsterItem[] { + return this.applicationCatalogService.layout; + } constructor(private applicationCatalogService: ApplicationCatalogService, private externalRequestAccessService: ExternalRequestAccessService, private userService: UsersService, private modal: NgbModal) { } + + ngOnInit() { + this.applicationCatalogService.clearCatalog(); + this.radioValue = 'All'; + this.callAppCatalogExecutor(); + } + + callAppCatalogExecutor() { + //Check whether Admin is Super Admin + this.checkAdminIsSuperAdmin(); + //To fetch ML value + this.getExternalAccess(); + + //Call user profile service + this.getUserProfile(); + + //Call Application Catalog services + this.getAppCatalogService(); + } + + checkAdminIsSuperAdmin() { + this.applicationCatalogService.checkIfUserIsSuperAdmin().subscribe(data => { + this.isUserSuperAdmin = data; + }, error => { + console.log('checkAdminIsSuperAdmin Error Object' + error); + }); + } + + getAppCatalogService() { + //console.log("getAppCatalogServices called"); + this.applicationCatalogService.getAppCatalog().subscribe(data => { + //console.log("Response data" + data); + this.appCatalogData = data; + for (let entry of this.appCatalogData) { + //console.log("Check the URL" + environment.api.appThumbnail); + var appCatalog = { + x: -1, + y: -1, + id: entry.id, + name: entry.name, + mlAppName: entry.mlAppName, + imageLink: environment.api.appThumbnail.replace(':appId', entry.id), + restricted: entry.restricted, + select: entry.select, + access: entry.access, + pending: entry.pending, + mlproperty: this.resultAccessValue + }; + this.applicationCatalogService.addItem(appCatalog); + } + }, error => { + console.log('getAppCatalogServices Error Object' + error); + }); + }; + + storeSelection(appCatalogData: any) { + //console.log("Store selection called " + appCatalogData.name); + var pendingFlag: boolean = false; + if (appCatalogData.access) + pendingFlag = false; + else + pendingFlag = appCatalogData.pending; + + var appData = { + appId: appCatalogData.id, + select: appCatalogData.select, + pending: pendingFlag + }; + this.applicationCatalogService.updateManualAppSort(appData).subscribe(data => { + //console.log("Update App sort data" + data); + }, error => { + console.log('Update App sort error' + error); + }); + + this.applicationCatalogService.updateAppCatalog(appData).subscribe(data => { + //console.log("Update App Catalog data" + data); + }, error => { + console.log('Update App Catalog error' + error); + }); + }; + openAddRoleModal(item: any) { + //console.log("OpenModal check" + item.id); + if ((!item.restricted) && (item.mlproperty)) { + this.modal.open(CatalogModalComponent); + } + } + + getExternalAccess() { + //console.log("getExternalAccess service called"); + this.externalRequestAccessService.getExternalRequestAccessServiceInfo().subscribe(data => { + //console.log("Response data" + data); + if (data) + this.resultAccessValue = data.accessValue; + }, error => { + console.log('getExternalAccess Error object' + error); + }); + } + + getUserProfile() { + const userProfileObservable = this.userService.getUserProfile(); + userProfileObservable.subscribe((userProfile: any) => { + //console.log('UserProfile is ' + userProfile); + if (userProfile) { + this.orgUserId = userProfile.orgUserId; + this.firstName = userProfile.firstName; + this.lastName = userProfile.lastName; + } + }); + + } +} diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.html b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.html new file mode 100644 index 00000000..0d710f98 --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.html @@ -0,0 +1,156 @@ + +
+ + + + + + + +
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.scss b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.scss new file mode 100644 index 00000000..bff240e2 --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.scss @@ -0,0 +1,79 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + ::ng-deep .modal-dialog { + max-width: 1200px; + width: 1200px; + overflow-x: auto; + overflow-y: auto; +} + +.addApplicationContactInfo{ + display: inline-flex; +} + +.addApplicationContactInfo input[type="text"] { + width: 22em; + margin-right: 8px; +} + +.property-label-desc-txtarea { + overflow: auto; + resize: vertical; + width: 67em; +} + +.divider-line{ + border-bottom-style: solid; + border-bottom-width: 1px; + padding-bottom: 50px; +} + +.edit-contactus-title { + margin-top: 28px; + margin-bottom: 1rem; + font-size: 23px; +} + +.required:before { + color: #cf2a2a; + margin-right: 2px; + content: "* "; + position: absolute; + top: 45px; + left: 28px; +} diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts new file mode 100644 index 00000000..06b6995a --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ContactUsManageComponent } from './contact-us-manage.component'; + +describe('ContactUsManageComponent', () => { + let component: ContactUsManageComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ContactUsManageComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContactUsManageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.ts b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.ts new file mode 100644 index 00000000..e04ccb77 --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us-manage/contact-us-manage.component.ts @@ -0,0 +1,182 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, Input} from '@angular/core'; +import { ContactUsService } from '../../../shared/services/index'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'app-contact-us-manage', + templateUrl: './contact-us-manage.component.html', + styleUrls: ['./contact-us-manage.component.scss'] +}) +export class ContactUsManageComponent implements OnInit { + + contactUsList = []; + contactUsAllAppList = []; + result: any; + selectedApp: any; + showEdit: boolean = false; + newContactUs ={ + appId:'', + appName:'', + description:'', + contactName:'', + contactEmail:'', + url:'' , + activeYN:'' + }; + + + constructor(public activeModal: NgbActiveModal, public ngbModal: NgbModal, public contactUsService: ContactUsService) { } + + ngOnInit() { + + this.getContactUsList(); + this.getListOfApp(); + } + + getContactUsList(){ + console.log("getContactUsList called..."); + this.contactUsService.getContactUs() + .subscribe( _data => { + this.result = _data; + console.log("getContactUsList Data :: ", _data); + if (this.result.response == null || this.result.response == 'undefined') { + console.log('ContactUsService::getContactUsList Failed: Result or result.data is null'); + }else{ + for(var i=0; i{ + console.log(error); + }); + } + + getListOfApp(){ + console.log("getListOfApp called..."); + this.contactUsService.getListOfApp() + .subscribe( _data => { + this.result = _data; + console.log("getListOfApp Data :: ", _data); + if (this.result == null || this.result == 'undefined') { + console.log('ContactUsService::getListOfApp Failed: Result or result.data is null'); + }else{ + let res1 = this.result; + let realAppIndex = 0; + this.contactUsAllAppList.length=0; + console.log("this.contactUsList ",this.contactUsList) + for (var i = 1; i <= res1.length; i++) { + if (!res1[i - 1].restrictedApp) { + var okToAdd = true; + for(var j =0; j{ + console.log(error); + }); + } + + addNewContactUs(){ + console.log("Calling addNewContactUs"); + let selectedApplication = this.selectedApp; + this.newContactUs.appId = selectedApplication.value; + this.newContactUs.appName = selectedApplication.title; + console.log("newContactUsObj ",this.newContactUs); + this.contactUsService.addContactUs(this.newContactUs) + .subscribe( _data => { + this.result = _data; + console.log("addContactUs response :: ", _data); + this.contactUsList.push(this.newContactUs); + },error =>{ + console.log(error); + }); + } + + editContactUs(contactObj: any){ + + var contactUsObj={ + appId:contactObj.appId, + appName:contactObj.appName, + description:contactObj.description, + contactName:contactObj.contactName, + contactEmail:contactObj.contactEmail, + url:contactObj.url, + }; + + this.contactUsService.modifyContactUs(contactUsObj) + .subscribe( _data => { + this.result = _data; + console.log("editContactUsFun response :: ", _data); + this.showEdit=false; + },error =>{ + console.log(error); + }); + } + + delContactUs(appObj: any){ + this.contactUsService.removeContactUs(appObj.appId) + .subscribe( _data => { + this.result = _data; + console.log("delContactUsFun response :: ", _data); + this.contactUsList.splice(appObj, 1); + },error =>{ + console.log(error); + }); + } + +} diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us.component.html b/portal-FE-common/src/app/pages/contact-us/contact-us.component.html new file mode 100644 index 00000000..5930c382 --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us.component.html @@ -0,0 +1,163 @@ + +
+
+

Contact Us

+
+ +
+
+
+
+ + To report an issue with ECOMP Portal, open a ticket at the + User Self Help system. +
+
+ +
+ + To give feedback to the ECOMP Portal team, send email to + {{portalInfo_Address}}. +
+
+ +
+ + To learn more about ECOMP Portal, visit the + ECOMP Portal wiki (may need to request access). +
+
+ + +
Application Functions +
+
+ + + + + + + + + + + + + + + + + + + + + +
Category {{element.category}} + ECOMP Functions {{element.functions}} ECOMP Applications + + {{element.app_Name}} + +
+
+

+ + +
+
All Applications

+
+
+
+
+
+ {{rowData.app_name}} +    + + +    + + + + + +
+
+
+ + No application information is available. Please use the links above to contact the ECOMP Portal team. + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Contact:{{rowData.contact_name}}
Email:{{rowData.contact_email}}
Info URL:{{rowData.url_Info}}
Description:{{rowData.desc}}
Get access:Click for application and role information
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us.component.scss b/portal-FE-common/src/app/pages/contact-us/contact-us.component.scss new file mode 100644 index 00000000..b3fb8d6a --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us.component.scss @@ -0,0 +1,74 @@ + +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +.w-ecomp-contactUs-home .contactUs-txt { + font-weight: 400; + color: #666; + font-size: 15px; + font-family: Omnes-ECOMP-W02-Medium,Arial; + margin: 10px; +} + +.w-ecomp-contactUs-home .contactUs-home-container .contactUs-general-div { + margin: auto!important; + padding-top: 15px; + padding-bottom: 15px; + margin-top: 0; + margin-right: 0; + margin-left: 0; + margin-bottom: 0; + width: 1170px; +} + +.w-ecomp-contactUs-home .w-ecomp-main-view-title { + font-family: Omnes-ECOMP-W02,Arial; + font-size: 20px; +} + +button#edit-button-contact-us { + float: right; +} + +.container th{ + padding-bottom: 15px; + font-weight: bold; +} + +.w-ecomp-contactUs-home .contactUs-collapsible-panel { + margin: auto; +} diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts b/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts new file mode 100644 index 00000000..db77e078 --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ContactUsComponent } from './contact-us.component'; + +describe('ContactUsComponent', () => { + let component: ContactUsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ContactUsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContactUsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/contact-us/contact-us.component.ts b/portal-FE-common/src/app/pages/contact-us/contact-us.component.ts new file mode 100644 index 00000000..d58733bd --- /dev/null +++ b/portal-FE-common/src/app/pages/contact-us/contact-us.component.ts @@ -0,0 +1,196 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, ViewChild, Input } from '@angular/core'; +import { MatTableDataSource } from '@angular/material'; +import { MatSort, MatPaginator } from '@angular/material'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { ContactUsService } from '../../shared/services/index'; +import { ContactUsManageComponent } from './contact-us-manage/contact-us-manage.component'; + +@Component({ + selector: 'app-contact-us', + templateUrl: './contact-us.component.html', + styleUrls: ['./contact-us.component.scss'] +}) +export class ContactUsComponent implements OnInit { + + contactUsList: Array = []; + appTable: Array = []; + functionalTableData: Array = []; + + ush_TicketInfoUrl: string; + portalInfo_Address: string; + feedback_Url: string; + showUp: boolean = true; + showDown: boolean = false; + + result: any; + isEditMode: boolean = false; + displayedColumns: string[] = ['category', 'eCOMPFunctions','eCOMPApplications']; + dataSource = new MatTableDataSource(this.functionalTableData); + @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + + constructor(public contactUsService: ContactUsService, public ngbModal: NgbModal) { } + + ngOnInit() { + this.appTable=[]; + this.functionalTableData=[]; + + this.getContactUSPortalDetails(); + this.updateContactUsTable(); + this.getAppCategoryFunctions() + } + + getContactUSPortalDetails(){ + console.log("getContactUSPortalDetails called..."); + this.contactUsService.getContactUSPortalDetails() + .subscribe( _data => { + this.result = _data; + console.log("getContactUSPortalDetails Data :: ", _data); + if (this.result.response == null || this.result.response == 'undefined') { + console.log('ContactUsService::getContactUSPortalDetails Failed: Result or result.data is null'); + }else{ + var source = JSON.parse(this.result.response); + this.ush_TicketInfoUrl = source.ush_ticket_url; + this.portalInfo_Address = source.feedback_email_address; + this.feedback_Url = source.portal_info_url; + } + },error =>{ + console.log(error); + }); + } + + updateContactUsTable(){ + console.log("updateContactUsTable called..."); + this.contactUsService.getAppsAndContacts() + .subscribe( _data => { + this.result = _data; + console.log("getAppsAndContacts Data :: ", _data); + if (this.result.response == null || this.result.response == 'undefined') { + console.log('ContactUsService::getAppsAndContacts Failed: Result or result.data is null'); + }else{ + var tableData=[]; + var source = this.result.response; + for(var i=0; i{ + console.log(error); + }); + } + + getAppCategoryFunctions(){ + console.log("getAppCategoryFunctions called"); + this.contactUsService.getAppCategoryFunctions() + .subscribe( _data => { + this.result = _data; + console.log("getAppCategoryFunctions Data :: ", _data); + if (this.result.response == null || this.result.response == 'undefined') { + console.log('ContactUsService::getAppCategoryFunctions Failed: Result or result.data is null'); + }else{ + var tablefunctionalData=[]; + var source = this.result.response; + for(var i=0;i{ + console.log(error); + }); + } + + populateTableData(functionalTableData: Array){ + this.dataSource = new MatTableDataSource(functionalTableData); + this.dataSource.sort = this.sort; + this.dataSource.paginator = this.paginator; + } + + editContactUsModal() { + const modalRef = this.ngbModal.open(ContactUsManageComponent, { size: 'lg' }); + } + + showApplicationInfo(appId: any){ + console.log("AppId Contact US...",appId); + let appInfoDiv = document.getElementById('collapse'+appId); + let uparrowDiv = document.getElementById('arrowup'+appId); + let downarrowDiv = document.getElementById('arrowdown'+appId); + + if(!appInfoDiv.getAttribute('hidden')){ + appInfoDiv.setAttribute("hidden","true"); + uparrowDiv.setAttribute("hidden", "true"); + downarrowDiv.removeAttribute("hidden"); + }else if(appInfoDiv.getAttribute('hidden')){ + appInfoDiv.removeAttribute("hidden"); + uparrowDiv.removeAttribute("hidden"); + downarrowDiv.setAttribute("hidden","true"); + } + } + + goGetAccess(app_name: any){ + console.log("Get Access :: goGetAccess method implemetation is pending... appName : ",app_name); + } + +} diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.html b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.html new file mode 100644 index 00000000..4ec8ae3d --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.html @@ -0,0 +1,214 @@ + + +
+
+ + + + + + + + +
+
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.scss b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.scss new file mode 100644 index 00000000..1ea39095 --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.scss @@ -0,0 +1,211 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +::ng-deep .modal-dialog { + max-width: 600px; + width: 600px; + overflow-x: auto; + overflow-y: auto; +} + +::ng-deep .modal-body { + padding: -1rem; +} + +::ng-deep .mat-form-field-infix { + width: 400px; +} + +.microservice-add-details-model .microservice-properties-main { + padding-left: 20px; + padding-right: 20px; + margin-bottom: 50px; + height: 430px; + width: 100%; + overflow-x: auto; +} + +.microservice-add-details-model .microservice-properties-main .item { + position: relative; + margin-bottom: 15px; + width: 400px; +} + +.microservice-add-details-model .microservice-properties-main .item .error-container { + position: absolute; + width: 280px; + display: block; + height: 12px; + line-height: 12px; +} + +.microservice-add-details-model .microservice-properties-main .item .error-container .err-message { + color: #cf2a2a; + font-size: 10px; +} + +.microservice-add-details-model .microservice-properties-main .item .item-label { + color: #5a5a5a; + font-family: Omnes-ECOMP-W02,Arial; + font-size: 14px; +} + +.microservice-add-details-model .microservice-properties-main .item .left-test-item { + display: inline-block; + width: 85%; + background: #fff; +} + +.microservice-add-details-model .microservice-properties-main .item .right-test-item { + position: relative; + display: inline-block; + width: 15%; + float: right; +} + +.microservice-add-details-model .microservice-properties-main .item .test-button { + color: #fff; + font-family: Omnes-ECOMP-W02-Medium,Arial; + font-size: 14px; + border-style: solid; + border-width: 1px; + border-radius: 6px; + box-shadow: 0 1px 0.99px 0.01px rgba(2,60,89,.004); + height: 29px; + line-height: 29px; + cursor: pointer; + text-align: center; + background: #067ab4; +} + +.microservice-add-details-model .microservice-properties-main .item { + position: relative; + margin-bottom: 15px; + width: 400px; +} + +.microservice-add-details-model .microservice-properties-main .add-para-item { + position: relative; + display: inline-flex; +} + +.microservice-add-details-model .microservice-properties-main .add-para-item .add-label-left { + line-height: 25px; + height: 30px; + vertical-align: middle; + display: inline-block; + margin-right: 10px; + background: #fff; + color: #5a5a5a; + font-family: Omnes-ECOMP-W02,Arial; + font-size: 14px; +} + +.microservice-add-details-model .microservice-properties-main .microservice-property { + margin-top: 10px; + position: relative; +} + +.icon-primary-accordion-minus, .icon-primary-expanded, .icon-primary-accordion-plus, .icon-primary-collapsed { + font-size: 20px !important; +} + +#microservice-details-input-name{ + width: 16em; +} + +#widgets-details-input-desc{ + width: 25em; +} + +.microservice-desc { + overflow: auto; + resize: vertical; + width: 29em; +} + +.json-field { + overflow: auto; + resize: vertical; + width: 25em; +} + +#microservice-details-input-app{ + width: 25em; + height: 32px; +} + +#microservice-details-input-endpoint-url{ + width: 25em; +} + +#microservice-details-input-security-type{ + width: 25em; + height: 32px; +} + +.microservice-add-details-model .microservice-properties-main .item .para-label-item-right { + margin-left: 201px!important; + position: absolute!important; + margin-top: -19px!important; + width: 50%!important; +} + +.microservice-add-details-model .microservice-properties-main .item .para-item-right { + margin-top: -27px; + position: absolute; + margin-left: 500px; +} + +.table-search-field { + width: 48% !important; + margin-bottom: 5px; +} + +#microservice-details-user-paramters{ + display: inline-flex; +} + +.required:before { + color: #cf2a2a; + margin-right: 2px; + content: "* "; + position: absolute; + top: 28px; + left: -10px; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts new file mode 100644 index 00000000..5589854c --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MicroserviceAddDetailsComponent } from './microservice-add-details.component'; + +describe('MicroserviceAddDetailsComponent', () => { + let component: MicroserviceAddDetailsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MicroserviceAddDetailsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MicroserviceAddDetailsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.ts b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.ts new file mode 100644 index 00000000..5e359dd4 --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-add-details/microservice-add-details.component.ts @@ -0,0 +1,303 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { IMircroservies } from 'src/app/shared/model/microservice-onboarding/microservices'; +import { MicroserviceService, WidgetOnboardingService } from '../../../shared/services/index'; +import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'app-microservice-add-details', + templateUrl: './microservice-add-details.component.html', + styleUrls: ['./microservice-add-details.component.scss'] +}) +export class MicroserviceAddDetailsComponent implements OnInit { + + @Input() public ms: IMircroservies; + @Output() passEntry: EventEmitter = new EventEmitter(); + result: any; + selected: any; + isEditMode: any; + originalName: string; + dupliateName = false; + emptyServiceName = false; + emptyServiceDesc = false; + emptyServiceURL = false; + emptyServiceApp = false; + availableSecurityTypes = []; + availableWidgets = []; + applicationList: Array = []; + + constructor(public microservice: MicroserviceService, public widgetOnboardingService: WidgetOnboardingService, + public activeModal: NgbActiveModal, public ngbModal: NgbModal) { } + + ngOnInit() { + if(this.ms.name){ + this.isEditMode = true; + }else{ + this.isEditMode = false; + } + this.ms.parameterList = []; + this.ms.active = true; + this.populateAvailableApps(); + this.getAvailableSecurityTypes(); + } + + getAvailableWidgets(serviceId){ + console.log("getAvailableWidgets called"); + this.microservice.getWidgetListByService(serviceId) + .subscribe(data => { + this.result = data; + if (this.result == null || this.result) { + console.log('MicroserviceService::getServiceList Failed: Result or result.data is null'); + }else { + this.availableWidgets = []; + for(var i = 0; i < data.length; i++){ + this.availableWidgets.push({ + name: data[i] + }) + } + } + }, error =>{ + console.log(error); + }); + }; + + getAvailableSecurityTypes(): Array { + this.availableSecurityTypes = []; + this.availableSecurityTypes.push({ + id: 0, + name: 'No Authentication' + }); + this.availableSecurityTypes.push({ + id: 1, + name: 'Basic Authentication' + }); + this.availableSecurityTypes.push({ + id: 2, + name: 'Cookie based Authentication' + }); + + return this.availableSecurityTypes; + }; + + populateAvailableApps(){ + this.widgetOnboardingService.populateAvailableApps() + .subscribe( _data => { + let allPortalsFilterObject = {index: 0, title: 'Select Application', value: ''}; + this.applicationList = [allPortalsFilterObject]; + var realAppIndex = 1; + for (let i = 1; i <= _data.length; i++) { + if (!_data[i-1].restrictedApp) { + this.applicationList.push({ + index: realAppIndex, + title: _data[i - 1].name, + value: _data[i - 1].id + }) + realAppIndex = realAppIndex + 1; + } + } + }, error => { + console.log(error); + }); + }; + + addParameter() { + this.ms.parameterList.push({}); + } + + testServiceURL(){ + console.log("testServiceURL called id is :: ",this.ms.id) + this.microservice.getServiceJSON(this.ms.id) + .subscribe( _data => { + this.result = _data; + console.log("testServiceURL response :: ",this.result); + document.getElementById("microservice-details-input-json").innerHTML = (JSON.stringify(this.result)); + }, error => { + document.getElementById("microservice-details-input-json").innerHTML = "Something went wrong. Please go back to the previous page or try again later."; + console.log(error); + }); + } + + removeParamItem(parameter: any){ + console.log("removeParamItem called", parameter); + this.ms.parameterList.splice(parameter.para_key, 1); + this.microservice.getUserParameterById(parameter) + .subscribe(data => { + this.result = data; + if (this.result == null || this.result) { + console.log('MicroserviceService::removeParamItem Failed: Result or result.data is null'); + }else if(this.result && this.result.length > 0) { + this.microservice.deleteUserParameterById(parameter.id) + .subscribe(__data => { + for(var i = 0; i < this.ms.parameterList.length; i++){ + if(this.ms.parameterList[i].para_key == parameter.para_key + && this.ms.parameterList[i].para_value == parameter.para_value){ + this.ms.parameterList.splice(i, 1); + return; + } + } + + }, error =>{ + console.log(error); + }); + }else{ + for(var i = 0; i < this.ms.parameterList.length; i++){ + if(this.ms.parameterList[i].para_key == parameter.para_key + && this.ms.parameterList[i].para_value == parameter.para_value){ + this.ms.parameterList.splice(i, 1); + return; + } + } + } + }, error =>{ + console.log(error); + }); + } + + //Add Or Update Microservices. + saveChanges(){ + console.log("saveChanges..",this.ms); + if(this.ms && this.ms.id && this.ms.id !='undefined'){ + this.isEditMode = true; + } + var isValid = true; + + if(this.ms.name == '' + || this.ms.name == undefined){ + this.emptyServiceName = true; + isValid = false; + } + console.log("a >",isValid); + if(this.dupliateName == true){ + isValid = false; + } + console.log("b> ",isValid); + if(this.ms.desc == '' + || this.ms.desc == undefined){ + this.emptyServiceDesc = true; + isValid = false; + } + console.log("c> ",isValid); + + if(this.ms.url == '' + || this.ms.url == undefined){ + this.emptyServiceURL = true; + isValid = false; + } + console.log("d> ",isValid); + + if(this.ms.appId == undefined + || this.ms.appId == null){ + this.emptyServiceApp = true; + isValid = false; + } + + console.log("IsValid flag add/update microservices ",isValid ) + + if(!isValid) + return; + /* + * Check the parameter list, delete those parameters that don't + * have key + */ + if(this.ms && this.ms.parameterList){ + for(var i = 0; i < this.ms.parameterList.length; i++){ + if(this.ms.parameterList[i].para_key == undefined + || this.ms.parameterList[i].para_key == null + || this.ms.parameterList[i].para_key == ""){ + this.ms.parameterList.splice(i, 1); + i--; + } + } + } + if(this.ms.securityType == undefined || + this.ms.securityType == null) + this.ms.securityType = "No Authentication"; + else{ + this.ms.securityType = this.ms.securityType; + this.ms.username = this.ms.username; + this.ms.password = this.ms.password; + } + + var active = 'N'; + if(this.ms.active == true) + active = 'Y'; + + let paramList = []; + if(this.ms.parameterList && this.ms.parameterList.length >0){ + paramList = this.ms.parameterList; + } + var newService = { + name: this.ms.name, + desc: this.ms.desc, + appId: this.ms.appId, + url: this.ms.url, + securityType: this.ms.securityType, + username: this.ms.username, + password: this.ms.password, + active: active, + parameterList: paramList + }; + + if(this.isEditMode){ + console.log("Edit microservice mode called"); + this.microservice.updateService(this.ms.id , newService) + .subscribe( data => { + this.result = data; + console.log("update microservice response :: ",this.result); + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }, error => { + console.log(error); + this.ngbModal.dismissAll(); + }); + }else{ + console.log("Add microservice mode called") + this.microservice.createService(newService) + .subscribe( data => { + this.result = data; + console.log("add microservice response :: ",this.result); + this.passEntry.emit(this.result); + this.ngbModal.dismissAll(); + }, error => { + this.ngbModal.dismissAll(); + console.log(error); + }); + } + } +} diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.html b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.html new file mode 100644 index 00000000..45a68650 --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.html @@ -0,0 +1,89 @@ + + +
+
+

Microservice Onboarding

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Microservice Name {{element.name}} + Service End Point URL {{element.url}} Security Type {{element.securityType}} Delete + + + +
+ +
\ No newline at end of file diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.scss b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.scss new file mode 100644 index 00000000..135fbda2 --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.scss @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +.container th{ + padding-bottom: 15px; + font-weight: bold; +} + +.ion-md-trash{ + cursor: pointer; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts new file mode 100644 index 00000000..09d30a14 --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MicroserviceOnboardingComponent } from './microservice-onboarding.component'; + +describe('MicroserviceOnboardingComponent', () => { + let component: MicroserviceOnboardingComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MicroserviceOnboardingComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MicroserviceOnboardingComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.ts b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.ts new file mode 100644 index 00000000..d2d66974 --- /dev/null +++ b/portal-FE-common/src/app/pages/microservice-onboarding/microservice-onboarding.component.ts @@ -0,0 +1,156 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit, ViewChild, Input } from '@angular/core'; +import { MicroserviceService, WidgetOnboardingService } from '../../shared/services/index' +import { IMircroservies } from 'src/app/shared/model/microservice-onboarding/microservices'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { MatTableDataSource } from '@angular/material'; +import { MatSort, MatPaginator } from '@angular/material'; +import { MicroserviceAddDetailsComponent } from './microservice-add-details/microservice-add-details.component'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { InformationModalComponent } from 'src/app/modals/information-modal/information-modal.component'; + +@Component({ + selector: 'app-microservice-onboarding', + templateUrl: './microservice-onboarding.component.html', + styleUrls: ['./microservice-onboarding.component.scss'] +}) +export class MicroserviceOnboardingComponent implements OnInit { + + showSpinner = true; + microServiceList: Array = []; + result: any; + isEditMode: boolean = false; + + displayedColumns: string[] = ['microserviceName', 'serviceEndPointURL', 'securityType','delete']; + dataSource = new MatTableDataSource(this.microServiceList); + @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + + constructor(public microservice: MicroserviceService, public ngbModal: NgbModal ) { } + + ngOnInit() { + this.getOnboardingServices(); + } + + getOnboardingServices(){ + //console.log("getOnboardingServices called"); + this.microservice.getServiceList() + .subscribe(_data => { + this.result = _data; + if (this.result == null || this.result == 'undefined') { + console.log('MicroserviceService::getServiceList Failed: Result or result.data is null'); + }else { + this.microServiceList = this.result; + this.populateTableData(this.microServiceList); + } + }, error =>{ + console.log(error); + }); + } + + deleteService(microserviceObj: IMircroservies, isConfirmed: boolean): void { + let confirmationMsg = 'You are about to delete this Microservice : ' + microserviceObj.name+ '. Click OK to continue.'; + this.openInformationModal("Confirmation",confirmationMsg).result.then((result) => { + if (result === 'Ok') { + if(!microserviceObj || microserviceObj == null){ + console.log('MicroserviceOnboardingCtrl::deleteService: No service or ID... cannot delete'); + return; + } + //console.log("service id to delete", microserviceObj.id) + this.microServiceList.splice(this.microServiceList.indexOf(microserviceObj), 1); + this.populateTableData(this.microServiceList); + this.microservice.deleteService(microserviceObj.id) + .subscribe( data => { + this.result = data; + this.microServiceList = []; + this.getOnboardingServices(); + }, error => { + console.log(error); + }); + } + }, (resut) => { + return; + }) + } + + + openAddNewMicroserviceModal(rowData: any){ + //console.log("openAddNewMicroserviceModal getting called..."); + const modalRef = this.ngbModal.open(MicroserviceAddDetailsComponent, { size: 'lg' }); + modalRef.componentInstance.title = 'Microservice Onboarding'; + if(rowData != 'undefined' && rowData){ + modalRef.componentInstance.ms = rowData; + this.isEditMode = true; + }else{ + modalRef.componentInstance.ms = {}; + this.isEditMode = false; + } + modalRef.componentInstance.passEntry.subscribe((receivedEntry: any) => { + //console.log("receivedEntry >>> ",receivedEntry); + if(receivedEntry){ + this.microServiceList = []; + this.getOnboardingServices(); + } + }); + } + + populateTableData(microServiceList: Array){ + this.dataSource = new MatTableDataSource(microServiceList); + this.dataSource.sort = this.sort; + this.dataSource.paginator = this.paginator; + } + + applyFilter(filterValue: string) { + this.dataSource.filter = filterValue.trim().toLowerCase(); + } + + openConfirmationModal(_title: string, _message: string) { + const modalInfoRef = this.ngbModal.open(ConfirmationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + } + + openInformationModal(_title: string, _message: string){ + const modalInfoRef = this.ngbModal.open(InformationModalComponent); + modalInfoRef.componentInstance.title = _title; + modalInfoRef.componentInstance.message = _message; + return modalInfoRef; + } +} diff --git a/portal-FE-common/src/app/shared/model/account-onboarding/accountOnboarding.ts b/portal-FE-common/src/app/shared/model/account-onboarding/accountOnboarding.ts new file mode 100644 index 00000000..c0a55315 --- /dev/null +++ b/portal-FE-common/src/app/shared/model/account-onboarding/accountOnboarding.ts @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +export interface IAccountOnboarding { + id ?: any; + created ?: any; + modified ?: any; + createdId ?: any; + modifiedId ?: any; + rowNum ?: any; + auditUserId ?: any; + auditTrail ?: any; + applicationName ?: any; + username ?: any; + password ?: any; + repassword ?: any; + isActive ?: any; + endpoints ?: any; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/shared/model/microservice-onboarding/microservices.ts b/portal-FE-common/src/app/shared/model/microservice-onboarding/microservices.ts new file mode 100644 index 00000000..db607ef3 --- /dev/null +++ b/portal-FE-common/src/app/shared/model/microservice-onboarding/microservices.ts @@ -0,0 +1,58 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +export interface IMircroservies { + id ?: any; + appId ?: any; + created ?: any; + modified ?: any; + createdId ?: any; + modifiedId ?: any; + rowNum ?: any; + auditUserId ?: any; + auditTrail ?: any; + name ?: any; + active ?: any; + desc ?: any; + url ?: any; + securityType ?: any; + username ?: any; + password ?: any; + parameterList ?: any; + option ?: any; +} \ No newline at end of file diff --git a/portal-FE-common/src/app/shared/services/basic-auth-account/basic-auth-account.service.spec.ts b/portal-FE-common/src/app/shared/services/basic-auth-account/basic-auth-account.service.spec.ts new file mode 100644 index 00000000..4a6c0f43 --- /dev/null +++ b/portal-FE-common/src/app/shared/services/basic-auth-account/basic-auth-account.service.spec.ts @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { TestBed } from '@angular/core/testing'; + +import { BasicAuthAccountService } from './basic-auth-account.service'; + +describe('BasicAuthAccountService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: BasicAuthAccountService = TestBed.get(BasicAuthAccountService); + expect(service).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/shared/services/basic-auth-account/basic-auth-account.service.ts b/portal-FE-common/src/app/shared/services/basic-auth-account/basic-auth-account.service.ts new file mode 100644 index 00000000..7741760f --- /dev/null +++ b/portal-FE-common/src/app/shared/services/basic-auth-account/basic-auth-account.service.ts @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { environment } from '../../../../environments/environment'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class BasicAuthAccountService { + + api = environment.api; + + constructor(private http: HttpClient) { } + + createAccount(newAccount: any): Observable { + return this.http.post(this.api.basicAuthAccount, newAccount, { withCredentials: true }); + } + + updateAccount(accountId: any, newAccount: any) { + return this.http.put(this.api.basicAuthAccount + "/" + accountId, newAccount, { withCredentials: true } ); + } + + getAccountList() { + return this.http.get(this.api.basicAuthAccount, { withCredentials: true }); + } + + deleteAccount(accountId: any) { + return this.http.delete(this.api.basicAuthAccount + "/" + accountId, { withCredentials: true }); + } + +} diff --git a/portal-FE-common/src/app/shared/services/contact-us/contact-us.service.spec.ts b/portal-FE-common/src/app/shared/services/contact-us/contact-us.service.spec.ts new file mode 100644 index 00000000..03d55d05 --- /dev/null +++ b/portal-FE-common/src/app/shared/services/contact-us/contact-us.service.spec.ts @@ -0,0 +1,50 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { TestBed } from '@angular/core/testing'; + +import { ContactUsService } from './contact-us.service'; + +describe('ContactUsService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: ContactUsService = TestBed.get(ContactUsService); + expect(service).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/shared/services/contact-us/contact-us.service.ts b/portal-FE-common/src/app/shared/services/contact-us/contact-us.service.ts new file mode 100644 index 00000000..c46abab2 --- /dev/null +++ b/portal-FE-common/src/app/shared/services/contact-us/contact-us.service.ts @@ -0,0 +1,96 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { environment } from '../../../../environments/environment'; +import { Observable } from 'rxjs'; +import * as uuid from 'uuid'; + +@Injectable({ + providedIn: 'root' +}) +export class ContactUsService { + + api = environment.api; + resp:string; + headerParams = {'X-Widgets-Type': 'all', 'X-ECOMP-RequestID': uuid.v4() }; + + constructor(private http: HttpClient) { } + + getListOfApp(): Observable{ + let getListOfAppURL = this.api.availableApps; + return this.http.get(getListOfAppURL , { withCredentials: true } ); + } + + getContactUs(): Observable{ + let getContactUsURL = this.api.getContactUS; + return this.http.get(getContactUsURL , { withCredentials: true } ); + } + + getAppsAndContacts(): Observable{ + let getAppsAndContactsURL = this.api.getAppsAndContacts; + return this.http.get(getAppsAndContactsURL , { withCredentials: true } ); + } + + getContactUSPortalDetails(): Observable{ + let getContactUSPortalDetailsURL = this.api.getContactUSPortalDetails; + return this.http.get(getContactUSPortalDetailsURL , { withCredentials: true } ); + } + + getAppCategoryFunctions(): Observable{ + let getAppCategoryFunctionsURL = this.api.getAppCategoryFunctions; + return this.http.get(getAppCategoryFunctionsURL , { withCredentials: true } ); + } + + addContactUs(newContactUs: any): Observable{ + let addContactUsURL = this.api.saveContactUS; + return this.http.post(addContactUsURL, newContactUs, { withCredentials: true }); + } + + modifyContactUs(contactUsObj: any): Observable{ + let modifyContactUsURL = this.api.saveContactUS; + return this.http.post(modifyContactUsURL, contactUsObj, { withCredentials: true }); + } + + removeContactUs(id: any): Observable{ + let removeContactUsURL = this.api.deleteContactUS + '/' + id; + return this.http.post(removeContactUsURL, { withCredentials: true }); + } + +} diff --git a/portal-FE-common/src/app/shared/services/microservice/microservice.service.spec.ts b/portal-FE-common/src/app/shared/services/microservice/microservice.service.spec.ts new file mode 100644 index 00000000..439a9480 --- /dev/null +++ b/portal-FE-common/src/app/shared/services/microservice/microservice.service.spec.ts @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { TestBed } from '@angular/core/testing'; + +import { MicroserviceService } from './microservice.service'; + +describe('MicroserviceService', () => { + beforeEach(() => TestBed.configureTestingModule({})); + + it('should be created', () => { + const service: MicroserviceService = TestBed.get(MicroserviceService); + expect(service).toBeTruthy(); + }); +}); diff --git a/portal-FE-common/src/app/shared/services/microservice/microservice.service.ts b/portal-FE-common/src/app/shared/services/microservice/microservice.service.ts new file mode 100644 index 00000000..da73139b --- /dev/null +++ b/portal-FE-common/src/app/shared/services/microservice/microservice.service.ts @@ -0,0 +1,86 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { environment } from '../../../../environments/environment'; +import { Observable } from 'rxjs'; + +@Injectable({ + providedIn: 'root' +}) +export class MicroserviceService { + + api = environment.api; + + constructor(private http: HttpClient) { } + + createService(newMicroservice: any): Observable { + return this.http.post(this.api.widgetCommon, newMicroservice, { withCredentials: true } ); + } + + updateService(serviceId: string, newMicroservice: any): Observable { + return this.http.put(this.api.widgetCommon + "/" + serviceId, newMicroservice, { withCredentials: true } ); + } + + deleteService(serviceId: any): Observable { + let deleteServiceURL = this.api.widgetCommon + "/" + serviceId; + return this.http.delete(deleteServiceURL, { withCredentials: true }); + } + + getServiceList(): Observable { + return this.http.get(this.api.widgetCommon, { withCredentials: true }); + } + + getWidgetListByService(serviceId: string): Observable { + return this.http.get(this.api.widgetCommon + '/' + serviceId, { withCredentials: true }); + } + + getUserParameterById(paramId: string): Observable { + return this.http.get(this.api.widgetCommon + '/services/' + paramId, { withCredentials: true }); + } + + deleteUserParameterById(paramId: string): Observable { + return this.http.delete(this.api.widgetCommon + '/services/' + paramId, { withCredentials: true }); + } + + getServiceJSON(serviceId: string): Observable { + return this.http.get(this.api.microserviceProxy + "/" + serviceId, { withCredentials: true }); + } + +} diff --git a/portal-FE-common/src/assets/images/spinner.gif b/portal-FE-common/src/assets/images/spinner.gif new file mode 100644 index 00000000..c97ec6ea Binary files /dev/null and b/portal-FE-common/src/assets/images/spinner.gif differ diff --git a/portal-FE-common/src/styles/_fonts.scss b/portal-FE-common/src/styles/_fonts.scss new file mode 100644 index 00000000..77118314 --- /dev/null +++ b/portal-FE-common/src/styles/_fonts.scss @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +@font-face { + font-family: Omnes-ECOMP-W02, Arial; + src: local("Omnes-ECOMP-W02"), url(../assets/fonts/omnesatt2-regular-webfont.ttf) format("truetype"), + url(../assets/fonts/omnesatt2-regular-webfont.woff) format("woff"), + url(../assets/fonts/omnesatt2-regular-webfont.eot) format("eot"); +} + +@font-face { + font-family: Omnes-ECOMP-W02-Medium, Arial; + src: url(../assets/fonts/omnesatt2-medium-webfont.ttf) format("truetype"); +} + +@font-face { + font-family: Omnes-ECOMP-W02-Light, Arial; + src: url(../assets/fonts/omnesatt2-light-webfont.ttf) format("truetype"); +} +@font-face { + font-family: Omnes-ECOMP-W02-Italic, Arial; + src: url(../assets/fonts/omnesatt2-lightitalic-webfont.ttf) format("truetype"); +} +@font-face { + font-family: Omnes-ECOMP-W02-Bold, Arial; + src: url(../assets/fonts/omnesatt2-bold-webfont.ttf) format("truetype"); +} diff --git a/portal-FE-common/src/styles/_responsive.scss b/portal-FE-common/src/styles/_responsive.scss new file mode 100644 index 00000000..0e659d9f --- /dev/null +++ b/portal-FE-common/src/styles/_responsive.scss @@ -0,0 +1,44 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +@media screen and (max-width: 992px) { + .push-right { + .sidebar { + left: 270px !important; + } + } +} diff --git a/portal-FE-common/src/styles/_spinner.scss b/portal-FE-common/src/styles/_spinner.scss new file mode 100644 index 00000000..406ca78a --- /dev/null +++ b/portal-FE-common/src/styles/_spinner.scss @@ -0,0 +1,67 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +.ecomp-spinner { + background: url('../assets/images/spinner.gif') top left no-repeat; + width: 32px; + height: 32px; + position: absolute; + top: 35%; + left: calc(50% - 32px/2); +} +.ecomp-save-spinner { + background: url('../assets/images/spinner.gif') top left no-repeat; + width: 25px; + height: 25px; + background-size: 25px; + position: absolute; + left: -50px; + top: 2px; +} +.ecomp-small-spinner { + background: url('../assets/images/spinner.gif') top left no-repeat; + width: 25px; + height: 25px; + background-size: 25px; + position: relative; + display: inline-block; + vertical-align: 2px; + cursor: pointer; + top: 6px; + color: transparent; + margin-left: 8px; +} diff --git a/portal-FE-common/src/styles/_utils.scss b/portal-FE-common/src/styles/_utils.scss new file mode 100644 index 00000000..8fabfe29 --- /dev/null +++ b/portal-FE-common/src/styles/_utils.scss @@ -0,0 +1,40 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +.fs-12 { + font-size: 12px; +} diff --git a/portal-FE-common/src/styles/app.scss b/portal-FE-common/src/styles/app.scss new file mode 100644 index 00000000..643948c1 --- /dev/null +++ b/portal-FE-common/src/styles/app.scss @@ -0,0 +1,154 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +/* You can add global styles to this file, and also import other style files */ +@import "~@angular/material/prebuilt-themes/indigo-pink.css"; +@import "bootstrap/bootstrap"; +@import "utils"; +@import "responsive"; +@import "spinner"; +@import "fonts"; + +body { + font-family: "Open Sans", Arial, sans-serif !important; + overflow: hidden; + box-sizing: border-box; +} + +.cdk-global-overlay-wrapper, .cdk-overlay-container { + z-index: 99999 !important; +} + +table { + width: 100%; +} + +.modal-content { + border-radius: 0.6rem !important; +} + +.modal-header { + border-bottom: none; +} + +.modal-dialog { + max-width: 565px; +} +.container{ + padding-top: 1%; +} + +.btn{ + border: 1px solid transparent; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); + cursor: pointer; + display: inline-block; + font-weight: normal; + line-height: 1; + margin: 0 7px 10px 0; + max-width: 470px; + min-width: 70px; + position: relative; + text-align: center; + vertical-align: middle; + white-space: nowrap; + overflow: hidden; +} + +.btn.btn-primary { + float: right; + border-color: #087ac2 transparent #0568ae; + background-color: #0568ae; + background: linear-gradient(to bottom, #087ac2 0%, #0568ae 100%); + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); + color: #ffffff; + border: 1px solid transparent; + padding: 10px 19px 9px 18px; + border-radius: 8px; +} + +@media print { + .breadcrumb { + display: none !important; + } +} + +.mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background { + background-color: #0775bc; +} + +.mat-checkbox:not(.mat-checkbox-disabled).mat-accent .mat-checkbox-ripple .mat-ripple-element { + background-color: #0775bc; +} + +.mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-bar { + background-color: #0878bf; +} + +.mat-slide-toggle.mat-checked:not(.mat-disabled) .mat-slide-toggle-thumb { + background-color: #f8f9fa; +} + +.mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle { + border-color: #0878bf; +} + +.mat-radio-button.mat-accent .mat-radio-inner-circle, .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple), .mat-radio-button.mat-accent.mat-radio-checked .mat-radio-persistent-ripple, .mat-radio-button.mat-accent:active .mat-radio-persistent-ripple { + background-color: #0878bf; +} + +.mat-primary .mat-option.mat-selected:not(.mat-option-disabled) { + color: #0776bd; +} + +.mat-primary .mat-pseudo-checkbox-checked, .mat-primary .mat-pseudo-checkbox-indeterminate { + background: #0775bc; +} + +.mat-grid-tile .mat-figure{top:0;left:0;right:0;bottom:0;position:absolute;display:flex;align-items:initial !important;justify-content:flex-start !important;height:100%;padding:0;margin:0} +.mat-ink-bar{ height: 0px !important;} +.mat-tab-label{font-weight: 1000;} + +.mat-checkbox:not(.mat-checkbox-disabled).mat-accent .mat-checkbox-ripple .mat-ripple-element { + background-color: #0776bd; +} + +.mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background { + background-color: #0776bd; +} + + diff --git a/portal-FE-common/src/styles/bootstrap/_alert.scss b/portal-FE-common/src/styles/bootstrap/_alert.scss new file mode 100644 index 00000000..c2d5c810 --- /dev/null +++ b/portal-FE-common/src/styles/bootstrap/_alert.scss @@ -0,0 +1,51 @@ +// +// Base styles +// + +.alert { + position: relative; + padding: $alert-padding-y $alert-padding-x; + margin-bottom: $alert-margin-bottom; + border: $alert-border-width solid transparent; + @include border-radius($alert-border-radius); +} + +// Headings for larger alerts +.alert-heading { + // Specified to prevent conflicts of changing $headings-color + color: inherit; +} + +// Provide class for links that match alerts +.alert-link { + font-weight: $alert-link-font-weight; +} + + +// Dismissible alerts +// +// Expand the right padding and account for the close button's positioning. + +.alert-dismissible { + padding-right: ($close-font-size + $alert-padding-x * 2); + + // Adjust close link position + .close { + position: absolute; + top: 0; + right: 0; + padding: $alert-padding-y $alert-padding-x; + color: inherit; + } +} + + +// Alternate styles +// +// Generate contextual modifier classes for colorizing the alert. + +@each $color, $value in $theme-colors { + .alert-#{$color} { + @include alert-variant(theme-color-level($color, -10), theme-color-level($color, -9), theme-color-level($color, 6)); + } +} diff --git a/portal-FE-common/src/styles/bootstrap/_badge.scss b/portal-FE-common/src/styles/bootstrap/_badge.scss new file mode 100644 index 00000000..b87a1b00 --- /dev/null +++ b/portal-FE-common/src/styles/bootstrap/_badge.scss @@ -0,0 +1,47 @@ +// Base class +// +// Requires one of the contextual, color modifier classes for `color` and +// `background-color`. + +.badge { + display: inline-block; + padding: $badge-padding-y $badge-padding-x; + font-size: $badge-font-size; + font-weight: $badge-font-weight; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + @include border-radius($badge-border-radius); + + // Empty badges collapse automatically + &:empty { + display: none; + } +} + +// Quick fix for badges in buttons +.btn .badge { + position: relative; + top: -1px; +} + +// Pill badges +// +// Make them extra rounded with a modifier to replace v3's badges. + +.badge-pill { + padding-right: $badge-pill-padding-x; + padding-left: $badge-pill-padding-x; + @include border-radius($badge-pill-border-radius); +} + +// Colors +// +// Contextual variations (linked badges get darker on :hover). + +@each $color, $value in $theme-colors { + .badge-#{$color} { + @include badge-variant($value); + } +} diff --git a/portal-FE-common/src/styles/bootstrap/_breadcrumb.scss b/portal-FE-common/src/styles/bootstrap/_breadcrumb.scss new file mode 100644 index 00000000..25b9d85a --- /dev/null +++ b/portal-FE-common/src/styles/bootstrap/_breadcrumb.scss @@ -0,0 +1,38 @@ +.breadcrumb { + display: flex; + flex-wrap: wrap; + padding: $breadcrumb-padding-y $breadcrumb-padding-x; + margin-bottom: $breadcrumb-margin-bottom; + list-style: none; + background-color: $breadcrumb-bg; + @include border-radius($border-radius); +} + +.breadcrumb-item { + // The separator between breadcrumbs (by default, a forward-slash: "/") + + .breadcrumb-item::before { + display: inline-block; // Suppress underlining of the separator in modern browsers + padding-right: $breadcrumb-item-padding; + padding-left: $breadcrumb-item-padding; + color: $breadcrumb-divider-color; + content: "#{$breadcrumb-divider}"; + } + + // IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built + // without ` + + + \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/header/header.component.scss b/portal-FE-os/src/app/layout/components/header/header.component.scss new file mode 100644 index 00000000..c1ef2a34 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/header/header.component.scss @@ -0,0 +1,84 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright � 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +$topnav-background-color: #222; +:host { + .navbar { + background-color: $topnav-background-color; + .navbar-brand { + color: #fff; + } + .nav-item > a { + color: #999; + &:hover { + color: #fff; + } + } + } + + .dropdown-menu-right.dropdown-menu.show{ + width: 250px; + } + .dropdown-item-name { + font-weight: bold; + } + + .dropdown-item-value { + font-weight: lighter; + } + + .custom-display-item { + display: block; + width: 100%; + padding: 0.25rem 1.5rem; + clear: both; + font-weight: 400; + color: #212529; + text-align: inherit; + white-space: nowrap; + background-color: transparent; + border: 0; + } + + .custom-display-item.approles { + overflow-y: scroll; + height: 250px; + } + .header-menu-display { + width: 250px; + } +} diff --git a/portal-FE-os/src/app/layout/components/header/header.component.spec.ts b/portal-FE-os/src/app/layout/components/header/header.component.spec.ts new file mode 100644 index 00000000..1bcd2ffb --- /dev/null +++ b/portal-FE-os/src/app/layout/components/header/header.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { HeaderComponent } from './header.component'; + +describe('HeaderComponent', () => { + let component: HeaderComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ HeaderComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(HeaderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/layout/components/header/header.component.ts b/portal-FE-os/src/app/layout/components/header/header.component.ts new file mode 100644 index 00000000..5248200a --- /dev/null +++ b/portal-FE-os/src/app/layout/components/header/header.component.ts @@ -0,0 +1,181 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright � 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit } from '@angular/core'; +import { Router, NavigationEnd } from '@angular/router'; +import { UserProfileService, MenusService } from 'src/app/shared/services'; +import { CookieService } from 'ngx-cookie-service'; + +@Component({ + selector: 'app-header', + templateUrl: './header.component.html', + styleUrls: ['./header.component.scss'] +}) +export class HeaderComponent implements OnInit { + public pushRightClass: string; + firstName: string; + lastName: string; + loginSnippetUserid: any; + lastLogin: number; + loginSnippetEmail: any; + userapproles: any[]; + displayUserAppRoles: any; + isLoading: boolean; + + constructor(public router: Router, private userProfileService: UserProfileService, private menusService: MenusService, private cookieService: CookieService) { + + this.router.events.subscribe(val => { + if ( + val instanceof NavigationEnd && + window.innerWidth <= 992 && + this.isToggled() + ) { + this.toggleSidebar(); + } + }); + } + + ngOnInit() { + this.pushRightClass = 'push-right'; + this.getUserInformation(); + } + + getUserInformation() { + this.userProfileService.getFunctionalMenuStaticInfo().toPromise().then((res: any) => { + if (res == null || res.firstName == null || res.firstName == '' || res.lastName == null || res.lastName == '') { + // $log.info('HeaderCtrl: failed to get all required data, trying user profile'); + this.userProfileService.getUserProfile().toPromise().then((profile: any) => { + this.firstName = profile.firstName; + this.lastName = profile.lastName; + }, (err) => { + // $log.error('Header Controller:: getUserProfile() failed: ' + err); + }); + } else { + this.firstName = res.firstName; + this.lastName = res.lastName; + this.loginSnippetEmail = res.email; + this.loginSnippetUserid = res.userId; + this.lastLogin = Date.parse(res.last_login); + } + sessionStorage.userId = res.userId; + this.menusService.getFunctionalMenuForUser().toPromise().then((jsonHeaderMenu: any) => { + // $scope.menuItems = unflatten(jsonHeaderMenu); + // $scope.megaMenuDataObject = $scope.menuItems; + }, (err) => { + // $log.error('HeaderCtrl::GetFunctionalMenuForUser: HeaderCtrl json returned: ' + err); + }); + + }, (err) => { + // $log.error('HeaderCtrl::getFunctionalMenuStaticInfo failed: ' + err); + }) + } + + // unflatten = function( array, parent, tree ){ + + // tree = typeof tree !== 'undefined' ? tree : []; + // parent = typeof parent !== 'undefined' ? parent : { menuId: null }; + // var children = _.filter( array, function(child){ return child.parentMenuId == parent.menuId; }); + + // if( !_.isEmpty( children ) ){ + // if( parent.menuId === null ){ + // tree = children; + // }else{ + // parent['children'] = children + // } + // _.each( children, function( child ){ unflatten( array, child ) } ); + // } + + // return tree; + // } + + getUserApplicationRoles() { + this.userapproles = []; + if (this.displayUserAppRoles) { + this.displayUserAppRoles = false; + } else { + this.displayUserAppRoles = true; + this.isLoading = true; + this.userProfileService.getUserAppRoles(this.loginSnippetUserid) + .subscribe((res: any) => { + this.isLoading = false; + for (var i = 0; i < res.length; i++) { + var userapprole = { + App: res[i].appName, + Roles: res[i].roleNames, + }; + this.userapproles.push(userapprole); + } + }, (err) => { + this.isLoading = false; + }); + } + } + + allAppsLogout() { + this.firstName=""; + this.lastName=""; + this.displayUserAppRoles=false; + var cookieTabs = this.cookieService.get("visInVisCookieTabs").toString; + if(cookieTabs!=null){ + for(var t in cookieTabs){ + + var url = cookieTabs[t].content; + if(url != "") { + this.menusService.logout(url); + } + } + } + // wait for individual applications to log out before the portal logout + setTimeout(function() { + window.location.href = "logout.htm"; + }, 2000); + } + + isToggled(): boolean { + const dom: Element = document.querySelector('body'); + return dom.classList.contains(this.pushRightClass); + } + + toggleSidebar() { + const dom: any = document.querySelector('body'); + dom.classList.toggle(this.pushRightClass); + } + + onLoggedout() { + localStorage.removeItem('isLoggedin'); + } +} diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.html b/portal-FE-os/src/app/layout/components/search-users/search-users.component.html new file mode 100644 index 00000000..4c318f9f --- /dev/null +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.html @@ -0,0 +1,73 @@ + + +
+ {{searchTitle}} +
+
+ + +
+ +
+ +
+
+
+ +
+ + + + + + + + +
Showing {{searchUsersResults.length}} {{txtResults}} + {{element.firstName}} {{element.lastName}}
{{element.jobTitle}} +
+
+
+

{{message}} Or Click Here to add New User!

+
\ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss b/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss new file mode 100644 index 00000000..95a2a5ec --- /dev/null +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.scss @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +@import "../../../pages/pages.component"; + +.mat-row { + cursor: pointer; + background-color: #f2f2f2; +} +.selected { + background-color: #ffffff !important; +} + +.search-user-container { + overflow-y: auto; + height: 250px; +} + +.ecomp-spinner{ + opacity: 10; +} diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts b/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts new file mode 100644 index 00000000..66a966cf --- /dev/null +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SearchUsersComponent } from './search-users.component'; + +describe('SearchUsersComponent', () => { + let component: SearchUsersComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SearchUsersComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SearchUsersComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts b/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts new file mode 100644 index 00000000..10e4e041 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/search-users/search-users.component.ts @@ -0,0 +1,115 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core'; +import { UsersService } from 'src/app/shared/services'; +import { MatTableDataSource, MatPaginator, MatSort } from '@angular/material'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { ConfirmationModalComponent } from 'src/app/modals/confirmation-modal/confirmation-modal.component'; +import { PortalAdmin } from 'src/app/shared/model/PortalAdmin'; + +@Component({ + selector: 'app-search-users', + templateUrl: './search-users.component.html', + styleUrls: ['./search-users.component.scss'] +}) +export class SearchUsersComponent implements OnInit { + + constructor(private userService: UsersService, private ngModal: NgbModal) { } + @Input() searchTitle: string; + @Input() placeHolder: string; + @Input() isSystemUser: boolean; + @ViewChild(MatSort) sort: MatSort; + @ViewChild(MatPaginator) paginator: MatPaginator; + @Output() passBackSelectedUser: EventEmitter = new EventEmitter(); + @Output() userNotFoundFlag = new EventEmitter(); + searchString: string; + txtResults = 'result'; + searchUsersResults: any; + selected: any; + isLoading: boolean; + showUserTable: boolean; + selectedUser: any; + displayedColumns: string[] = ['firstName']; + dataSourceMap = new MatTableDataSource(this.searchUsersResults); + submitted = false; + message = " No users found with your query. Please change your search and try again."; + + ngOnInit() { + this.searchString = ''; + this.showUserTable = false; + this.isSystemUser = false; + } + + passSystemUserInfo(systemUser: string) { + if (this.isSystemUser) + this.passBackSelectedUser.emit(systemUser); + } + + noUserFlag: boolean = false; + searchUsers() { + if (!this.isSystemUser) { + this.isLoading = true; + this.showUserTable = false; + this.passBackSelectedUser.emit(this.selectedUser = ''); + this.userService.searchUsers(this.searchString).subscribe((_data: PortalAdmin) => { + this.searchUsersResults = _data; + if (this.searchUsersResults == null || this.searchUsersResults.length == 0) { + this.noUserFlag = true; + this.isLoading = false; + } else { + this.noUserFlag = false; + this.showUserTable = true; + this.isLoading = false; + this.dataSourceMap = new MatTableDataSource(this.searchUsersResults); + this.txtResults = (this.searchUsersResults && this.searchUsersResults.length > 1) ? 'results' : 'result'; + } + }); + } + } + + setSelectedUser(user: PortalAdmin) { + this.selectedUser = user; + this.passBackSelectedUser.emit(this.selectedUser); + } + + addNewUser() { + console.log("Emit the value to parent"); + this.userNotFoundFlag.emit(true); + } + +} diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html new file mode 100644 index 00000000..e2f4f3a0 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.html @@ -0,0 +1,72 @@ + + + \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss new file mode 100644 index 00000000..fd114bd1 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.scss @@ -0,0 +1,228 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright � 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +$topnav-background-color: #fff; +.sidebar { + border-radius: 0; + position: relative; + z-index: 1000; + //top: 56px; + left: 270px; + width: 270px; + margin-left: -270px; + margin-bottom: 48px; + border: none; + border-radius: 0; + overflow-y: auto; + background-color: $topnav-background-color; + bottom: 0; + overflow-x: hidden; + padding-bottom: 40px; + white-space: nowrap; + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -ms-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + .list-group { + a.list-group-item { + background: $topnav-background-color; + border: 0; + border-top: 1px solid #999; + border-radius: 0; + color: #0568ae; + text-decoration: none; + .icon { + margin-right: 10px; + color: #000; + } + } + a:hover { + background: darken($topnav-background-color, 2%); + color: #000; + } + a.router-link-active { + background: darken($topnav-background-color, 5%); + color: #000; + } + .header-fields { + padding-top: 10px; + + > .list-group-item:first-child { + border-top: 1px solid rgba(255, 255, 255, 0.2); + } + } + } + .sidebar-dropdown { + *:focus { + border-radius: none; + border: none; + } + .panel-title { + font-size: 1rem; + height: 50px; + margin-bottom: 0; + a { + color: #999; + text-decoration: none; + font-weight: 400; + background: $topnav-background-color; + span { + position: relative; + display: block; + padding: 0.75rem 1.5rem; + padding-top: 1rem; + } + } + a:hover, + a:focus { + color: #fff; + outline: none; + outline-offset: -2px; + } + } + .panel-title:hover { + background: darken($topnav-background-color, 5%); + } + .panel-collapse { + border-radious: 0; + border: none; + .panel-body { + .list-group-item { + border-radius: 0; + background-color: $topnav-background-color; + border: 0 solid transparent; + a { + color: #999; + } + a:hover { + color: #fff; + } + } + .list-group-item:hover { + background: darken($topnav-background-color, 5%); + } + } + } + } +} + +.nested-menu { + .list-group-item { + cursor: pointer; + } + .nested { + list-style-type: none; + } + ul.submenu { + display: none; + height: 0; + } + & .expand { + ul.submenu { + display: block; + list-style-type: none; + height: auto; + li { + a { + color: #0568ae; + padding: 10px; + display: block; + } + } + } + } +} +@media screen and (max-width: 992px) { + .sidebar { + top: 54px; + left: 0px; + } +} +@media print { + .sidebar { + display: none !important; + } +} +@media (min-width: 992px) { + .header-fields { + display: none; + } +} + +::-webkit-scrollbar { + width: 8px; +} + +::-webkit-scrollbar-track { + -webkit-box-shadow: inset 0 0 0px rgba(255, 255, 255, 1); + border-radius: 3px; +} + +::-webkit-scrollbar-thumb { + border-radius: 3px; + -webkit-box-shadow: inset 0 0 3px rgba(255, 255, 255, 1); +} + +.toggle-button { + width: 270px; + cursor: pointer; + padding: 12px; + bottom: 0; + color: #0568ae; + background: #fff; + i { + font-size: 23px; + } + &:hover { + background: darken($topnav-background-color, 2%); + color: #000; + } + border-top: 1px solid #999; + -webkit-transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -ms-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +.collapsed { + width: 60px; + span { + display: none; + } +} diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts new file mode 100644 index 00000000..92caeb42 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SidebarComponent } from './sidebar.component'; + +describe('SidebarComponent', () => { + let component: SidebarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SidebarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SidebarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts new file mode 100644 index 00000000..d56f4432 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/sidebar/sidebar.component.ts @@ -0,0 +1,158 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright © 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, Output, EventEmitter, OnInit, Input } from '@angular/core'; +import { Router, NavigationEnd } from '@angular/router'; +import { SidebarService } from '../../../shared/services/index' + +@Component({ + selector: 'app-sidebar', + templateUrl: './sidebar.component.html', + styleUrls: ['./sidebar.component.scss'] +}) +export class SidebarComponent implements OnInit { + @Input() labelName: string; + isActive: boolean; + collapsed: boolean; + showMenu: string; + pushRightClass: string; + result: any; + showOnlyParentMenu: boolean; + leftParentData: any; + leftChildData: any; + menuData: Array = []; + page: any; + + @Output() collapsedEvent = new EventEmitter(); + + constructor(public router: Router, public sidebarService: SidebarService) { + this.router.events.subscribe(val => { + if ( + val instanceof NavigationEnd && + window.innerWidth <= 992 && + this.isToggled() + ) { + this.toggleSidebar(); + } + }); + } + + ngOnInit() { + this.isActive = false; + this.collapsed = false; + this.showMenu = ''; + this.pushRightClass = 'push-right'; + this.sidebarService.getLeftMenu() + .subscribe(data => { + this.result = data; + if (this.result.data && this.result.data2) { + this.leftParentData = JSON.parse(this.result.data); + this.leftChildData = JSON.parse(this.result.data2); + } else { + this.labelName = this.result.label; + this.leftParentData = this.result.navItems; + this.showOnlyParentMenu = true; + } + + for (var i = 0; i < this.leftParentData.length; i++) { + var parentItem = { + name: null, + imageSrc: null, + href: null, + menuItems: [], + state: null + } + if (this.showOnlyParentMenu) { + parentItem.name = this.leftParentData[i].name; + parentItem.imageSrc = this.leftParentData[i].imageSrc; + parentItem.state = '/'+this.leftParentData[i].state; + } else { + parentItem.name = this.leftParentData[i].label; + parentItem.imageSrc = this.leftParentData[i].imageSrc; + } + // Add link to items with no subitems + if (!this.showOnlyParentMenu) { + if (this.leftChildData[i].length == 0) + parentItem.href = this.leftParentData[i].action; + + for (var j = 0; j < this.leftChildData[i].length; j++) { + + var childItem = { + name: null, + href: null + }; + if (this.leftChildData[i][j].label != null && this.leftChildData[i][j].label.length > 0) { + + childItem.name = this.leftChildData[i][j].label; + childItem.href = this.leftChildData[i][j].action; + parentItem.menuItems.push(childItem); + } + } + } + this.menuData.push(parentItem); + } + + }); + + } + eventCalled() { + this.isActive = !this.isActive; + } + + addExpandClass(element: any) { + if (element === this.showMenu) { + this.showMenu = '0'; + } else { + this.showMenu = element; + } + } + + toggleCollapsed() { + this.collapsed = !this.collapsed; + this.collapsedEvent.emit(this.collapsed); + } + + isToggled(): boolean { + const dom: Element = document.querySelector('body'); + return dom.classList.contains(this.pushRightClass); + } + + toggleSidebar() { + const dom: any = document.querySelector('body'); + dom.classList.toggle(this.pushRightClass); + } +} diff --git a/portal-FE-os/src/app/layout/components/tabbar/tab.ts b/portal-FE-os/src/app/layout/components/tabbar/tab.ts new file mode 100644 index 00000000..0b941c6c --- /dev/null +++ b/portal-FE-os/src/app/layout/components/tabbar/tab.ts @@ -0,0 +1,12 @@ +import { SafeUrl } from '@angular/platform-browser'; + +export class Tab { + label: string; + url: SafeUrl; + active: boolean; + + constructor(label: string) { + this.label = label; + } + +} diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html new file mode 100644 index 00000000..4a704da9 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.html @@ -0,0 +1,77 @@ + + +
+
+ + + + + + + + +
+ +
+
+
+ +
+ + + + {{tab.label | elipsis: 13}}   + + + + + + +
+ + + + + + + + +
\ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss new file mode 100644 index 00000000..807e2d57 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.scss @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + + .input-label, + .add-tab-button, + .delete-tab-button { + margin: 8px; + } + .search-bar { + position: absolute; + right: 10%; + } + + #mat-tab-label-0-1 { + position: fixed; + right: 1em; + } + + .mat-tab-group{ + margin-top: 55px; + } + + ::ng-deep .mat-tab-label { + font-size: 13px !important; + line-height: 30px !important; + margin: 5px 0px 0 !important; + border-top-left-radius: 88px 205px !important; + border-top-right-radius: 88px 205px !important; + padding: 0 30px 0 25px !important; + height: 35px !important; + background: #d2d2d2 !important; + position: relative !important; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5) !important; + width: 180px !important; + max-width: 200px !important; + min-width: 20px !important; + border: 1px solid #aaa !important; + text-transform: capitalize !important; + text-align: left !important; + } + + + ::ng-deep .mat-tab-label.mat-ripple.ng-star-inserted.mat-tab-label-active { + opacity: 1; + } \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts new file mode 100644 index 00000000..94866e4e --- /dev/null +++ b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TabbarComponent } from './tabbar.component'; + +describe('TabbarComponent', () => { + let component: TabbarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ TabbarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TabbarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts new file mode 100644 index 00000000..7a10e39d --- /dev/null +++ b/portal-FE-os/src/app/layout/components/tabbar/tabbar.component.ts @@ -0,0 +1,95 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit } from '@angular/core'; +import { FormControl } from '@angular/forms'; +import { DomSanitizer } from '@angular/platform-browser'; +import { Tab } from './tab'; +import { AddTabFunctionService } from 'src/app/shared/services/tab/add-tab-function.service'; + +@Component({ + selector: 'app-tabbar', + templateUrl: './tabbar.component.html', + styleUrls: ['./tabbar.component.scss'] +}) +export class TabbarComponent implements OnInit { + + tabs = []; + mainTab = 'Home'; + selected = new FormControl(0); + collapedSideBar: boolean; + + constructor(private sanitizer: DomSanitizer, private addTabFuntionService: AddTabFunctionService) { + + } + + ngOnInit(): void { + + this.addTabFuntionService.listen().subscribe((m: any) => { + console.log(m); + this.addTab(true, m.title, m.url); + }) + } + + addTab(selectAfterAdding: boolean, label: string, url: string) { + const tab = new Tab(label); + tab.url = this.sanitizer.bypassSecurityTrustResourceUrl(url); + tab.active = true; + this.tabs.push(tab); + + if (selectAfterAdding) { + this.selected.setValue(this.tabs.length); + } + } + + removeTab(index: number) { + this.tabs.splice(index, 1); + } + + receiveCollapsed($event) { + this.collapedSideBar = $event; + } + + tabChanged($event) { + + for (const ttab of this.tabs) { + ttab.active = false; + } + if(this.tabs.length != 0 && $event.index != 0) + this.tabs[$event.index - 1].active = true; + } +} diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.html b/portal-FE-os/src/app/layout/components/userbar/userbar.component.html new file mode 100644 index 00000000..e9a8b822 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/userbar/userbar.component.html @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.scss b/portal-FE-os/src/app/layout/components/userbar/userbar.component.scss new file mode 100644 index 00000000..ee9f8279 --- /dev/null +++ b/portal-FE-os/src/app/layout/components/userbar/userbar.component.scss @@ -0,0 +1,114 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +.usb-item { + background: #fff; + position: fixed; +} + +.usb-item h3 { + color: #ef6f00; + font-size: 14px; + padding: 20px; + margin: 0; + text-align: center; + font-weight: 300; + background: #f8f9fa; +} + +.usb-item a { + display: block; + color: #fff; + font-size: 1.1em; + font-weight: 300; + transition: all 0.2s ease-in-out; + -ms-transition: all 0.2s ease-in-out; /* IE 9 */ + -webkit-transition: all 0.2s ease-in-out; /* Safari 3-8 */ +} + +.usb-item a:active { + background: #afdefa; + color: #47a3da; +} + +.usb-item-right { + transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; /* IE 9 */ + -webkit-transition: all 0.5s ease-in-out; /* Safari 3-8 */ +} + +.usb-item a:hover { + -ms-transform: scale(1.5); /* IE 9 */ + -webkit-transform: scale(1.5); /* Safari 3-8 */ + transform: scale(1.5); +} + +.usb-item-vertical { + margin-top: 105px; + text-align: center; + width: 75px; + height: 79%; + top: 0; + z-index: 1000; + box-shadow: 0 4px 5px rgba(0, 0, 0, 0.2); +} + +.usb-item-vertical a { + padding: 0.5em; +} + +button { + transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; /* IE 9 */ + -webkit-transition: all 0.5s ease-in-out; /* Safari 3-8 */ + z-index: 9999; + top: 450px; + -ms-transform: rotate(-90deg); /* IE 9 */ + -webkit-transform: rotate(-90deg); /* Safari 3-8 */ + transform: rotate(-90deg); + position: fixed; +} + +.activeUserIcon { + display: block; + margin-left: auto; + margin-right: auto; + height: 55px; + width: 55px; + border-radius: 50%; +} diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts b/portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts new file mode 100644 index 00000000..4115433c --- /dev/null +++ b/portal-FE-os/src/app/layout/components/userbar/userbar.component.spec.ts @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { UserbarComponent } from './userbar.component'; + +describe('UserbarComponent', () => { + let component: UserbarComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ UserbarComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(UserbarComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/layout/components/userbar/userbar.component.ts b/portal-FE-os/src/app/layout/components/userbar/userbar.component.ts new file mode 100644 index 00000000..343305fe --- /dev/null +++ b/portal-FE-os/src/app/layout/components/userbar/userbar.component.ts @@ -0,0 +1,134 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +import { Component, OnInit } from '@angular/core'; +import { UserbarService, UserProfileService } from 'src/app/shared/services'; +import { DomSanitizer } from '@angular/platform-browser'; + +@Component({ + selector: 'app-userbar', + templateUrl: './userbar.component.html', + styleUrls: ['./userbar.component.scss'] +}) +export class UserbarComponent implements OnInit { + + userList; + isOpen: boolean; + intervalPromise = null; + updateRate: number; + myservice: UserbarService; + constructor(private sanitizer: DomSanitizer, private userbarService: UserbarService, private userProfileService: UserProfileService) { } + + ngOnInit() { + this.userList = []; + this.myservice = this.userbarService; + this.isOpen = true; + // this.userbarService.getOnlineUserUpdateRate().subscribe((_res: any) => { + // if (_res != null) { + // var rate = parseInt(_res.onlineUserUpdateRate); + // var duration = parseInt(_res.onlineUserUpdateDuration); + // this.userbarService.setMaxRefreshCount((duration / rate) + 1); + // this.userbarService.setRefreshCount(this.userbarService.maxCount); + // if (rate != NaN && duration != NaN) { + // // $log.debug('UserbarCtlr: scheduling function at interval ' + millis); + // this.updateRate = rate; + // this.start(this.updateRate); + // } + // } + // }) + this.updateActiveUsers(); + } + + updateActiveUsers() { + // this.userbarService.decrementRefreshCount(); + this.userProfileService.getActiveUser().subscribe((_res: any) => { + if (_res == null) { + // $log.error('UserbarCtrl::updateActiveUsers: failed to get active user'); + this.stop(); + } else { + var maxItems = 25; + if (_res.length < maxItems) + maxItems = _res.length; + for (var i = 0; i < maxItems; i++) { + var data = { + userId: _res[i], + linkQ: this.sanitizer.bypassSecurityTrustResourceUrl('qto://talk/' + _res[i]), + linkPic: 'https://tspace.web.att.com/profiles/photo.do?uid=' + _res[i] + } + this.userList.push(data); + } + } + + }, (err) => { + this.userList = []; + this.stop(); + }) + + // .add(() => { + // var footerOff = $('#online-userbar').offset().top; + // var headOff = $('#footer').offset().top; + // var defaultOffSet = 45; + // $(".online-user-container").css({ + // "height": headOff - footerOff - defaultOffSet + // }); + // }) + + } + + toggleSidebar() { + this.isOpen = !this.isOpen; + } + + start(rate) { + // stops any running interval to avoid two intervals running at the same time + this.stop(); + // store the interval promise + this.intervalPromise = setInterval(this.updateActiveUsers, rate); + }; + + + stop() { + if (this.intervalPromise != null) { + clearInterval(this.intervalPromise); + this.intervalPromise = null; + } + }; + + + +} diff --git a/portal-FE-os/src/app/layout/layout-routing.module.ts b/portal-FE-os/src/app/layout/layout-routing.module.ts new file mode 100644 index 00000000..5fa77e3a --- /dev/null +++ b/portal-FE-os/src/app/layout/layout-routing.module.ts @@ -0,0 +1,57 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright � 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { LayoutComponent } from './layout.component'; + +const routes: Routes = [ + { + path: '', + component: LayoutComponent, + children: [ + //redirecting to pages module + { path: '', redirectTo: 'app', }, + { path: 'app', loadChildren: () => import('../pages/pages.module').then(m => m.PagesModule) }, ] + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class LayoutRoutingModule {} diff --git a/portal-FE-os/src/app/layout/layout.component.html b/portal-FE-os/src/app/layout/layout.component.html new file mode 100644 index 00000000..757c9860 --- /dev/null +++ b/portal-FE-os/src/app/layout/layout.component.html @@ -0,0 +1,45 @@ + + + + + + + + + \ No newline at end of file diff --git a/portal-FE-os/src/app/layout/layout.component.scss b/portal-FE-os/src/app/layout/layout.component.scss new file mode 100644 index 00000000..a8adf264 --- /dev/null +++ b/portal-FE-os/src/app/layout/layout.component.scss @@ -0,0 +1,68 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright � 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +* { + -webkit-transition: margin-left 0.2s ease-in-out; + -moz-transition: margin-left 0.2s ease-in-out; + -ms-transition: margin-left 0.2s ease-in-out; + -o-transition: margin-left 0.2s ease-in-out; + transition: margin-left 0.2s ease-in-out; +} +.main-container { + margin-top: 56px; + margin-left: 270px; + padding: 15px; + -ms-overflow-x: hidden; + overflow-x: hidden; + overflow-y: scroll; + position: relative; + overflow: hidden; +} +.collapsed { + margin-left: 60px; +} +@media screen and (max-width: 992px) { + .main-container { + margin-left: 0px !important; + } +} +@media print { + .main-container { + margin-top: 0px !important; + margin-left: 0px !important; + } +} diff --git a/portal-FE-os/src/app/layout/layout.component.spec.ts b/portal-FE-os/src/app/layout/layout.component.spec.ts new file mode 100644 index 00000000..5184fe43 --- /dev/null +++ b/portal-FE-os/src/app/layout/layout.component.spec.ts @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LayoutComponent } from './layout.component'; + +describe('LayoutComponent', () => { + let component: LayoutComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LayoutComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LayoutComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/portal-FE-os/src/app/layout/layout.component.ts b/portal-FE-os/src/app/layout/layout.component.ts new file mode 100644 index 00000000..b512988d --- /dev/null +++ b/portal-FE-os/src/app/layout/layout.component.ts @@ -0,0 +1,56 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-layout', + templateUrl: './layout.component.html', + styleUrls: ['./layout.component.scss'] +}) +export class LayoutComponent implements OnInit { + + collapedSideBar: boolean; + + constructor() {} + + ngOnInit() {} + + receiveCollapsed($event) { + this.collapedSideBar = $event; + } +} diff --git a/portal-FE-os/src/app/layout/layout.module.ts b/portal-FE-os/src/app/layout/layout.module.ts new file mode 100644 index 00000000..63a99d86 --- /dev/null +++ b/portal-FE-os/src/app/layout/layout.module.ts @@ -0,0 +1,65 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright � 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgMaterialModule } from '../ng-material-module'; +import { LayoutRoutingModule } from './layout-routing.module'; +import { LayoutComponent } from './layout.component'; +import { SidebarComponent } from './components/sidebar/sidebar.component'; +import { HeaderComponent } from './components/header/header.component'; +import { GlobalSearchComponent } from './components/global-search/global-search.component'; +import { ClickOutsideModule } from 'ng-click-outside'; +import { TabbarComponent } from './components/tabbar/tabbar.component'; +import { HeaderMenuComponent } from './components/header-menu/header-menu.component'; +import { UserbarComponent } from './components/userbar/userbar.component'; +import { FooterComponent } from './components/footer/footer.component'; +import { ApplicationPipesModule } from '../shared/pipes/application-pipes.module'; + +@NgModule({ + imports: [ + CommonModule, + NgMaterialModule, + LayoutRoutingModule, + ApplicationPipesModule, + NgbDropdownModule, + ClickOutsideModule + ], + declarations: [LayoutComponent, SidebarComponent, HeaderComponent,GlobalSearchComponent, TabbarComponent, HeaderMenuComponent, UserbarComponent, FooterComponent] +}) +export class LayoutModule {} diff --git a/portal-FE-os/src/assets/images/default_app_image.gif b/portal-FE-os/src/assets/images/default_app_image.gif new file mode 100644 index 00000000..b3aa80d8 Binary files /dev/null and b/portal-FE-os/src/assets/images/default_app_image.gif differ diff --git a/portal-FE-os/src/assets/images/global.logo b/portal-FE-os/src/assets/images/global.logo new file mode 100644 index 00000000..8d601009 Binary files /dev/null and b/portal-FE-os/src/assets/images/global.logo differ diff --git a/portal-FE-os/src/assets/images/spinner.gif b/portal-FE-os/src/assets/images/spinner.gif new file mode 100644 index 00000000..c97ec6ea Binary files /dev/null and b/portal-FE-os/src/assets/images/spinner.gif differ diff --git a/portal-FE-os/src/browserslist b/portal-FE-os/src/browserslist new file mode 100644 index 00000000..37371cb0 --- /dev/null +++ b/portal-FE-os/src/browserslist @@ -0,0 +1,11 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 \ No newline at end of file diff --git a/portal-FE-os/src/environments/environment.prod.ts b/portal-FE-os/src/environments/environment.prod.ts new file mode 100644 index 00000000..2c026468 --- /dev/null +++ b/portal-FE-os/src/environments/environment.prod.ts @@ -0,0 +1,120 @@ +export const environment = { + production: true, + "api": { + "singleAppInfo": "portalApi/singleAppInfo", + "singleAppInfoById": "portalApi/singleAppInfoById", + "syncRolesFromExternalAuthSystem": "portalApi/syncRoles", + "syncFunctionsFromExternalAuthSystem": "portalApi/syncFunctions", + "userApps": "portalApi/userApps/", + "persUserApps": "portalApi/persUserApps", + "appCatalog": "portalApi/appCatalog", + "accountAdmins": "portalApi/accountAdmins", + "availableApps": "portalApi/availableApps", + "allAvailableApps": "portalApi/allAvailableApps", + "externalRequestAccessSystem": "portalApi/externalRequestAccessSystem", + "userProfile": "portalApi/userProfile", + "queryUsers": "portalApi/queryUsers", + "adminAppsRoles": "portalApi/adminAppsRoles", + "adminApps": "portalApi/adminApps", + "appsForSuperAdminAndAccountAdmin": "portalApi/appsForSuperAdminAndAccountAdmin", + "accountUsers": "portalApi/app/:appId/users", + "saveNewUser": "portalApi/saveNewUser", + "userAppRoles": "portalApi/userAppRoles", + "onboardingApps": "portalApi/onboardingApps", + "widgets": "portalApi/widgets", + "widgetsValidation": "portalApi/widgets/validation", + "functionalMenuForAuthUser": "portalApi/functionalMenuForAuthUser", + "functionalMenuForEditing": "portalApi/functionalMenuForEditing", + "functionalMenuForNotificationTree": "portalApi/functionalMenuForNotificationTree", + "functionalMenu": "portalApi/functionalMenu", + "functionalMenuItemDetails": "portalApi/functionalMenuItemDetails/:menuId", + "appRoles": "portalApi/appRoles/:appId", + "appThumbnail": "portalApi/appThumbnail/:appId", + "functionalMenuItem": "portalApi/functionalMenuItem", + "regenerateFunctionalMenuAncestors": "portalApi/regenerateFunctionalMenuAncestors", + "listOfApp": "portalApi/getAppList", + "setFavoriteItem": "portalApi/setFavoriteItem", + "getFavoriteItems": "portalApi/getFavoriteItems", + "removeFavoriteItem": "portalApi/removeFavoriteItem/:menuId", + "ping": "portalApi/ping", + "functionalMenuStaticInfo": "portalApi/functionalMenuStaticInfo", + "portalAdmins": "portalApi/portalAdmins", + "portalAdmin": "portalApi/portalAdmin", + "getManifest": "portalApi/manifest", + "getActiveUser": "portalApi/dashboard/activeUsers", + "getSearchAllByStringResults": "portalApi/dashboard/search", + "commonWidget": "portalApi/dashboard/widgetData", + "deleteCommonWidget": "portalApi/dashboard/deleteData", + "getContactUS": "portalApi/contactus/list", + "getAppsAndContacts": "portalApi/contactus/allapps", + "saveContactUS": "portalApi/contactus/save", + "deleteContactUS": "portalApi/contactus/delete", + "getContactUSPortalDetails": "portalApi/contactus/feedback", + "getAppCategoryFunctions": "portalApi/contactus/functions", + "onlineUserUpdateRate": "portalApi/dashboard/onlineUserUpdateRate", + "storeAuditLog": "portalApi/auditLog/store", + "leftmenuItems": "portalApi/leftmenuItems", + "getFunctionalMenuRole": "portalApi/getFunctionalMenuRole", + "getNotifications": "portalApi/getNotifications", + "getAdminNotifications": "portalApi/getAdminNotifications", + "getAllAppRoleIds": "portalApi/getNotificationAppRoles", + "getNotificationHistory": "portalApi/getNotificationHistory", + "notificationUpdateRate": "portalApi/notificationUpdateRate", + "notificationRead": "portalApi/notificationRead", + "saveNotification": "portalApi/saveNotification", + "getMessageRecipients": "portalApi/getMessageRecipients", + "getNotificationRoles": "portalApi/notificationRole", + "getRole": "portalApi/get_role", + "getRoles": "portalApi/get_roles/:appId", + "toggleRole": "portalApi/role_list/toggleRole", + "removeRole": "portalApi/role_list/removeRole", + "saveRole": "portalApi/role/saveRole/:appId", + "toggleRoleRoleFunction": "portalApi/role/removeRoleFunction.htm", + "addRoleRoleFunction": "portalApi/role/addRoleFunction.htm", + "toggleRoleChildRole": "portalApi/role/removeChildRole.htm", + "addRoleChildRole": "portalApi/role/addChildRole.htm", + "getRoleFunctions": "portalApi/get_role_functions/:appId", + "saveRoleFunction": "portalApi/role_function_list/saveRoleFunction/:appId", + "removeRoleFunction": "portalApi/role_function_list/removeRoleFunction/:appId", + "userAppsOrderBySortPref": "portalApi/userAppsOrderBySortPref", + "userAppsOrderByName": "portalApi/userAppsOrderByName", + "saveUserAppsSortingPreference": "portalApi/saveUserAppsSortingPreference", + "userAppsSortTypePreference": "portalApi/userAppsSortTypePreference", + "userAppsOrderByLastUsed": "portalApi/userAppsOrderByLastUsed", + "userAppsOrderByMostUsed": "portalApi/userAppsOrderByMostUsed", + "userAppsOrderByManual": "portalApi/userAppsOrderByManual", + "saveUserAppsSortingManual": "portalApi/saveUserAppsSortingManual", + "saveUserWidgetsSortManual": "portalApi/saveUserWidgetsSortManual", + "updateWidgetsSortPref": "portalApi/updateWidgetsSortPref", + "UpdateUserAppsSortManual": "portalApi/UpdateUserAppsSortManual", + "widgetCatalogSelection": "portalApi/widgetCatalogSelection", + "widgetCommon": "portalApi/microservices", + "appCatalogRoles": "portalApi/appCatalogRoles", + "saveUserAppRoles": "portalApi/saveUserAppRoles", + "userApplicationRoles": "portalApi/userApplicationRoles", + "microserviceProxy": "portalApi/microservice/proxy", + "getUserAppsWebAnalytics": "portalApi/getUserAppsWebAnalytics", + "getWebAnalyticsOfApp": "portalApi/getWebAnalyticsOfApp", + "basicAuthAccount": "portalApi/basicAuthAccount", + "addWebAnalyticsReport": "portalApi/addWebAnalyticsReport", + "getUserJourneyAnalyticsReport": "portalApi/getUserJourneyAnalyticsReport", + "deleteWebAnalyticsReport": "portalApi/deleteWebAnalyticsReport", + "getAllWebAnalytics": "portalApi/getAllWebAnalytics", + "modifyWebAnalyticsReport": "portalApi/modifyWebAnalyticsReport", + "appsFullList": "portalApi/appsFullList", + "ecompTitle": "portalApi/ecompTitle", + "getRecommendations": "portalApi/getRecommendations", + "centralizedApps": "portalApi/centralizedApps", + "getSchedulerId": "portalApi/post_create_new_vnf_change", + "getTimeslotsForScheduler": "portalApi/get_time_slots", + "postSubmitForApprovedTimeslots": "portalApi/submit_vnf_change_timeslots", + "getPolicy": "portalApi/get_policy", + "getSchedulerConstants": "portalApi/get_scheduler_constant", + "uploadRoleFunction": "portalApi/uploadRoleFunction/:appId", + "checkIfUserIsSuperAdmin": "portalApi/checkIfUserIsSuperAdmin", + "getCurrentLang": "auxapi/languageSetting/user/:loginId", + "getLanguages": "auxapi/language", + "updateLang": "auxapi/languageSetting/user/:loginId" +}, +"cookieDomain": "att.com" +}; diff --git a/portal-FE-os/src/environments/environment.ts b/portal-FE-os/src/environments/environment.ts new file mode 100644 index 00000000..8d15706b --- /dev/null +++ b/portal-FE-os/src/environments/environment.ts @@ -0,0 +1,134 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false, + "api": { + "singleAppInfo": "http://www.portal.onap.org:9080/portal-be-os/portalApi/singleAppInfo", + "singleAppInfoById": "http://www.portal.onap.org:9080/portal-be-os/portalApi/singleAppInfoById", + "syncRolesFromExternalAuthSystem": "http://www.portal.onap.org:9080/portal-be-os/portalApi/syncRoles", + "syncFunctionsFromExternalAuthSystem": "http://www.portal.onap.org:9080/portal-be-os/portalApi/syncFunctions", + "userApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userApps", + "persUserApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/persUserApps", + "appCatalog": "http://www.portal.onap.org:9080/portal-be-os/portalApi/appCatalog", + "accountAdmins": "http://www.portal.onap.org:9080/portal-be-os/portalApi/accountAdmins", + "availableApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/availableApps", + "allAvailableApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/allAvailableApps", + "externalRequestAccessSystem": "http://www.portal.onap.org:9080/portal-be-os/portalApi/externalRequestAccessSystem", + "userProfile": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userProfile", + "queryUsers": "http://www.portal.onap.org:9080/portal-be-os/portalApi/queryUsers", + "adminAppsRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/adminAppsRoles", + "adminApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/adminApps", + "appsForSuperAdminAndAccountAdmin": "http://www.portal.onap.org:9080/portal-be-os/portalApi/appsForSuperAdminAndAccountAdmin", + "accountUsers": "http://www.portal.onap.org:9080/portal-be-os/portalApi/app/:appId/users", + "saveNewUser": "http://www.portal.onap.org:9080/portal-be-os/portalApi/saveNewUser", + "userAppRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppRoles", + "onboardingApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/onboardingApps", + "widgets": "http://www.portal.onap.org:9080/portal-be-os/portalApi/widgets", + "widgetsValidation": "http://www.portal.onap.org:9080/portal-be-os/portalApi/widgets/validation", + "functionalMenuForAuthUser": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenuForAuthUser", + "functionalMenuForEditing": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenuForEditing", + "functionalMenuForNotificationTree": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenuForNotificationTree", + "functionalMenu": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenu", + "functionalMenuItemDetails": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenuItemDetails/:menuId", + "appRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/appRoles/:appId", + "appThumbnail": "http://www.portal.onap.org:9080/portal-be-os/portalApi/appThumbnail/:appId", + "functionalMenuItem": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenuItem", + "regenerateFunctionalMenuAncestors": "http://www.portal.onap.org:9080/portal-be-os/portalApi/regenerateFunctionalMenuAncestors", + "listOfApp": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getAppList", + "setFavoriteItem": "http://www.portal.onap.org:9080/portal-be-os/portalApi/setFavoriteItem", + "getFavoriteItems": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getFavoriteItems", + "removeFavoriteItem": "http://www.portal.onap.org:9080/portal-be-os/portalApi/removeFavoriteItem/:menuId", + "ping": "http://www.portal.onap.org:9080/portal-be-os/portalApi/ping", + "functionalMenuStaticInfo": "http://www.portal.onap.org:9080/portal-be-os/portalApi/functionalMenuStaticInfo", + "portalAdmins": "http://www.portal.onap.org:9080/portal-be-os/portalApi/portalAdmins", + "portalAdmin": "http://www.portal.onap.org:9080/portal-be-os/portalApi/portalAdmin", + "getManifest": "http://www.portal.onap.org:9080/portal-be-os/portalApi/manifest", + "getActiveUser": "http://www.portal.onap.org:9080/portal-be-os/portalApi/dashboard/activeUsers", + "getSearchAllByStringResults": "http://www.portal.onap.org:9080/portal-be-os/portalApi/dashboard/search", + "commonWidget": "http://www.portal.onap.org:9080/portal-be-os/portalApi/dashboard/widgetData", + "deleteCommonWidget": "http://www.portal.onap.org:9080/portal-be-os/portalApi/dashboard/deleteData", + "getContactUS": "http://www.portal.onap.org:9080/portal-be-os/portalApi/contactus/list", + "getAppsAndContacts": "http://www.portal.onap.org:9080/portal-be-os/portalApi/contactus/allapps", + "saveContactUS": "http://www.portal.onap.org:9080/portal-be-os/portalApi/contactus/save", + "deleteContactUS": "http://www.portal.onap.org:9080/portal-be-os/portalApi/contactus/delete", + "getContactUSPortalDetails": "http://www.portal.onap.org:9080/portal-be-os/portalApi/contactus/feedback", + "getAppCategoryFunctions": "http://www.portal.onap.org:9080/portal-be-os/portalApi/contactus/functions", + "onlineUserUpdateRate": "http://www.portal.onap.org:9080/portal-be-os/portalApi/dashboard/onlineUserUpdateRate", + "storeAuditLog": "http://www.portal.onap.org:9080/portal-be-os/portalApi/auditLog/store", + "leftmenuItems": "http://www.portal.onap.org:9080/portal-be-os/portalApi/leftmenuItems", + "getFunctionalMenuRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getFunctionalMenuRole", + "getNotifications": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getNotifications", + "getMessageRecipients": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getMessageRecipients", + "getRecommendations": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getRecommendations", + "getAdminNotifications": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getAdminNotifications", + "getAllAppRoleIds": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getNotificationAppRoles", + "getNotificationHistory": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getNotificationHistory", + "notificationUpdateRate": "http://www.portal.onap.org:9080/portal-be-os/portalApi/notificationUpdateRate", + "notificationRead": "http://www.portal.onap.org:9080/portal-be-os/portalApi/notificationRead", + "saveNotification": "http://www.portal.onap.org:9080/portal-be-os/portalApi/saveNotification", + "getNotificationRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/notificationRole", + "getRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/get_role", + "getRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/get_roles/:appId", + "toggleRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role_list/toggleRole", + "removeRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role_list/removeRole", + "saveRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role/saveRole/:appId", + "toggleRoleRoleFunction": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role/removeRoleFunction.htm", + "addRoleRoleFunction": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role/addRoleFunction.htm", + "toggleRoleChildRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role/removeChildRole.htm", + "addRoleChildRole": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role/addChildRole.htm", + "getRoleFunctions": "http://www.portal.onap.org:9080/portal-be-os/portalApi/get_role_functions/:appId", + "saveRoleFunction": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role_function_list/saveRoleFunction/:appId", + "removeRoleFunction": "http://www.portal.onap.org:9080/portal-be-os/portalApi/role_function_list/removeRoleFunction/:appId", + "userAppsOrderBySortPref": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppsOrderBySortPref", + "userAppsOrderByName": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppsOrderByName", + "saveUserAppsSortingPreference": "http://www.portal.onap.org:9080/portal-be-os/portalApi/saveUserAppsSortingPreference", + "userAppsSortTypePreference": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppsSortTypePreference", + "userAppsOrderByLastUsed": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppsOrderByLastUsed", + "userAppsOrderByMostUsed": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppsOrderByMostUsed", + "userAppsOrderByManual": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userAppsOrderByManual", + "saveUserAppsSortingManual": "http://www.portal.onap.org:9080/portal-be-os/portalApi/saveUserAppsSortingManual", + "saveUserWidgetsSortManual": "http://www.portal.onap.org:9080/portal-be-os/portalApi/saveUserWidgetsSortManual", + "updateWidgetsSortPref": "http://www.portal.onap.org:9080/portal-be-os/portalApi/updateWidgetsSortPref", + "UpdateUserAppsSortManual": "http://www.portal.onap.org:9080/portal-be-os/portalApi/UpdateUserAppsSortManual", + "widgetCatalogSelection": "http://www.portal.onap.org:9080/portal-be-os/portalApi/widgetCatalogSelection", + "widgetCommon": "http://www.portal.onap.org:9080/portal-be-os/portalApi/microservices", + "appCatalogRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/appCatalogRoles", + "saveUserAppRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/saveUserAppRoles", + "userApplicationRoles": "http://www.portal.onap.org:9080/portal-be-os/portalApi/userApplicationRoles", + "microserviceProxy": "http://www.portal.onap.org:9080/portal-be-os/portalApi/microservice/proxy", + "getUserAppsWebAnalytics": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getUserAppsWebAnalytics", + "getWebAnalyticsOfApp": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getWebAnalyticsOfApp", + "basicAuthAccount": "http://www.portal.onap.org:9080/portal-be-os/portalApi/basicAuthAccount", + "addWebAnalyticsReport": "http://www.portal.onap.org:9080/portal-be-os/portalApi/addWebAnalyticsReport", + "getUserJourneyAnalyticsReport": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getUserJourneyAnalyticsReport", + "deleteWebAnalyticsReport": "http://www.portal.onap.org:9080/portal-be-os/portalApi/deleteWebAnalyticsReport", + "getAllWebAnalytics": "http://www.portal.onap.org:9080/portal-be-os/portalApi/getAllWebAnalytics", + "modifyWebAnalyticsReport": "http://www.portal.onap.org:9080/portal-be-os/portalApi/modifyWebAnalyticsReport", + "appsFullList": "http://www.portal.onap.org:9080/portal-be-os/portalApi/appsFullList", + "ecompTitle": "http://www.portal.onap.org:9080/portal-be-os/portalApi/ecompTitle", + "centralizedApps": "http://www.portal.onap.org:9080/portal-be-os/portalApi/centralizedApps", + "getSchedulerId": "http://www.portal.onap.org:9080/portal-be-os/portalApi/post_create_new_vnf_change", + "getTimeslotsForScheduler": "http://www.portal.onap.org:9080/portal-be-os/portalApi/get_time_slots", + "postSubmitForApprovedTimeslots": "http://www.portal.onap.org:9080/portal-be-os/portalApi/submit_vnf_change_timeslots", + "getPolicy": "http://www.portal.onap.org:9080/portal-be-os/portalApi/get_policy", + "getSchedulerConstants": "http://www.portal.onap.org:9080/portal-be-os/portalApi/get_scheduler_constant", + "uploadRoleFunction": "http://www.portal.onap.org:9080/portal-be-os/portalApi/uploadRoleFunction/:appId", + "checkIfUserIsSuperAdmin": "http://www.portal.onap.org:9080/portal-be-os/portalApi/checkIfUserIsSuperAdmin", + "getCurrentLang": "http://www.portal.onap.org:9080/portal-be-os/auxapi/languageSetting/user/:loginId", + "getLanguages": "http://www.portal.onap.org:9080/portal-be-os/auxapi/language", + "updateLang": "http://www.portal.onap.org:9080/portal-be-os/auxapi/languageSetting/user/:loginId" + + }, + "cookieDomain": "att.com" +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/portal-FE-os/src/favicon.ico b/portal-FE-os/src/favicon.ico new file mode 100644 index 00000000..d2c5e0fc Binary files /dev/null and b/portal-FE-os/src/favicon.ico differ diff --git a/portal-FE-os/src/index.html b/portal-FE-os/src/index.html new file mode 100644 index 00000000..5c8085ff --- /dev/null +++ b/portal-FE-os/src/index.html @@ -0,0 +1,89 @@ + + + + + + + ONAP Portal + + + + + + + + Loading... + + + diff --git a/portal-FE-os/src/karma.conf.js b/portal-FE-os/src/karma.conf.js new file mode 100644 index 00000000..b6e00421 --- /dev/null +++ b/portal-FE-os/src/karma.conf.js @@ -0,0 +1,31 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular-devkit/build-angular'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular-devkit/build-angular/plugins/karma') + ], + client: { + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + dir: require('path').join(__dirname, '../coverage'), + reports: ['html', 'lcovonly'], + fixWebpackSourcePaths: true + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; \ No newline at end of file diff --git a/portal-FE-os/src/main.ts b/portal-FE-os/src/main.ts new file mode 100644 index 00000000..c7b673cf --- /dev/null +++ b/portal-FE-os/src/main.ts @@ -0,0 +1,12 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule) + .catch(err => console.error(err)); diff --git a/portal-FE-os/src/polyfills.ts b/portal-FE-os/src/polyfills.ts new file mode 100644 index 00000000..91286f4a --- /dev/null +++ b/portal-FE-os/src/polyfills.ts @@ -0,0 +1,80 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; + +/** + * If the application will be indexed by Google Search, the following is required. + * Googlebot uses a renderer based on Chrome 41. + * https://developers.google.com/search/docs/guides/rendering + **/ +// import 'core-js/es6/array'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** IE10 and IE11 requires the following for the Reflect API. */ +import 'core-js/es6/reflect'; + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + **/ + import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + */ + + (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + + /* + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + */ +(window as any).__Zone_enable_cross_context_check = true; + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/portal-FE-os/src/styles.scss b/portal-FE-os/src/styles.scss new file mode 100644 index 00000000..b8769e1f --- /dev/null +++ b/portal-FE-os/src/styles.scss @@ -0,0 +1,5 @@ +/* You can add global styles to this file, and also import other style files */ + +.cdk-overlay-connected-position-bounding-box { + z-index: 99999 !important; + } \ No newline at end of file diff --git a/portal-FE-os/src/test.ts b/portal-FE-os/src/test.ts new file mode 100644 index 00000000..16317897 --- /dev/null +++ b/portal-FE-os/src/test.ts @@ -0,0 +1,20 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: any; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/portal-FE-os/src/tsconfig.app.json b/portal-FE-os/src/tsconfig.app.json new file mode 100644 index 00000000..190fd300 --- /dev/null +++ b/portal-FE-os/src/tsconfig.app.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ] +} diff --git a/portal-FE-os/src/tsconfig.spec.json b/portal-FE-os/src/tsconfig.spec.json new file mode 100644 index 00000000..de773363 --- /dev/null +++ b/portal-FE-os/src/tsconfig.spec.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts", + "polyfills.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/portal-FE-os/src/tslint.json b/portal-FE-os/src/tslint.json new file mode 100644 index 00000000..52e2c1a5 --- /dev/null +++ b/portal-FE-os/src/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ] + } +} diff --git a/portal-FE-os/tsconfig.json b/portal-FE-os/tsconfig.json new file mode 100644 index 00000000..eb05bdc9 --- /dev/null +++ b/portal-FE-os/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + } +} diff --git a/portal-FE-os/tslint.json b/portal-FE-os/tslint.json new file mode 100644 index 00000000..6ddb6b29 --- /dev/null +++ b/portal-FE-os/tslint.json @@ -0,0 +1,131 @@ +{ + "rulesDirectory": [ + "node_modules/codelyzer" + ], + "rules": { + "arrow-return-shorthand": true, + "callable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "deprecation": { + "severity": "warn" + }, + "eofline": true, + "forin": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "import-spacing": true, + "indent": [ + true, + "spaces" + ], + "interface-over-type-literal": true, + "label-position": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "prefer-const": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "unified-signatures": true, + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "no-output-on-prefix": true, + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true + } +}