Skip to content

Commit

Permalink
Fix #1441
Browse files Browse the repository at this point in the history
  • Loading branch information
mgubaidullin committed Oct 17, 2024
1 parent a2fc550 commit c427e69
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}

Expand Down
12 changes: 7 additions & 5 deletions karavan-designer/src/designer/route/element/DslElementHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}

Expand Down
12 changes: 7 additions & 5 deletions karavan-space/src/designer/route/element/DslElementHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit c427e69

Please sign in to comment.