Skip to content

Commit ffbc197

Browse files
committed
fix: migrate ChildBlock config when used as viewComponent
1 parent 19d4e8a commit ffbc197

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/app/core/basic-datatypes/entity/entity-block/entity-block.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ import { FaIconComponent } from "@fortawesome/angular-fontawesome";
1111
import { DisplayImgComponent } from "../../../../features/file/display-img/display-img.component";
1212
import { EntityBlockConfig } from "./entity-block-config";
1313
import { EntityFieldViewComponent } from "../../../common-components/entity-field-view/entity-field-view.component";
14+
import { DynamicComponent } from "../../../config/dynamic-components/dynamic-component.decorator";
1415

1516
/**
1617
* Display an inline block representing an entity.
1718
*/
19+
@DynamicComponent("EntityBlock")
1820
@Component({
1921
selector: "app-entity-block",
2022
templateUrl: "./entity-block.component.html",

src/app/core/config/config.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,5 +369,9 @@ const migrateEntityBlock: ConfigMigration = (key, configPart) => {
369369
return configPart;
370370
}
371371

372+
if (key === "viewComponent" && configPart === "ChildBlock") {
373+
return "EntityBlock";
374+
}
375+
372376
return configPart;
373377
};

src/app/core/core-components.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ export const coreComponents: ComponentTuple[] = [
3636
"./basic-datatypes/entity/display-entity/display-entity.component"
3737
).then((c) => c.DisplayEntityComponent),
3838
],
39+
[
40+
"EntityBlock",
41+
() =>
42+
import(
43+
"./basic-datatypes/entity/entity-block/entity-block.component"
44+
).then((c) => c.EntityBlockComponent),
45+
],
3946
[
4047
"EditTextWithAutocomplete",
4148
() =>

0 commit comments

Comments
 (0)