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 2024/03/26 14:47:01 UTC
(camel-karavan) branch main updated: Fix #1199
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 5f085a81 Fix #1199
5f085a81 is described below
commit 5f085a8136887321d907d4cd5a05a3313edcab8b
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Tue Mar 26 10:46:45 2024 -0400
Fix #1199
---
.../public/example/plc4x-ads-source.kamelet.yaml | 42 ++++++++++++++++++++++
karavan-designer/src/App.tsx | 2 ++
karavan-vscode/package.json | 4 +--
karavan-vscode/src/utils.ts | 2 +-
4 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/karavan-designer/public/example/plc4x-ads-source.kamelet.yaml b/karavan-designer/public/example/plc4x-ads-source.kamelet.yaml
new file mode 100644
index 00000000..fff5bdb8
--- /dev/null
+++ b/karavan-designer/public/example/plc4x-ads-source.kamelet.yaml
@@ -0,0 +1,42 @@
+apiVersion: camel.apache.org/v1
+kind: Kamelet
+metadata:
+ name: plc4x-ads-source
+ annotations:
+ camel.apache.org/kamelet.support.level: Preview
+ camel.apache.org/catalog.version: '1.0'
+ camel.apache.org/kamelet.icon: >-
+ data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
+ fill='%23000000' viewBox='0 0 32 32'
+ id='icon'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:none;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3Eapplication%3C/title%3E%3Cpath
+ d='M16,18H6a2,2,0,0,1-2-2V6A2,2,0,0,1,6,4H16a2,2,0,0,1,2,2V16A2,2,0,0,1,16,18ZM6,6V16H16V6Z'
+ transform='translate(0 0)'/%3E%3Cpath
+ d='M26,12v4H22V12h4m0-2H22a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V12a2,2,0,0,0-2-2Z'
+ transform='translate(0 0)'/%3E%3Cpath
+ d='M26,22v4H22V22h4m0-2H22a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V22a2,2,0,0,0-2-2Z'
+ transform='translate(0 0)'/%3E%3Cpath
+ d='M16,22v4H12V22h4m0-2H12a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V22a2,2,0,0,0-2-2Z'
+ transform='translate(0 0)'/%3E%3Cg id='_Transparent_Rectangle_'
+ data-name='<Transparent Rectangle>'%3E%3Crect class='cls-1'
+ width='32' height='32'/%3E%3C/g%3E%3C/svg%3E
+ camel.apache.org/provider: Apache Software Foundation
+ camel.apache.org/kamelet.group: PLC4X
+ camel.apache.org/kamelet.namespace: IoT
+ labels:
+ camel.apache.org/kamelet.type: source
+spec:
+ definition:
+ title: Beckhoff TwinCat ADS
+ description: Beckhoff TwinCat ADS
+ required: []
+ type: object
+ properties: {}
+ types:
+ in:
+ mediaType: ''
+ out:
+ mediaType: ''
+ dependencies:
+ - camel:plc4x
+ template:
+ route: {}
diff --git a/karavan-designer/src/App.tsx b/karavan-designer/src/App.tsx
index 331aa343..b6b5e9e6 100644
--- a/karavan-designer/src/App.tsx
+++ b/karavan-designer/src/App.tsx
@@ -73,6 +73,7 @@ export function App() {
fetch("example/demo.camel.yaml"),
// fetch("components/blocked-components.properties"),
// fetch("kamelets/blocked-kamelets.properties")
+ // fetch("example/plc4x-ads-source.kamelet.yaml")
// fetch("example/aws-cloudwatch-sink.kamelet.yaml")
// fetch("example/aws-s3-cdc-source.kamelet.yaml")
//fetch("components/supported-components.json"),
@@ -95,6 +96,7 @@ export function App() {
if (data[4]) {
setYaml(data[4]);
+ // setName("plc4x-ads-source.kamelet.yaml");
setName("demo.camel.yaml");
}
if (data[5]) {
diff --git a/karavan-vscode/package.json b/karavan-vscode/package.json
index ba601ee4..944fc6fe 100644
--- a/karavan-vscode/package.json
+++ b/karavan-vscode/package.json
@@ -568,7 +568,7 @@
},
{
"command": "karavan.open",
- "when": "resourceFilename =~ /.camel.yaml$/",
+ "when": "resourceFilename =~ /.camel.yaml$/ || resourceFilename =~ /.kamelet.yaml$/",
"group": "karavan@4"
},
{
@@ -600,7 +600,7 @@
"editor/title": [
{
"command": "karavan.open",
- "when": "resourceFilename =~ /.camel.yaml$/",
+ "when": "resourceFilename =~ /.camel.yaml$/ || resourceFilename =~ /.kamelet.yaml$/",
"group": "navigation@1"
},
{
diff --git a/karavan-vscode/src/utils.ts b/karavan-vscode/src/utils.ts
index 9a5789b3..a6d2ee17 100644
--- a/karavan-vscode/src/utils.ts
+++ b/karavan-vscode/src/utils.ts
@@ -221,7 +221,7 @@ export async function readJavaCode(fullPath: string) {
export function parceYaml(filename: string, yaml: string): [boolean, string?] {
const i = CamelDefinitionYaml.yamlToIntegration(filename, yaml);
- if (i.kind === 'Integration' && i.metadata.name) {
+ if ((i.kind === 'Integration' || i.kind === 'Kamelet') && i.metadata.name) {
return [true, yaml];
} else {
return [false, undefined];