From ffbc197bb961ebeae002c901375f4e54ba14e844 Mon Sep 17 00:00:00 2001 From: Sebastian Leidig Date: Tue, 10 Sep 2024 16:49:49 +0200 Subject: [PATCH] fix: migrate ChildBlock config when used as viewComponent --- .../entity/entity-block/entity-block.component.ts | 2 ++ src/app/core/config/config.service.ts | 4 ++++ src/app/core/core-components.ts | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/src/app/core/basic-datatypes/entity/entity-block/entity-block.component.ts b/src/app/core/basic-datatypes/entity/entity-block/entity-block.component.ts index 6da7ec9f68..3d8b4fd77a 100644 --- a/src/app/core/basic-datatypes/entity/entity-block/entity-block.component.ts +++ b/src/app/core/basic-datatypes/entity/entity-block/entity-block.component.ts @@ -11,10 +11,12 @@ import { FaIconComponent } from "@fortawesome/angular-fontawesome"; import { DisplayImgComponent } from "../../../../features/file/display-img/display-img.component"; import { EntityBlockConfig } from "./entity-block-config"; import { EntityFieldViewComponent } from "../../../common-components/entity-field-view/entity-field-view.component"; +import { DynamicComponent } from "../../../config/dynamic-components/dynamic-component.decorator"; /** * Display an inline block representing an entity. */ +@DynamicComponent("EntityBlock") @Component({ selector: "app-entity-block", templateUrl: "./entity-block.component.html", diff --git a/src/app/core/config/config.service.ts b/src/app/core/config/config.service.ts index e88dda46c7..073f5e9b29 100644 --- a/src/app/core/config/config.service.ts +++ b/src/app/core/config/config.service.ts @@ -369,5 +369,9 @@ const migrateEntityBlock: ConfigMigration = (key, configPart) => { return configPart; } + if (key === "viewComponent" && configPart === "ChildBlock") { + return "EntityBlock"; + } + return configPart; }; diff --git a/src/app/core/core-components.ts b/src/app/core/core-components.ts index 485d7cdc2b..19d18d7dad 100644 --- a/src/app/core/core-components.ts +++ b/src/app/core/core-components.ts @@ -36,6 +36,13 @@ export const coreComponents: ComponentTuple[] = [ "./basic-datatypes/entity/display-entity/display-entity.component" ).then((c) => c.DisplayEntityComponent), ], + [ + "EntityBlock", + () => + import( + "./basic-datatypes/entity/entity-block/entity-block.component" + ).then((c) => c.EntityBlockComponent), + ], [ "EditTextWithAutocomplete", () =>