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
commit bc4649f3a8858138eb22b2e84c5529bb05180c48 Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Wed Feb 21 16:31:10 2024 -0500 Convert and remove #1136 --- karavan-designer/public/example/demo.camel.yaml | 15 +++++++++++++++ .../src/designer/property/property/DslPropertyField.tsx | 16 +++++++++++++++- .../src/designer/property/property/DslPropertyField.tsx | 16 +++++++++++++++- .../src/designer/property/property/DslPropertyField.tsx | 16 +++++++++++++++- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/karavan-designer/public/example/demo.camel.yaml b/karavan-designer/public/example/demo.camel.yaml index f568f58b..b740a018 100644 --- a/karavan-designer/public/example/demo.camel.yaml +++ b/karavan-designer/public/example/demo.camel.yaml @@ -70,6 +70,21 @@ uri: direct parameters: name: second_direct + steps: + - setVariable: + id: setVariable-75ca + name: global:data1 + expression: + simple: + id: simple-009e + - convertVariableTo: + id: convertVariableTo-c0b8 + - removeVariable: + id: removeVariable-2cae + - to: + id: to-4711 + uri: metrics + # steps: # - marshal: diff --git a/karavan-designer/src/designer/property/property/DslPropertyField.tsx b/karavan-designer/src/designer/property/property/DslPropertyField.tsx index b328cf14..74b55a25 100644 --- a/karavan-designer/src/designer/property/property/DslPropertyField.tsx +++ b/karavan-designer/src/designer/property/property/DslPropertyField.tsx @@ -939,11 +939,25 @@ export function DslPropertyField(props: Props) { ) } + function getIsVariable() { + console.log(element?.dslName) + if (['variableSend', 'variableReceive'].includes(property.name)) { + return true; + } else if (property.name === 'name' && element?.dslName === 'SetVariableDefinition') { + return true; + } else if (property.name === 'name' && element?.dslName === 'RemoveVariableDefinition') { + return true + } else if (['name', 'toName'].includes(property.name) && element?.dslName === 'ConvertVariableDefinition') { + return true; + } + return false; + } + const element = props.element; const isKamelet = CamelUtil.isKameletComponent(element); const property: PropertyMeta = props.property; const value = props.value; - const isVariable = ['variableSend', 'variableReceive'].includes(property.name) + const isVariable = getIsVariable(); const beanConstructors = element?.dslName === 'RegistryBeanDefinition' && property.name === 'constructors' const beanProperties = element?.dslName === 'RegistryBeanDefinition' && property.name === 'properties' return ( diff --git a/karavan-space/src/designer/property/property/DslPropertyField.tsx b/karavan-space/src/designer/property/property/DslPropertyField.tsx index b328cf14..74b55a25 100644 --- a/karavan-space/src/designer/property/property/DslPropertyField.tsx +++ b/karavan-space/src/designer/property/property/DslPropertyField.tsx @@ -939,11 +939,25 @@ export function DslPropertyField(props: Props) { ) } + function getIsVariable() { + console.log(element?.dslName) + if (['variableSend', 'variableReceive'].includes(property.name)) { + return true; + } else if (property.name === 'name' && element?.dslName === 'SetVariableDefinition') { + return true; + } else if (property.name === 'name' && element?.dslName === 'RemoveVariableDefinition') { + return true + } else if (['name', 'toName'].includes(property.name) && element?.dslName === 'ConvertVariableDefinition') { + return true; + } + return false; + } + const element = props.element; const isKamelet = CamelUtil.isKameletComponent(element); const property: PropertyMeta = props.property; const value = props.value; - const isVariable = ['variableSend', 'variableReceive'].includes(property.name) + const isVariable = getIsVariable(); const beanConstructors = element?.dslName === 'RegistryBeanDefinition' && property.name === 'constructors' const beanProperties = element?.dslName === 'RegistryBeanDefinition' && property.name === 'properties' return ( diff --git a/karavan-web/karavan-app/src/main/webui/src/designer/property/property/DslPropertyField.tsx b/karavan-web/karavan-app/src/main/webui/src/designer/property/property/DslPropertyField.tsx index b328cf14..74b55a25 100644 --- a/karavan-web/karavan-app/src/main/webui/src/designer/property/property/DslPropertyField.tsx +++ b/karavan-web/karavan-app/src/main/webui/src/designer/property/property/DslPropertyField.tsx @@ -939,11 +939,25 @@ export function DslPropertyField(props: Props) { ) } + function getIsVariable() { + console.log(element?.dslName) + if (['variableSend', 'variableReceive'].includes(property.name)) { + return true; + } else if (property.name === 'name' && element?.dslName === 'SetVariableDefinition') { + return true; + } else if (property.name === 'name' && element?.dslName === 'RemoveVariableDefinition') { + return true + } else if (['name', 'toName'].includes(property.name) && element?.dslName === 'ConvertVariableDefinition') { + return true; + } + return false; + } + const element = props.element; const isKamelet = CamelUtil.isKameletComponent(element); const property: PropertyMeta = props.property; const value = props.value; - const isVariable = ['variableSend', 'variableReceive'].includes(property.name) + const isVariable = getIsVariable(); const beanConstructors = element?.dslName === 'RegistryBeanDefinition' && property.name === 'constructors' const beanProperties = element?.dslName === 'RegistryBeanDefinition' && property.name === 'properties' return (