Skip to content

Commit

Permalink
Merge branch 'main' into feature/product-path-to-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter committed May 28, 2024
2 parents 16547ef + 6bd8ce0 commit 2c13f5a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

import org.mapstruct.AfterMapping;
Expand Down Expand Up @@ -54,6 +55,7 @@ default LoadWorkspaceConfigResponseDTO createResponse(WorkspaceWrapper workspace
@Mapping(target = "name", ignore = true)
@Mapping(target = "baseUrl", source = "mfe.remoteBaseUrl")
@Mapping(target = "remoteEntryUrl", source = "mfe.remoteEntry")
@Mapping(target = "elementName", source = "mfe.tagName")
@Mapping(target = "productName", source = "product.name")
RemoteComponentDTO createComponent(LoadProductItemPSV1 product, LoadProductMicrofrontendPSV1 mfe);

Expand Down Expand Up @@ -90,6 +92,7 @@ default String componentName(String productName, String appId, String exposedMod
@Mapping(target = "exposedModule", source = "mfe.exposedModule")
@Mapping(target = "remoteName", source = "mfe.remoteName")
@Mapping(target = "endpoints", source = "mfe.endpoints")
@Mapping(target = "elementName", source = "mfe.tagName")
RouteDTO createRoute(LoadProductItemPSV1 product, LoadProductMicrofrontendPSV1 mfe, Map<String, String> pathMapping,
WorkspaceWrapper workspace, String productBaseUrl);

Expand All @@ -111,6 +114,7 @@ default SlotDTO createSlot(WorkspaceWrapperSlot slot) {

SlotDTO result = new SlotDTO().name(slot.getName());
if (slot.getComponents() != null) {
slot.getComponents().removeIf(Objects::isNull);
slot.getComponents()
.forEach(c -> result.addComponentsItem(componentName(c.getProductName(), c.getAppId(), c.getName())));
}
Expand Down
8 changes: 7 additions & 1 deletion src/main/openapi/openapi-bff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ components:
$ref: '#/components/schemas/PathMatch'
remoteName:
type: string
elementName:
type: string
displayName:
type: string
endpoints:
Expand All @@ -269,7 +271,7 @@ components:
type: string
Technologies:
type: string
enum: ['Angular', 'WebComponent']
enum: ['Angular', 'WebComponent', 'WebComponentScript', 'WebComponentModule' ]
PathMatch:
type: string
enum: ['full', 'prefix']
Expand Down Expand Up @@ -298,6 +300,10 @@ components:
type: string
remoteName:
type: string
elementName:
type: string
technology:
$ref: '#/components/schemas/Technologies'
GetUserProfileResponse:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ void loadWorkspaceConfigByBaseUrlTest() {
.addMicrofrontendsItem(new Microfrontend().basePath("/app1").mfeId("app1")))
.addSlotsItem(
new WorkspaceWrapperSlot().name("slot1")
.addComponentsItem(null)
.addComponentsItem(
new WorkspaceWrapperComponent().productName("product1").appId("app1")
.name("App1Component"))
Expand Down

0 comments on commit 2c13f5a

Please sign in to comment.