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 2022/02/08 15:13:22 UTC

[camel-karavan] branch main updated: Component properties with type 'object' and enum LoV (#180)

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


The following commit(s) were added to refs/heads/main by this push:
     new a480e88  Component properties with type 'object' and enum LoV (#180)
a480e88 is described below

commit a480e88798b574c736390ae3a4eb29dd13e2ec53
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Tue Feb 8 10:12:30 2022 -0500

    Component properties with type 'object' and enum LoV (#180)
---
 karavan-core/src/core/api/ComponentApi.ts                       | 1 +
 karavan-designer/public/components/cxf.json                     | 1 +
 karavan-designer/src/App.tsx                                    | 1 +
 karavan-designer/src/designer/field/ComponentParameterField.tsx | 2 +-
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/karavan-core/src/core/api/ComponentApi.ts b/karavan-core/src/core/api/ComponentApi.ts
index a003650..347ddd1 100644
--- a/karavan-core/src/core/api/ComponentApi.ts
+++ b/karavan-core/src/core/api/ComponentApi.ts
@@ -175,6 +175,7 @@ export const ComponentApi = {
                     prop.kind = value.kind;
                     if (value.defaultValue) prop.defaultValue = value.defaultValue
                     if (!value.deprecated && value.type !== 'object') properties.push(prop);
+                    if (!value.deprecated && value.type === 'object' && value.enum) properties.push(prop);
                 })
             }
         } finally {
diff --git a/karavan-designer/public/components/cxf.json b/karavan-designer/public/components/cxf.json
new file mode 100644
index 0000000..59943d8
--- /dev/null
+++ b/karavan-designer/public/components/cxf.json
@@ -0,0 +1 @@
+{"component":{"kind":"component","name":"cxf","title":"CXF","description":"Expose SOAP WebServices using Apache CXF or connect to external WebServices using CXF WS client.","deprecated":false,"firstVersion":"1.0.0","label":"soap,webservice","javaType":"org.apache.camel.component.cxf.CxfComponent","supportLevel":"Stable","groupId":"org.apache.camel","artifactId":"camel-cxf","version":"3.15.0","scheme":"cxf","extendsScheme":"","syntax":"cxf:beanId:address","async":true,"api":false,"consume [...]
\ No newline at end of file
diff --git a/karavan-designer/src/App.tsx b/karavan-designer/src/App.tsx
index c18ac30..3d29a5e 100644
--- a/karavan-designer/src/App.tsx
+++ b/karavan-designer/src/App.tsx
@@ -109,6 +109,7 @@ class App extends React.Component<Props, State> {
             "netty-http.json",
             "jms.json",
             "sql.json",
+            "cxf.json",
             "file.json",
             "log.json",
             "coap+tcp.json",
diff --git a/karavan-designer/src/designer/field/ComponentParameterField.tsx b/karavan-designer/src/designer/field/ComponentParameterField.tsx
index d5a1342..85cce99 100644
--- a/karavan-designer/src/designer/field/ComponentParameterField.tsx
+++ b/karavan-designer/src/designer/field/ComponentParameterField.tsx
@@ -91,7 +91,7 @@ export class ComponentParameterField extends React.Component<Props, State> {
                     value={value !== undefined ? value : property.defaultValue}
                     onChange={e => this.parametersChanged(property.name, ['integer', 'int', 'number'].includes(property.type) ? Number(e) : e, property.kind === 'path')}/>
                 }
-                {property.type === 'string' && property.enum &&
+                {['string', 'object'].includes(property.type) && property.enum &&
                 <Select
                     variant={SelectVariant.single}
                     aria-label={property.name}