This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git


The following commit(s) were added to refs/heads/main by this push:
     new c427e69a Fix #1441
c427e69a is described below

commit c427e69a0e5411027b35edf983b7c18f4ae84631
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Thu Oct 17 11:25:31 2024 -0400

    Fix #1441
---
 .../webui/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 58c3132f..612b6932 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 58c3132f..612b6932 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 58c3132f..612b6932 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);
         }
     }
 

Reply via email to