Skip to content

Commit

Permalink
feat(CanvasForm): Use component Title in CanvasForm
Browse files Browse the repository at this point in the history
Currently, the component name is being used as the title in the
`CanvasForm`.

This commit uses the corresponding `Title` property if available from
components, eips and kamelets, and the `ID` as a last resort.

fix: KaotoIO#1462
prerequisite of: KaotoIO#1699
  • Loading branch information
lordrip committed Dec 16, 2024
1 parent 0aa3d6f commit 947c9b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ export class CamelRouteConfigurationVisualEntity
return super.getTooltipContent(path);
}

getNodeLabel(path?: string): string {
if (path === this.getRootPath()) {
return 'Route Configuration';
}

return super.getNodeLabel(path);
}

getComponentSchema(path?: string | undefined): VisualComponentSchema | undefined {
if (path === this.getRootPath()) {
const schema = CamelCatalogService.getComponent(CatalogKind.Entity, 'routeConfiguration');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ export class PipeVisualEntity implements BaseVisualCamelEntity {
return 'Pipe';
}

<<<<<<< HEAD
const stepModel: PipeStep = getValue(this.pipe.spec, path);
=======
const stepModel = get(this.pipe.spec, path) as PipeStep;
>>>>>>> df3353f2 (feat(CanvasForm): Use component Title in CanvasForm)
return KameletSchemaService.getNodeTitle(stepModel);
}

Expand Down

0 comments on commit 947c9b3

Please sign in to comment.