diff --git a/docs/modules/onecx-shell-bff/pages/onecx-shell-bff-extensions.adoc b/docs/modules/onecx-shell-bff/pages/onecx-shell-bff-extensions.adoc index f726a3e..a089a55 100644 --- a/docs/modules/onecx-shell-bff/pages/onecx-shell-bff-extensions.adoc +++ b/docs/modules/onecx-shell-bff/pages/onecx-shell-bff-extensions.adoc @@ -47,44 +47,44 @@ h| Version | tkit-quarkus-log-cdi | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-cdi.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-cdi.adoc[Link] +| 2.22.0 | tkit-quarkus-log-rs | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-rs.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-rs.adoc[Link] +| 2.22.0 | tkit-quarkus-log-json | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-log-json.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-log-json.adoc[Link] +| 2.22.0 | tkit-quarkus-rest | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest.adoc[Link] +| 2.22.0 | tkit-quarkus-rest-context | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-rest-context.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-rest-context.adoc[Link] +| 2.22.0 | tkit-quarkus-jpa | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-jpa.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-jpa.adoc[Link] +| 2.22.0 | tkit-quarkus-security | https://1000kit.github.io/tkit-quarkus/current/tkit-quarkus/tkit-quarkus-security.html[Link] -| https://github.com/1000kit/tkit-quarkus/blob/2.21.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] -| 2.21.0 +| https://github.com/1000kit/tkit-quarkus/blob/2.22.0/docs/modules/tkit-quarkus/pages/includes/tkit-quarkus-security.adoc[Link] +| 2.22.0 | quarkus-hibernate-validator @@ -95,8 +95,8 @@ h| Version | onecx-permissions | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-permissions.html[Link] -| https://github.com/onecx/onecx-quarkus/blob/0.16.0/docs/modules/onecx-quarkus/pages/includes/onecx-permissions.adoc[Link] -| 0.16.0 +| https://github.com/onecx/onecx-quarkus/blob/0.17.0/docs/modules/onecx-quarkus/pages/includes/onecx-permissions.adoc[Link] +| 0.17.0 | quarkus-oidc @@ -114,7 +114,7 @@ h| Version | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link] | -| 0.16.0 +| 0.17.0 | quarkus-arc diff --git a/pom.xml b/pom.xml index c4e3b66..5a00099 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.tkit.onecx onecx-quarkus3-parent - 0.46.0 + 0.47.0 onecx-shell-bff diff --git a/src/main/java/org/tkit/onecx/shell/bff/rs/controllers/WorkspaceConfigRestController.java b/src/main/java/org/tkit/onecx/shell/bff/rs/controllers/WorkspaceConfigRestController.java index 6b94349..566ce7a 100644 --- a/src/main/java/org/tkit/onecx/shell/bff/rs/controllers/WorkspaceConfigRestController.java +++ b/src/main/java/org/tkit/onecx/shell/bff/rs/controllers/WorkspaceConfigRestController.java @@ -22,6 +22,7 @@ import org.tkit.quarkus.log.cdi.LogService; import gen.org.tkit.onecx.product.store.client.api.ProductsApi; +import gen.org.tkit.onecx.product.store.client.model.MicrofrontendTypePSV1; import gen.org.tkit.onecx.product.store.client.model.ProductPSV1; import gen.org.tkit.onecx.shell.bff.rs.internal.WorkspaceConfigApiService; import gen.org.tkit.onecx.shell.bff.rs.internal.model.*; @@ -77,31 +78,41 @@ public Response getWorkspaceConfig(GetWorkspaceConfigRequestDTO getWorkspaceConf //get productStore information for each Product List routes = new ArrayList<>(); + List components = new ArrayList<>(); + List shellComponents = new ArrayList<>(); detailedWorkspaceInfo.getProducts().forEach(p -> { try (Response psResponse = productStoreClient.getProductByName(p.getProductName())) { var product = psResponse.readEntity(ProductPSV1.class); product.getMicrofrontends() - .forEach(mfe -> routes.add(mapper.mapRoute(mfe, product, p.getMicrofrontends(), - workspaceResponse.getBaseUrl()))); + .forEach(mfe -> { + if (mfe.getType() == MicrofrontendTypePSV1.MODULE) { + routes.add(mapper.mapRoute(mfe, product, p.getMicrofrontends(), + workspaceResponse.getBaseUrl())); + } + }); } catch (WebApplicationException ex) { //skip } }); responseDTO.setRoutes(routes); + responseDTO.setRemoteComponents(components); + responseDTO.setShellRemoteComponents(shellComponents); + } //get theme info try (Response themeResponse = themeClient.getThemeByName(workspaceResponse.getTheme())) { var themeInfo = themeResponse.readEntity(Theme.class); if (themeInfo.getFaviconUrl() == null) { - themeInfo.setFaviconUrl(uriInfo.getPath() + "/themes/" + themeInfo.getName() + "/favicon"); + themeInfo.setFaviconUrl(uriInfo.getAbsolutePath() + "/themes/" + themeInfo.getName() + "/favicon"); } if (themeInfo.getLogoUrl() == null) { - themeInfo.setLogoUrl(uriInfo.getPath() + "/themes/" + themeInfo.getName() + "/logo"); + themeInfo.setLogoUrl(uriInfo.getAbsolutePath() + "/themes/" + themeInfo.getName() + "/logo"); } responseDTO.setTheme(mapper.mapTheme(themeInfo)); } //call remoteComponent Mocks => should be removed after implementation responseDTO = mockRemoteComponents(responseDTO); + responseBuilder = Response.status(Response.Status.OK).entity(responseDTO); } else { responseBuilder = Response.status(Response.Status.NOT_FOUND.getStatusCode(), diff --git a/src/test/java/org/tkit/onecx/shell/bff/rs/WorkspaceConfigRestControllerTest.java b/src/test/java/org/tkit/onecx/shell/bff/rs/WorkspaceConfigRestControllerTest.java index 5039681..05f7ad4 100644 --- a/src/test/java/org/tkit/onecx/shell/bff/rs/WorkspaceConfigRestControllerTest.java +++ b/src/test/java/org/tkit/onecx/shell/bff/rs/WorkspaceConfigRestControllerTest.java @@ -21,6 +21,7 @@ import org.tkit.onecx.shell.bff.rs.controllers.WorkspaceConfigRestController; import gen.org.tkit.onecx.product.store.client.model.MicrofrontendPSV1; +import gen.org.tkit.onecx.product.store.client.model.MicrofrontendTypePSV1; import gen.org.tkit.onecx.product.store.client.model.ProductPSV1; import gen.org.tkit.onecx.shell.bff.rs.internal.model.GetWorkspaceConfigRequestDTO; import gen.org.tkit.onecx.shell.bff.rs.internal.model.GetWorkspaceConfigResponseDTO; @@ -74,7 +75,8 @@ void getWorkspaceConfigByBaseUrlTest() { .appName("app1") .remoteBaseUrl("/remoteBaseUrl") .remoteEntry("/remoteEntry.js") - .technology("ANGULAR"))); + .technology("ANGULAR") + .type(MicrofrontendTypePSV1.MODULE))); // create mock rest endpoint for get product by name from product-store mockServerClient.when(request().withPath("/v1/products/product1").withMethod(HttpMethod.GET)) .withId("mockPS") @@ -160,7 +162,8 @@ void getWorkspaceConfigByBaseUrlTest_emptyImageUrl_should_create_urls_test() { .appName("app1") .remoteBaseUrl("/remoteBaseUrl") .remoteEntry("/remoteEntry.js") - .technology("ANGULAR"))); + .technology("ANGULAR") + .type(MicrofrontendTypePSV1.MODULE))); // create mock rest endpoint for get product by name from product-store mockServerClient.when(request().withPath("/v1/products/product1").withMethod(HttpMethod.GET)) .withId("mockPS")