Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RouteConfiguration): Add support for RouteConfiguration entity #1011

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/ui/src/models/camel/camel-route-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import { createCamelPropertiesSorter, isDefined } from '../../utils';
import { AddStepMode } from '../visualization/base-visual-entity';
import { CamelRouteVisualEntity, isCamelFrom, isCamelRoute } from '../visualization/flows';
import { CamelErrorHandlerVisualEntity } from '../visualization/flows/camel-error-handler-visual-entity';
import { CamelInterceptFromVisualEntity } from '../visualization/flows/camel-intercept-from-visual-entity';
import { CamelInterceptSendToEndpointVisualEntity } from '../visualization/flows/camel-intercept-send-to-endpoint-visual-entity';
import { CamelInterceptVisualEntity } from '../visualization/flows/camel-intercept-visual-entity';
import { CamelOnCompletionVisualEntity } from '../visualization/flows/camel-on-completion-visual-entity';
import { CamelOnExceptionVisualEntity } from '../visualization/flows/camel-on-exception-visual-entity';
import { CamelRestConfigurationVisualEntity } from '../visualization/flows/camel-rest-configuration-visual-entity';
import { CamelRouteConfigurationVisualEntity } from '../visualization/flows/camel-route-configuration-visual-entity';
import { NonVisualEntity } from '../visualization/flows/non-visual-entity';
import { CamelComponentFilterService } from '../visualization/flows/support/camel-component-filter.service';
import { CamelRouteVisualEntityData } from '../visualization/flows/support/camel-component-types';
Expand All @@ -18,8 +23,13 @@ import { SourceSchemaType } from './source-schema-type';
export class CamelRouteResource implements CamelResource, BeansAwareResource {
static readonly SUPPORTED_ENTITIES = [
CamelOnExceptionVisualEntity,
CamelOnCompletionVisualEntity,
CamelErrorHandlerVisualEntity,
CamelRestConfigurationVisualEntity,
CamelRouteConfigurationVisualEntity,
CamelInterceptVisualEntity,
CamelInterceptFromVisualEntity,
CamelInterceptSendToEndpointVisualEntity,
] as const;
static readonly PARAMETERS_ORDER = ['id', 'description', 'uri', 'parameters', 'steps'];
readonly sortFn = createCamelPropertiesSorter(CamelRouteResource.PARAMETERS_ORDER) as (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -32,7 +32,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -44,7 +44,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -68,7 +68,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -80,7 +80,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{
processorName: 'interceptSendToEndpoint',
path: 'interceptSendToEndpoint'
}' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'from', path: 'from' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'intercept', path: 'intercept' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'interceptFrom', path: 'interceptFrom' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": true,
"canRemoveStep": false,
"canReplaceStep": false,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'log', path: 'log' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onCompletion', path: 'onCompletion' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onException', path: 'onException' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'route', path: 'route' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'to', path: 'to' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity should serialize the entity 1`] = `
{
"interceptFrom": {
"id": "interceptFrom-1234",
"uri": "direct:a-reference",
},
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{
processorName: 'interceptSendToEndpoint',
path: 'interceptSendToEndpoint'
}' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": true,
"canRemoveStep": false,
"canReplaceStep": false,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'from', path: 'from' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'intercept', path: 'intercept' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'interceptFrom', path: 'interceptFrom' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'log', path: 'log' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onCompletion', path: 'onCompletion' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onException', path: 'onException' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'route', path: 'route' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'to', path: 'to' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity should serialize the entity 1`] = `
{
"interceptSendToEndpoint": {
"id": "interceptSendToEndpoint-1234",
"uri": "direct:a-reference",
},
}
`;
Loading
Loading