Skip to content

Commit 038665e

Browse files
authored
Merge branch 'main' into e2e_catalog_versions
2 parents 82f5221 + 6da8b04 commit 038665e

36 files changed

+902
-380
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kaoto",
3-
"version": "2.4.0-dev",
3+
"version": "2.5.0-dev",
44
"description": "Kaoto - The Integration Designer for Apache Camel",
55
"repository": "https://github.com/KaotoIO/kaoto",
66
"author": "The Kaoto Team",
@@ -10,12 +10,12 @@
1010
],
1111
"resolutions": {
1212
"@patternfly/patternfly": "5.4.2",
13-
"@patternfly/react-code-editor": "5.4.11",
14-
"@patternfly/react-core": "5.4.8",
13+
"@patternfly/react-code-editor": "5.4.15",
14+
"@patternfly/react-core": "5.4.12",
1515
"@patternfly/react-icons": "5.4.2",
16-
"@patternfly/react-table": "5.4.9",
16+
"@patternfly/react-table": "5.4.13",
1717
"@patternfly/react-topology": "5.4.1",
18-
"axios": "1.7.7",
18+
"axios": "1.7.9",
1919
"react": "18.3.1",
2020
"react-dom": "18.3.1",
2121
"prettier": "3.3.3",

packages/catalog-generator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kaoto/camel-catalog",
3-
"version": "2.4.0-dev",
3+
"version": "2.5.0-dev",
44
"type": "commonjs",
55
"description": "Camel Catalog and schemas for Kaoto",
66
"repository": "https://github.com/KaotoIO/kaoto",

packages/catalog-generator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<version.camel.quarkus>3.15.0</version.camel.quarkus>
2121
<version.camel-kamelets>4.8.0</version.camel-kamelets>
2222
<version.jackson>2.17.2</version.jackson>
23-
<version.junit>5.11.3</version.junit>
23+
<version.junit>5.11.4</version.junit>
2424
<version.kubernetes-model>6.13.4</version.kubernetes-model>
2525
<version.maven-enforcer-plugin>3.5.0</version.maven-enforcer-plugin>
2626
<version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>

packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessor.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public String getDataFormatCatalog() throws Exception {
217217
eipModelOptions = eipModel.getOptions();
218218
}
219219

220-
sortPropertiesAccordingToCamelCatalog(dataFormatSchema, eipModelOptions);
220+
sortPropertiesAccordingToCamelCatalog(dataFormatSchema, eipModelOptions);
221221

222222
var dataFormatCatalog = (EipModel) camelCatalog.model(Kind.eip, dataFormatName);
223223
if (dataFormatCatalog == null) {
@@ -260,7 +260,7 @@ public String getLanguageCatalog() throws Exception {
260260
eipModelOptions = eipModel.getOptions();
261261
}
262262

263-
sortPropertiesAccordingToCamelCatalog(languageSchema, eipModelOptions);
263+
sortPropertiesAccordingToCamelCatalog(languageSchema, eipModelOptions);
264264

265265
var languageCatalog = (EipModel) camelCatalog.model(Kind.eip, languageName);
266266
if (languageCatalog == null) {
@@ -362,12 +362,17 @@ public String getPatternCatalog() throws Exception {
362362
continue;
363363
}
364364

365+
sortedSchemaProperties.set(propertyName, propertySchema);
366+
365367
var catalogOpOptional = eipModel.getOptions().stream()
366368
.filter(op -> op.getName().equals(propertyName)).findFirst();
369+
367370
if (catalogOpOptional.isEmpty()) {
368-
throw new Exception(
371+
LOGGER.warning(
369372
String.format("Option '%s' not found for processor '%s'", propertyName, processorFQCN));
373+
continue;
370374
}
375+
371376
var catalogOp = catalogOpOptional.get();
372377
if ("object".equals(catalogOp.getType()) && !catalogOp.getJavaType().startsWith("java.util.Map")
373378
&& !propertySchema.has("$comment")) {
@@ -383,8 +388,6 @@ public String getPatternCatalog() throws Exception {
383388
} else if (catalogOp.getGroup() != null) {
384389
propertySchema.put("group", catalogOp.getGroup());
385390
}
386-
387-
sortedSchemaProperties.set(propertyName, propertySchema);
388391
}
389392

390393
var json = JsonMapper.asJsonObject(eipModel).toJson();

packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generator/CamelYamlDslSchemaProcessor.java

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class CamelYamlDslSchemaProcessor {
3232
private static final String PROCESSOR_DEFINITION = "org.apache.camel.model.ProcessorDefinition";
3333
private static final String TOKENIZER_DEFINITION = "org.apache.camel.model.TokenizerDefinition";
3434
private static final String ROUTE_CONFIGURATION_DEFINITION = "org.apache.camel.model.RouteConfigurationDefinition";
35+
private static final String REST_DEFINITION = "org.apache.camel.model.rest.RestDefinition";
3536
private static final String LOAD_BALANCE_DEFINITION = "org.apache.camel.model.LoadBalanceDefinition";
3637
private static final String EXPRESSION_SUB_ELEMENT_DEFINITION =
3738
"org.apache.camel.model.ExpressionSubElementDefinition";
@@ -58,7 +59,20 @@ public class CamelYamlDslSchemaProcessor {
5859
"org.apache.camel.model.ToDefinition",
5960
List.of("uri", "parameters"),
6061
"org.apache.camel.model.WireTapDefinition",
61-
List.of("uri", "parameters"));
62+
List.of("uri", "parameters"),
63+
"org.apache.camel.model.rest.GetDefinition",
64+
List.of("to"),
65+
"org.apache.camel.model.rest.PostDefinition",
66+
List.of("to"),
67+
"org.apache.camel.model.rest.PutDefinition",
68+
List.of("to"),
69+
"org.apache.camel.model.rest.DeleteDefinition",
70+
List.of("to"),
71+
"org.apache.camel.model.rest.HeadDefinition",
72+
List.of("to"),
73+
"org.apache.camel.model.rest.PatchDefinition",
74+
List.of("to"));
75+
6276
private final List<String> processorReferenceBlockList = List.of(PROCESSOR_DEFINITION);
6377

6478
public CamelYamlDslSchemaProcessor(ObjectMapper mapper, ObjectNode yamlDslSchema) throws Exception {
@@ -269,6 +283,7 @@ public Map<String, ObjectNode> getProcessors() throws Exception {
269283
.withObject(PROCESSOR_DEFINITION)
270284
.withObject("/properties");
271285
addRouteConfigurationProcessors(relocatedDefinitions, processors);
286+
addRestProcessors(relocatedDefinitions, processors);
272287

273288
var answer = new LinkedHashMap<String, ObjectNode>();
274289
for (var processorEntry : processors) {
@@ -354,6 +369,24 @@ private void addRouteConfigurationProcessors(ObjectNode relocatedDefinitions, Ob
354369
processors.setAll(onCompletionProcessor);
355370
}
356371

372+
private void addRestProcessors(ObjectNode relocatedDefinitions, ObjectNode processors) {
373+
var restProcessor = relocatedDefinitions
374+
.withObject(REST_DEFINITION)
375+
.withObject("/properties");
376+
var restGetProcessor = restProcessor.withObject("get").withObject("items");
377+
var restPostProcessor = restProcessor.withObject("post").withObject("items");
378+
var restPutProcessor = restProcessor.withObject("put").withObject("items");
379+
var restDeleteProcessor = restProcessor.withObject("delete").withObject("items");
380+
var restHeadProcessor = restProcessor.withObject("head").withObject("items");
381+
var restPatchProcessor = restProcessor.withObject("patch").withObject("items");
382+
processors.set("get", restGetProcessor);
383+
processors.set("post", restPostProcessor);
384+
processors.set("put", restPutProcessor);
385+
processors.set("delete", restDeleteProcessor);
386+
processors.set("head", restHeadProcessor);
387+
processors.set("patch", restPatchProcessor);
388+
}
389+
357390
private ObjectNode extractFromOneOf(String name, ObjectNode definition) throws Exception {
358391
if (!definition.has("oneOf")) {
359392
return definition;

packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generator/CamelCatalogProcessorTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,35 @@ void testGetDataFormatCatalog() throws Exception {
175175
assertEquals(1, customPropertiesSchemaRequiredFields.size(), "Size should be 1");
176176
}
177177

178+
@Test
179+
void testRestProcessors() throws Exception {
180+
var restGetProcessorSchema = processorCatalog
181+
.withObject("/get")
182+
.withObject("propertiesSchema");
183+
var restPostProcessorSchema = processorCatalog
184+
.withObject("/post")
185+
.withObject("propertiesSchema");
186+
var restPutProcessorSchema = processorCatalog
187+
.withObject("/put")
188+
.withObject("propertiesSchema");
189+
var restDeleteProcessorSchema = processorCatalog
190+
.withObject("/delete")
191+
.withObject("propertiesSchema");
192+
var restHeadProcessorSchema = processorCatalog
193+
.withObject("/head")
194+
.withObject("propertiesSchema");
195+
var restPatchProcessorSchema = processorCatalog
196+
.withObject("/patch")
197+
.withObject("propertiesSchema");
198+
199+
assertFalse(restGetProcessorSchema.isEmpty(), "get processor schema should not be empty");
200+
assertFalse(restPostProcessorSchema.isEmpty(), "post processor schema should not be empty");
201+
assertFalse(restPutProcessorSchema.isEmpty(), "put processor schema should not be empty");
202+
assertFalse(restDeleteProcessorSchema.isEmpty(), "delete processor schema should not be empty");
203+
assertFalse(restHeadProcessorSchema.isEmpty(), "head processor schema should not be empty");
204+
assertFalse(restPatchProcessorSchema.isEmpty(), "patch processor schema should not be empty");
205+
}
206+
178207
@Test
179208
void testDataFormatEnumParameter() throws Exception {
180209
checkEnumParameters(dataFormatCatalog);

packages/ui-tests/cypress/e2e/codeEditor/sourceCodeActions.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ describe('Test source code editor', () => {
66
it('loads the YAML editor and deletes steps, check with visualization', () => {
77
cy.uploadFixture('flows/kameletBinding/kafkaSourceSink.yaml');
88
cy.openDesignPage();
9-
cy.get('[data-id^="json-deserialize-action"]').should('exist');
9+
cy.get('[data-id^="Updated integration|steps.0"]').should('exist');
1010
cy.openSourceCode();
1111
cy.editorDeleteLine(19, 5);
1212

1313
// CHECK that the code editor contains the new timer source step
1414
cy.openDesignPage();
15-
cy.checkNodeExist('json-deserialize-action', 0);
15+
cy.checkNodeExist('Updated integration|steps.0', 0);
1616
});
1717

1818
it('User adds step to the YAML', () => {
@@ -36,7 +36,7 @@ describe('Test source code editor', () => {
3636
cy.editorDeleteLine(12, 6);
3737
cy.openDesignPage();
3838
// CHECK the kafka-sink step was removed
39-
cy.checkNodeExist('kafka-sink', 0);
39+
cy.checkNodeExist('integration|kafka-sink', 0);
4040
});
4141

4242
it('User edits step in the YAML', () => {

packages/ui-tests/cypress/e2e/designer/branchingFlows/branchingStepAddition.cy.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ describe('Test for Branching actions from the canvas', () => {
6262

6363
cy.checkNodeExist('activemq', 1);
6464
cy.checkEdgeExists(
65+
'eip-action',
6566
'template.from.steps.1.choice.when.0.steps.1.setHeader',
6667
'template.from.steps.1.choice.when.0.steps.2.to',
6768
);
@@ -77,6 +78,7 @@ describe('Test for Branching actions from the canvas', () => {
7778

7879
cy.checkNodeExist('activemq', 1);
7980
cy.checkEdgeExists(
81+
'eip-action',
8082
'template.from.steps.1.choice.when.0.steps.0.to',
8183
'template.from.steps.1.choice.when.0.steps.1.to',
8284
);
@@ -91,6 +93,6 @@ describe('Test for Branching actions from the canvas', () => {
9193
cy.chooseFromCatalog('component', 'activemq');
9294

9395
cy.checkNodeExist('activemq', 1);
94-
cy.checkEdgeExists('template.from.steps.2.to', 'template.from.steps.3.filter');
96+
cy.checkEdgeExists('eip-action', 'template.from.steps.2.to', 'template.from.steps.3.filter');
9597
});
9698
});

packages/ui-tests/cypress/e2e/designer/propsWarnings/mandatoryPropsWarnings.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('Test for missing config props canvas warnings', () => {
3030
cy.uploadFixture('flows/pipe/errorHandler.yaml');
3131
cy.openDesignPage();
3232

33-
cy.get('[data-id^="webhook-binding|delay-action"] g')
33+
cy.get('[data-id^="webhook-binding"] g[data-nodelabel="delay-action"]')
3434
.find('span[data-warning="true"].pf-v5-c-icon')
3535
.should('have.attr', 'title', '1 required parameter is not yet configured: [ milliseconds ]');
3636

@@ -39,7 +39,7 @@ describe('Test for missing config props canvas warnings', () => {
3939
cy.interactWithConfigInputObject('milliseconds', '1000');
4040
cy.closeStepConfigurationTab();
4141

42-
cy.get('[data-id^="webhook-binding|delay-action"] g')
42+
cy.get('[data-id^="webhook-binding"] g[data-nodelabel="delay-action"]')
4343
.find('span[data-warning="true"].pf-v5-c-icon')
4444
.should('not.exist');
4545
});

packages/ui-tests/cypress/support/cypress.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ declare global {
6161
selectRemoveGroup(groupName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
6262
performNodeAction(nodeName: string, action: ActionType, nodeIndex?: number): Chainable<JQuery<Element>>;
6363
checkNodeExist(inputName: string, nodesCount: number): Chainable<JQuery<Element>>;
64-
checkEdgeExists(sourceName: string, targetName: string): Chainable<JQuery<Element>>;
64+
checkEdgeExists(scope: string, sourceName: string, targetName: string): Chainable<JQuery<Element>>;
6565
deleteBranch(branchIndex: number): Chainable<JQuery<Element>>;
6666
selectCamelRouteType(type: string, subType?: string): Chainable<JQuery<Element>>;
6767
selectRuntimeVersion(type: string): Chainable<JQuery<Element>>;

packages/ui-tests/cypress/support/next-commands/design.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ Cypress.Commands.add('checkNodeExist', (inputName, nodesCount) => {
105105
cy.get(`foreignObject[data-nodelabel="${inputName}"]`).should('have.length', nodesCount);
106106
});
107107

108-
Cypress.Commands.add('checkEdgeExists', (sourceName: string, targetName: string) => {
109-
const idPattern = `${sourceName} >>> ${targetName}`;
108+
Cypress.Commands.add('checkEdgeExists', (scope: string, sourceName: string, targetName: string) => {
109+
const idPattern = `${scope}|${sourceName} >>> ${targetName}`;
110110
// Check if an element with the matching id exists
111111
cy.get('g').should(($elements) => {
112112
// Use Cypress commands to check if any element matches the id pattern

packages/ui-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@kaoto/kaoto-tests",
33
"private": true,
4-
"version": "2.4.0-dev",
4+
"version": "2.5.0-dev",
55
"type": "module",
66
"description": "Kaoto UI tests and storybook",
77
"repository": "https://github.com/KaotoIO/kaoto",

packages/ui-tests/stories/settings/SettingsForm.stories.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import { SettingsForm } from '@kaoto/kaoto';
22
import { SettingsProvider, ReloadContext, DefaultSettingsAdapter } from '@kaoto/kaoto/testing';
33
import { Meta, StoryFn } from '@storybook/react';
4+
import { reactRouterOutlet, reactRouterParameters, withRouter } from 'storybook-addon-remix-react-router';
45

56
export default {
67
title: 'Settings/SettingsForm',
8+
decorators: [withRouter],
9+
parameters: {
10+
reactRouter: reactRouterParameters({
11+
routing: reactRouterOutlet({
12+
path: '*',
13+
}),
14+
}),
15+
},
716
component: SettingsForm,
817
} as Meta<typeof SettingsForm>;
918

packages/ui/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kaoto/kaoto",
3-
"version": "2.4.0-dev",
3+
"version": "2.5.0-dev",
44
"type": "module",
55
"description": "Kaoto UI",
66
"repository": "https://github.com/KaotoIO/kaoto",
@@ -96,10 +96,10 @@
9696
"@eslint/js": "^9.10.0",
9797
"@kaoto/camel-catalog": "workspace:*",
9898
"@patternfly/patternfly": "5.4.2",
99-
"@patternfly/react-code-editor": "5.4.11",
100-
"@patternfly/react-core": "5.4.8",
99+
"@patternfly/react-code-editor": "5.4.15",
100+
"@patternfly/react-core": "5.4.12",
101101
"@patternfly/react-icons": "5.4.2",
102-
"@patternfly/react-table": "5.4.9",
102+
"@patternfly/react-table": "5.4.13",
103103
"@patternfly/react-topology": "5.4.1",
104104
"@swc/core": "^1.7.14",
105105
"@swc/jest": "^0.2.36",

packages/ui/src/assets/settingsSchema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"type": "object",
44
"additionalProperties": false,
55
"description": "JSON Schema for Kaoto configuration",
@@ -20,7 +20,7 @@
2020
},
2121
"nodeToolbarTrigger": {
2222
"title": "Open Node toolbar",
23-
"description": "Choose when to open the Node toolbar. Can be either `onHover` or `onSelection`. If `onHover` is selected, the toolbar will be automatically open upon hoevring a node, otherwise, it will be open when selecting a node",
23+
"description": "Choose when to open the Node toolbar. Can be either `onHover` or `onSelection`. If `onHover` is selected, the toolbar will be automatically open upon hovering a node, otherwise, it will be open when selecting a node",
2424
"default": "onHover",
2525
"type": "string",
2626
"enum": ["onHover", "onSelection"]

0 commit comments

Comments
 (0)