Skip to content

Commit

Permalink
chore(Canvas): Remove # handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lordrip committed Nov 20, 2024
1 parent 6ca0ca7 commit 9c3c341
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import catalogLibrary from '@kaoto/camel-catalog/index.json';
import { CatalogLibrary, ProcessorDefinition } from '@kaoto/camel-catalog/types';
import { getFirstCatalogMap } from '../../../../stubs/test-load-catalog';
import { ROOT_PATH } from '../../../../utils';
import { ICamelProcessorDefinition } from '../../../camel-processors-catalog';
import { CatalogKind } from '../../../catalog-kind';
import { NodeLabelType } from '../../../settings/settings.model';
Expand Down Expand Up @@ -65,7 +64,7 @@ describe('CamelComponentSchemaService', () => {

it('should build the appropriate schema for `route` entity', () => {
const camelCatalogServiceSpy = jest.spyOn(CamelCatalogService, 'getComponent');
const rootPath = ROOT_PATH;
const rootPath = 'route';
const routeDefinition = {
id: 'route-1234',
from: {
Expand Down Expand Up @@ -282,7 +281,8 @@ describe('CamelComponentSchemaService', () => {

describe('getCamelComponentLookup', () => {
it.each([
[ROOT_PATH, { from: { uri: 'timer' } }, { processorName: 'route' }],
['route', { from: { uri: 'timer' } }, { processorName: 'route' }],
['intercept', { id: 'intercept-8888', steps: [] }, { processorName: 'intercept' }],
['from', { uri: 'timer' }, { processorName: 'from', componentName: 'timer' }],
['from.steps.0.to', { uri: 'log' }, { processorName: 'to', componentName: 'log' }],
['from.steps.1.toD', { uri: 'log' }, { processorName: 'toD', componentName: 'log' }],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ProcessorDefinition } from '@kaoto/camel-catalog/types';
import cloneDeep from 'lodash/cloneDeep';
import { CamelUriHelper, ParsedParameters, ROOT_PATH, getValue, isDefined } from '../../../../utils';
import { CamelUriHelper, ParsedParameters, getValue, isDefined } from '../../../../utils';
import { ICamelComponentDefinition } from '../../../camel-components-catalog';
import { CatalogKind } from '../../../catalog-kind';
import { IKameletDefinition } from '../../../kamelets-catalog';
Expand Down Expand Up @@ -44,11 +44,6 @@ export class CamelComponentSchemaService {
const lastPathSegment = splitPath[splitPath.length - 1];
const pathAsIndex = Number.parseInt(lastPathSegment, 10);

/** If path is `#` it means the root of the Camel Route */
if (path === ROOT_PATH) {
return { processorName: 'route' as keyof ProcessorDefinition };
}

/**
* If the last path segment is NaN, it means this is a Camel Processor
* for instance, `from`, `otherwise` or `to` properties in a Route
Expand Down

0 comments on commit 9c3c341

Please sign in to comment.