Skip to content

Commit c427e69

Browse files
committed
Fix #1441
1 parent a2fc550 commit c427e69

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

karavan-app/src/main/webui/src/designer/route/element/DslElementHeader.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ export function DslElementHeader(props: Props) {
139139

140140
function hasElements(rc: RouteConfigurationDefinition): boolean {
141141
return (rc.interceptFrom !== undefined && rc.interceptFrom.length > 0)
142-
|| (rc.intercept !== undefined && rc.intercept.length > 0)
143-
|| (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0)
144-
|| (rc.onException !== undefined && rc.onException.length > 0)
145-
|| (rc.onCompletion !== undefined && rc.onCompletion.length > 0)
142+
|| (rc.intercept !== undefined && rc.intercept.length > 0)
143+
|| (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0)
144+
|| (rc.onException !== undefined && rc.onException.length > 0)
145+
|| (rc.onCompletion !== undefined && rc.onCompletion.length > 0)
146146
}
147147

148148
function getHeaderIconClasses(): string {
@@ -225,7 +225,9 @@ export function DslElementHeader(props: Props) {
225225
} else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') {
226226
return "Source";
227227
} else {
228-
return (step as any).description ? (step as any).description : CamelUi.getElementTitle(props.step);
228+
let description: string = (step as any).description;
229+
description = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description;
230+
return description ? description : CamelUi.getElementTitle(props.step);
229231
}
230232
}
231233

karavan-designer/src/designer/route/element/DslElementHeader.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ export function DslElementHeader(props: Props) {
139139

140140
function hasElements(rc: RouteConfigurationDefinition): boolean {
141141
return (rc.interceptFrom !== undefined && rc.interceptFrom.length > 0)
142-
|| (rc.intercept !== undefined && rc.intercept.length > 0)
143-
|| (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0)
144-
|| (rc.onException !== undefined && rc.onException.length > 0)
145-
|| (rc.onCompletion !== undefined && rc.onCompletion.length > 0)
142+
|| (rc.intercept !== undefined && rc.intercept.length > 0)
143+
|| (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0)
144+
|| (rc.onException !== undefined && rc.onException.length > 0)
145+
|| (rc.onCompletion !== undefined && rc.onCompletion.length > 0)
146146
}
147147

148148
function getHeaderIconClasses(): string {
@@ -225,7 +225,9 @@ export function DslElementHeader(props: Props) {
225225
} else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') {
226226
return "Source";
227227
} else {
228-
return (step as any).description ? (step as any).description : CamelUi.getElementTitle(props.step);
228+
let description: string = (step as any).description;
229+
description = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description;
230+
return description ? description : CamelUi.getElementTitle(props.step);
229231
}
230232
}
231233

karavan-space/src/designer/route/element/DslElementHeader.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ export function DslElementHeader(props: Props) {
139139

140140
function hasElements(rc: RouteConfigurationDefinition): boolean {
141141
return (rc.interceptFrom !== undefined && rc.interceptFrom.length > 0)
142-
|| (rc.intercept !== undefined && rc.intercept.length > 0)
143-
|| (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0)
144-
|| (rc.onException !== undefined && rc.onException.length > 0)
145-
|| (rc.onCompletion !== undefined && rc.onCompletion.length > 0)
142+
|| (rc.intercept !== undefined && rc.intercept.length > 0)
143+
|| (rc.interceptSendToEndpoint !== undefined && rc.interceptSendToEndpoint.length > 0)
144+
|| (rc.onException !== undefined && rc.onException.length > 0)
145+
|| (rc.onCompletion !== undefined && rc.onCompletion.length > 0)
146146
}
147147

148148
function getHeaderIconClasses(): string {
@@ -225,7 +225,9 @@ export function DslElementHeader(props: Props) {
225225
} else if (isKamelet() && step.dslName === 'FromDefinition' && (step as any).uri === 'kamelet:source') {
226226
return "Source";
227227
} else {
228-
return (step as any).description ? (step as any).description : CamelUi.getElementTitle(props.step);
228+
let description: string = (step as any).description;
229+
description = description !== undefined && description?.length > 32 ? description.substring(0, 32).concat("...") : description;
230+
return description ? description : CamelUi.getElementTitle(props.step);
229231
}
230232
}
231233

0 commit comments

Comments
 (0)