You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2023/12/14 01:53:51 UTC

(camel-karavan) 01/02: Fix #1028

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 7a7d16194822ccee8c2290ab7273c55119c9f49e
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Wed Dec 13 20:47:58 2023 -0500

    Fix #1028
---
 .../src/designer/route/property/DslPropertyField.tsx         | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/karavan-designer/src/designer/route/property/DslPropertyField.tsx b/karavan-designer/src/designer/route/property/DslPropertyField.tsx
index a7feb03c..f72db408 100644
--- a/karavan-designer/src/designer/route/property/DslPropertyField.tsx
+++ b/karavan-designer/src/designer/route/property/DslPropertyField.tsx
@@ -529,7 +529,6 @@ export function DslPropertyField(props: Props) {
     }
 
     function getInternalUriSelect(property: PropertyMeta, value: any) {
-        console.log("getInternalUriSelect", property, value)
         const selectOptions: JSX.Element[] = [];
         const urls = CamelUi.getInternalRouteUris(integration, "direct");
         urls.push(...CamelUi.getInternalRouteUris(integration, "seda"));
@@ -591,7 +590,8 @@ export function DslPropertyField(props: Props) {
     function getMultiObjectFieldProps(property: PropertyMeta, value: any, v: any, index: number, hideLabel: boolean = false) {
         return (<>
             <div className="object">
-                {value && <ObjectField property={property}
+                {v && <ObjectField property={property}
+                                   value={v}
                                        hideLabel={hideLabel}
                                        onPropertyUpdate={(f, v) => onMultiValueObjectUpdate(index, f, v)}
                 />}
@@ -619,7 +619,13 @@ export function DslPropertyField(props: Props) {
                         </Card>
                 })}
                 <Button variant="link" className="add-button"
-                        onClick={e => propertyChanged(property.name, [...value, CamelDefinitionApi.createStep(property.type, {})])}><AddIcon/>{"Add " + property.displayName}
+                        onClick={e => {
+                            const valArray = value !== null ? [...value] : [];
+                            valArray.push(CamelDefinitionApi.createStep(property.type, {}));
+                            propertyChanged(property.name, valArray);
+                        }}>
+                    <AddIcon/>
+                    {"Add " + property.displayName}
                 </Button>
             </div>
         )