From c427e69a0e5411027b35edf983b7c18f4ae84631 Mon Sep 17 00:00:00 2001 From: Marat Gubaidullin Date: Thu, 17 Oct 2024 11:25:31 -0400 Subject: [PATCH] Fix #1441 --- .../src/designer/route/element/DslElementHeader.tsx | 12 +++++++----- .../src/designer/route/element/DslElementHeader.tsx | 12 +++++++----- .../src/designer/route/element/DslElementHeader.tsx | 12 +++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/karavan-app/src/main/webui/src/designer/route/element/DslElementHeader.tsx b/karavan-app/src/main/webui/src/designer/route/element/DslElementHeader.tsx index 58c3132f578..612b693205b 100644 --- a/karavan-app/src/main/webui/src/designer/route/element/DslElementHeader.tsx +++ b/karavan-app/src/main/webui/src/designer/route/element/DslElementHeader.tsx @@ -139,10 +139,10 @@ export function DslElementHeader(props: Props) { function hasElements(rc: RouteConfigurationDefinition): boolean { return (rc.interceptFrom !== undefined && rc.interceptFrom.length > 0) - || (rc.intercept !== undefined && rc.intercept.length > 0) - || (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0) - || (rc.onException !== undefined && rc.onException.length > 0) - || (rc.onCompletion !== undefined && rc.onCompletion.length > 0) + || (rc.intercept !== undefined && rc.intercept.length > 0) + || (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0) + || (rc.onException !== undefined && rc.onException.length > 0) + || (rc.onCompletion !== undefined && rc.onCompletion.length > 0) } function getHeaderIconClasses(): string { @@ -225,7 +225,9 @@ export function DslElementHeader(props: Props) { } else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') { return "Source"; } else { - return (step as any).description ? (step as any).description : CamelUi.getElementTitle(props.step); + let description: string = (step as any).description; + description = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description; + return description ? description : CamelUi.getElementTitle(props.step); } } diff --git a/karavan-designer/src/designer/route/element/DslElementHeader.tsx b/karavan-designer/src/designer/route/element/DslElementHeader.tsx index 58c3132f578..612b693205b 100644 --- a/karavan-designer/src/designer/route/element/DslElementHeader.tsx +++ b/karavan-designer/src/designer/route/element/DslElementHeader.tsx @@ -139,10 +139,10 @@ export function DslElementHeader(props: Props) { function hasElements(rc: RouteConfigurationDefinition): boolean { return (rc.interceptFrom !== undefined && rc.interceptFrom.length > 0) - || (rc.intercept !== undefined && rc.intercept.length > 0) - || (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0) - || (rc.onException !== undefined && rc.onException.length > 0) - || (rc.onCompletion !== undefined && rc.onCompletion.length > 0) + || (rc.intercept !== undefined && rc.intercept.length > 0) + || (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0) + || (rc.onException !== undefined && rc.onException.length > 0) + || (rc.onCompletion !== undefined && rc.onCompletion.length > 0) } function getHeaderIconClasses(): string { @@ -225,7 +225,9 @@ export function DslElementHeader(props: Props) { } else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') { return "Source"; } else { - return (step as any).description ? (step as any).description : CamelUi.getElementTitle(props.step); + let description: string = (step as any).description; + description = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description; + return description ? description : CamelUi.getElementTitle(props.step); } } diff --git a/karavan-space/src/designer/route/element/DslElementHeader.tsx b/karavan-space/src/designer/route/element/DslElementHeader.tsx index 58c3132f578..612b693205b 100644 --- a/karavan-space/src/designer/route/element/DslElementHeader.tsx +++ b/karavan-space/src/designer/route/element/DslElementHeader.tsx @@ -139,10 +139,10 @@ export function DslElementHeader(props: Props) { function hasElements(rc: RouteConfigurationDefinition): boolean { return (rc.interceptFrom !== undefined && rc.interceptFrom.length > 0) - || (rc.intercept !== undefined && rc.intercept.length > 0) - || (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0) - || (rc.onException !== undefined && rc.onException.length > 0) - || (rc.onCompletion !== undefined && rc.onCompletion.length > 0) + || (rc.intercept !== undefined && rc.intercept.length > 0) + || (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0) + || (rc.onException !== undefined && rc.onException.length > 0) + || (rc.onCompletion !== undefined && rc.onCompletion.length > 0) } function getHeaderIconClasses(): string { @@ -225,7 +225,9 @@ export function DslElementHeader(props: Props) { } else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') { return "Source"; } else { - return (step as any).description ? (step as any).description : CamelUi.getElementTitle(props.step); + let description: string = (step as any).description; + description = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description; + return description ? description : CamelUi.getElementTitle(props.step); } }