Skip to content

Commit

Permalink
fix: migrate ChildBlock config when used as viewComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
sleidig committed Sep 11, 2024
1 parent 19d4e8a commit ffbc197
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/app/core/config/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,9 @@ const migrateEntityBlock: ConfigMigration = (key, configPart) => {
return configPart;
}

if (key === "viewComponent" && configPart === "ChildBlock") {
return "EntityBlock";
}

return configPart;
};
7 changes: 7 additions & 0 deletions src/app/core/core-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
() =>
Expand Down

0 comments on commit ffbc197

Please sign in to comment.