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 6badb240 Fix #1287
6badb240 is described below

commit 6badb240c80c8809ce4d59095a53a557b8726fc0
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Tue Jun 4 16:05:55 2024 -0400

    Fix #1287
---
 karavan-app/src/main/webui/src/topology/CustomNode.tsx  | 3 +++
 karavan-app/src/main/webui/src/topology/TopologyApi.tsx | 3 ++-
 karavan-designer/public/example/demo.camel.yaml         | 3 +++
 karavan-designer/src/topology/CustomNode.tsx            | 3 +++
 karavan-designer/src/topology/TopologyApi.tsx           | 3 ++-
 karavan-space/src/topology/CustomNode.tsx               | 3 +++
 karavan-space/src/topology/TopologyApi.tsx              | 3 ++-
 7 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/karavan-app/src/main/webui/src/topology/CustomNode.tsx 
b/karavan-app/src/main/webui/src/topology/CustomNode.tsx
index 88263966..83792a0c 100644
--- a/karavan-app/src/main/webui/src/topology/CustomNode.tsx
+++ b/karavan-app/src/main/webui/src/topology/CustomNode.tsx
@@ -44,6 +44,9 @@ const CustomNode: React.FC<any> = observer(({ element, 
...rest }) => {
 
     const data = element.getData();
     const badge:string = data.badge?.substring(0,1).toUpperCase();
+    if (element.getLabel()?.length > 30) {
+        element.setLabel(element.getLabel()?.substring(0,30) + '...');
+    }
 
     return (
         <DefaultNode
diff --git a/karavan-app/src/main/webui/src/topology/TopologyApi.tsx 
b/karavan-app/src/main/webui/src/topology/TopologyApi.tsx
index ffe14098..8cca27c9 100644
--- a/karavan-app/src/main/webui/src/topology/TopologyApi.tsx
+++ b/karavan-app/src/main/webui/src/topology/TopologyApi.tsx
@@ -204,7 +204,8 @@ export function getRestNodes(tins: TopologyRestNode[]): 
NodeModel[] {
                 icon: 'rest',
                 type: 'rest',
                 step: tin.rest,
-                fileName: tin.fileName
+                fileName: tin.fileName,
+                secondaryLabel: tin.title
             }
         }
     });
diff --git a/karavan-designer/public/example/demo.camel.yaml 
b/karavan-designer/public/example/demo.camel.yaml
index 4dd9c942..1ac491b4 100644
--- a/karavan-designer/public/example/demo.camel.yaml
+++ b/karavan-designer/public/example/demo.camel.yaml
@@ -1,5 +1,8 @@
 - rest:
     id: rest-328e
+    description: >-
+      It has a broken design for long endpoint descriptions and a dual topology
+      view rendering
     get:
       - id: get-5ab7
         to: direct:hello
diff --git a/karavan-designer/src/topology/CustomNode.tsx 
b/karavan-designer/src/topology/CustomNode.tsx
index 88263966..83792a0c 100644
--- a/karavan-designer/src/topology/CustomNode.tsx
+++ b/karavan-designer/src/topology/CustomNode.tsx
@@ -44,6 +44,9 @@ const CustomNode: React.FC<any> = observer(({ element, 
...rest }) => {
 
     const data = element.getData();
     const badge:string = data.badge?.substring(0,1).toUpperCase();
+    if (element.getLabel()?.length > 30) {
+        element.setLabel(element.getLabel()?.substring(0,30) + '...');
+    }
 
     return (
         <DefaultNode
diff --git a/karavan-designer/src/topology/TopologyApi.tsx 
b/karavan-designer/src/topology/TopologyApi.tsx
index ffe14098..8cca27c9 100644
--- a/karavan-designer/src/topology/TopologyApi.tsx
+++ b/karavan-designer/src/topology/TopologyApi.tsx
@@ -204,7 +204,8 @@ export function getRestNodes(tins: TopologyRestNode[]): 
NodeModel[] {
                 icon: 'rest',
                 type: 'rest',
                 step: tin.rest,
-                fileName: tin.fileName
+                fileName: tin.fileName,
+                secondaryLabel: tin.title
             }
         }
     });
diff --git a/karavan-space/src/topology/CustomNode.tsx 
b/karavan-space/src/topology/CustomNode.tsx
index 88263966..83792a0c 100644
--- a/karavan-space/src/topology/CustomNode.tsx
+++ b/karavan-space/src/topology/CustomNode.tsx
@@ -44,6 +44,9 @@ const CustomNode: React.FC<any> = observer(({ element, 
...rest }) => {
 
     const data = element.getData();
     const badge:string = data.badge?.substring(0,1).toUpperCase();
+    if (element.getLabel()?.length > 30) {
+        element.setLabel(element.getLabel()?.substring(0,30) + '...');
+    }
 
     return (
         <DefaultNode
diff --git a/karavan-space/src/topology/TopologyApi.tsx 
b/karavan-space/src/topology/TopologyApi.tsx
index ffe14098..8cca27c9 100644
--- a/karavan-space/src/topology/TopologyApi.tsx
+++ b/karavan-space/src/topology/TopologyApi.tsx
@@ -204,7 +204,8 @@ export function getRestNodes(tins: TopologyRestNode[]): 
NodeModel[] {
                 icon: 'rest',
                 type: 'rest',
                 step: tin.rest,
-                fileName: tin.fileName
+                fileName: tin.fileName,
+                secondaryLabel: tin.title
             }
         }
     });

Reply via email to