Skip to content

Commit 149739d

Browse files
committed
Fix #1437
1 parent b290b0a commit 149739d

File tree

15 files changed

+33
-60
lines changed

15 files changed

+33
-60
lines changed

karavan-app/src/main/webui/src/designer/kamelet/KameletDefinitionPropertyCard.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,12 @@ export function KameletDefinitionPropertyCard(props: Props) {
9999
const i = CamelUtil.cloneIntegration(integration);
100100
if (i.spec.definition && integration.spec.definition?.properties[key]) {
101101
const enums: string [] = i.spec.definition.properties[key].enum;
102-
console.log(enums)
103102
if (enums && Array.isArray(enums)) {
104-
console.log("isArray")
105103
const from = enums.findIndex(e => source);
106104
const to = enums.findIndex(e => dest);
107105
if (from > -1 && to > -1) {
108-
console.log("exchange");
109106
[enums[from], enums[to]] = [enums[to], enums[from]];
110107
i.spec.definition.properties[key].enum = enums;
111-
console.log("i.spec.definition.properties[key].enum", i.spec.definition.properties[key].enum);
112108
setIntegration(i, true);
113109
}
114110
}

karavan-app/src/main/webui/src/designer/property/DslProperties.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function DslProperties(props: Props) {
9595
return CamelDefinitionApiExt.getElementProperties(dslName)
9696
.filter((p: PropertyMeta) => p.name !== 'uri') // do not show uri
9797
// .filer((p: PropertyMeta) => (showAdvanced && p.label.includes('advanced')) || (!showAdvanced && !p.label.includes('advanced')))
98-
.filter((p: PropertyMeta) => !p.isObject || (p.isObject && !CamelUi.dslHasSteps(p.type)) || (dslName === 'CatchDefinition' && p.name === 'onWhen'))
98+
.filter((p: PropertyMeta) => !p.isObject || (p.isObject && !CamelUi.dslHasSteps(p.type)) || (p.name === 'onWhen'))
9999
.filter((p: PropertyMeta) => !(dslName === 'RestDefinition' && ['get', 'post', 'put', 'patch', 'delete', 'head'].includes(p.name)));
100100
// .filter((p: PropertyMeta) => dslName && !(['RestDefinition', 'GetDefinition', 'PostDefinition', 'PutDefinition', 'PatchDefinition', 'DeleteDefinition', 'HeadDefinition'].includes(dslName) && ['param', 'responseMessage'].includes(p.name))) // TODO: configure this properties
101101
}

karavan-app/src/main/webui/src/designer/property/usePropertiesHook.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ export function usePropertiesHook(designerType: 'routes' | 'rest' | 'beans' = 'r
177177
}
178178

179179
const convertStep = (step: CamelElement, targetDslName: string) => {
180-
console.log(targetDslName)
181180
try {
182181
// setSelectedStep(undefined);
183182
if (targetDslName === 'ChoiceDefinition' && step.dslName === 'FilterDefinition') {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export function DslElement(props: Props) {
183183
} else {
184184
children = children.filter(child => child.className === 'FromDefinition')
185185
}
186-
if (step.dslName === 'CatchDefinition') { // exception
186+
if (['CatchDefinition', 'OnExceptionDefinition', 'OnCompletionDefinition', 'Resilience4jConfigurationDefinition'].includes(step.dslName)) { // exception
187187
children = children.filter(value => value.name !== 'onWhen')
188188
}
189189
return (

karavan-core/src/core/api/CamelDefinitionYaml.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class CamelDefinitionYaml {
107107
if (object.constructors && CamelDefinitionYaml.isEmptyObject(object.constructors)) {
108108
delete object.constructors;
109109
}
110-
} else if (object.dslName === 'CatchDefinition' && object?.onWhen?.stepName !== undefined) {
110+
} else if (['CatchDefinition', 'OnExceptionDefinition', 'OnCompletionDefinition', 'Resilience4jConfigurationDefinition'].includes(object.dslName) && object?.onWhen?.stepName !== undefined) {
111111
object.onWhen.stepName = 'onWhen'; // https://github.com/apache/camel-karavan/issues/1420
112112
}
113113

karavan-designer/package.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@
99
"serve": "vite preview"
1010
},
1111
"proxy": "http://localhost:8080/",
12-
"eslintConfig": {
13-
"extends": [
14-
"react-app"
15-
]
16-
},
12+
"eslintConfig": {},
1713
"browserslist": {
1814
"production": [
1915
">0.2%",
@@ -51,10 +47,10 @@
5147
"@types/node": "20.14.8",
5248
"@types/react": "^18.3.5",
5349
"@types/react-dom": "^18.3.0",
54-
"@typescript-eslint/eslint-plugin": "^5.62.0",
55-
"@typescript-eslint/parser": "^5.62.0",
56-
"@vitejs/plugin-react": "^4.3.1",
57-
"eslint": "^8.57.0",
50+
"@typescript-eslint/eslint-plugin": "^8.13.0",
51+
"@typescript-eslint/parser": "^8.13.0",
52+
"@vitejs/plugin-react": "^4.3.3",
53+
"eslint": "^9.14.0",
5854
"monaco-editor": "^0.51.0",
5955
"typescript": "4.9.5",
6056
"vite": "^5.4.8",
Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
11
- route:
2-
id: route-8a40
3-
nodePrefixId: route-78f
2+
id: route-46e9
3+
nodePrefixId: route-5ec
44
from:
5-
id: from-674b
5+
id: from-f789
66
uri: timer
77
parameters:
8-
timerName: name
8+
timerName: test
99
steps:
10-
- toD:
11-
id: to-55df
12-
description: Send file
13-
uri: file
14-
parameters:
15-
directoryName: ${variable.dir}
16-
fileName: ${variable.fileName}
17-
- filter:
18-
id: filter-6e45
10+
- log:
11+
id: log-eafe
12+
message: ${body}
13+
- routeConfiguration:
14+
onException:
15+
- onException:
16+
id: onException-6e74
17+
exception:
18+
- java.lang.NullPointerException
19+
onWhen:
20+
id: when-5940
1921
expression:
2022
groovy:
21-
id: groovy-672e
22-
- choice:
23-
id: choice-c008
24-
when:
25-
- id: when-5e7a
26-
expression:
27-
groovy:
28-
id: groovy-d744
29-
otherwise:
30-
id: otherwise-a012
31-
- to:
32-
id: to-5276
33-
uri: aws-bedrock-agent-runtime
34-
- toD:
35-
id: to-f1dd
36-
uri: sql
23+
id: groovy-d30d
24+
expression: "true"
25+
steps:
26+
- log:
27+
id: log-eae0
28+
message: error

karavan-designer/src/designer/kamelet/KameletDefinitionPropertyCard.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,12 @@ export function KameletDefinitionPropertyCard(props: Props) {
9999
const i = CamelUtil.cloneIntegration(integration);
100100
if (i.spec.definition && integration.spec.definition?.properties[key]) {
101101
const enums: string [] = i.spec.definition.properties[key].enum;
102-
console.log(enums)
103102
if (enums && Array.isArray(enums)) {
104-
console.log("isArray")
105103
const from = enums.findIndex(e => source);
106104
const to = enums.findIndex(e => dest);
107105
if (from > -1 && to > -1) {
108-
console.log("exchange");
109106
[enums[from], enums[to]] = [enums[to], enums[from]];
110107
i.spec.definition.properties[key].enum = enums;
111-
console.log("i.spec.definition.properties[key].enum", i.spec.definition.properties[key].enum);
112108
setIntegration(i, true);
113109
}
114110
}

karavan-designer/src/designer/property/DslProperties.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function DslProperties(props: Props) {
9595
return CamelDefinitionApiExt.getElementProperties(dslName)
9696
.filter((p: PropertyMeta) => p.name !== 'uri') // do not show uri
9797
// .filer((p: PropertyMeta) => (showAdvanced && p.label.includes('advanced')) || (!showAdvanced && !p.label.includes('advanced')))
98-
.filter((p: PropertyMeta) => !p.isObject || (p.isObject && !CamelUi.dslHasSteps(p.type)) || (dslName === 'CatchDefinition' && p.name === 'onWhen'))
98+
.filter((p: PropertyMeta) => !p.isObject || (p.isObject && !CamelUi.dslHasSteps(p.type)) || (p.name === 'onWhen'))
9999
.filter((p: PropertyMeta) => !(dslName === 'RestDefinition' && ['get', 'post', 'put', 'patch', 'delete', 'head'].includes(p.name)));
100100
// .filter((p: PropertyMeta) => dslName && !(['RestDefinition', 'GetDefinition', 'PostDefinition', 'PutDefinition', 'PatchDefinition', 'DeleteDefinition', 'HeadDefinition'].includes(dslName) && ['param', 'responseMessage'].includes(p.name))) // TODO: configure this properties
101101
}

karavan-designer/src/designer/property/usePropertiesHook.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ export function usePropertiesHook(designerType: 'routes' | 'rest' | 'beans' = 'r
177177
}
178178

179179
const convertStep = (step: CamelElement, targetDslName: string) => {
180-
console.log(targetDslName)
181180
try {
182181
// setSelectedStep(undefined);
183182
if (targetDslName === 'ChoiceDefinition' && step.dslName === 'FilterDefinition') {

0 commit comments

Comments
 (0)