{props.catalogLayout == CatalogLayout.List && (
)}
{props.catalogLayout == CatalogLayout.Gallery && (
- {props.tiles?.map((tile) => (
+ {paginatedCards.map((tile) => (
))}
diff --git a/packages/ui/src/components/Catalog/Catalog.models.ts b/packages/ui/src/components/Catalog/Catalog.models.ts
index 32a1ee56e..1d6325c97 100644
--- a/packages/ui/src/components/Catalog/Catalog.models.ts
+++ b/packages/ui/src/components/Catalog/Catalog.models.ts
@@ -7,8 +7,6 @@ export interface ITile {
tags: string[];
version?: string;
provider?: string;
- /** @deprecated Please relay on name property instead */
- rawObject?: unknown;
}
export type TileFilter = (item: ITile) => boolean;
diff --git a/packages/ui/src/components/Catalog/DataListItem.test.tsx b/packages/ui/src/components/Catalog/DataListItem.test.tsx
index bc0d71afd..e6d7a6ea6 100644
--- a/packages/ui/src/components/Catalog/DataListItem.test.tsx
+++ b/packages/ui/src/components/Catalog/DataListItem.test.tsx
@@ -11,7 +11,6 @@ describe('DataListItem', () => {
tags: ['tag1', 'tag2'],
headerTags: ['header-tag1', 'header-tag2'],
version: '1.0',
- rawObject: {},
};
it('renders correctly', () => {
diff --git a/packages/ui/src/components/Catalog/Tile.test.tsx b/packages/ui/src/components/Catalog/Tile.test.tsx
index 29cd446dd..110ae57b8 100644
--- a/packages/ui/src/components/Catalog/Tile.test.tsx
+++ b/packages/ui/src/components/Catalog/Tile.test.tsx
@@ -10,7 +10,6 @@ describe('Tile', () => {
description: 'tile-description',
tags: ['tag1', 'tag2'],
headerTags: ['header-tag1', 'header-tag2'],
- rawObject: {},
};
it('renders correctly', () => {
diff --git a/packages/ui/src/components/Catalog/__snapshots__/BaseCatalog.test.tsx.snap b/packages/ui/src/components/Catalog/__snapshots__/BaseCatalog.test.tsx.snap
new file mode 100644
index 000000000..5bb0f4125
--- /dev/null
+++ b/packages/ui/src/components/Catalog/__snapshots__/BaseCatalog.test.tsx.snap
@@ -0,0 +1,11115 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`BaseCatalog renders corre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olver/IconResolver.test.tsx b/packages/ui/src/components/IconResolver/IconResolver.test.tsx
index 5ae1446e1..c389e44db 100644
--- a/packages/ui/src/components/IconResolver/IconResolver.test.tsx
+++ b/packages/ui/src/components/IconResolver/IconResolver.test.tsx
@@ -10,7 +10,6 @@ describe('IconResolver', () => {
description: 'description',
name: 'name',
tags: [],
- rawObject: {},
};
it('should render default icon', () => {
diff --git a/packages/ui/src/components/PropertiesModal/PropertiesModal.test.tsx b/packages/ui/src/components/PropertiesModal/PropertiesModal.test.tsx
index 5f2bb4a71..7b4ddd3ff 100644
--- a/packages/ui/src/components/PropertiesModal/PropertiesModal.test.tsx
+++ b/packages/ui/src/components/PropertiesModal/PropertiesModal.test.tsx
@@ -1,504 +1,309 @@
+import catalogLibrary from '@kaoto/camel-catalog/index.json';
+import { CatalogLibrary } from '@kaoto/camel-catalog/types';
+
import { screen } from '@testing-library/dom';
import { render } from '@testing-library/react';
-import { CatalogKind } from '../../models';
+import {
+ CamelCatalogService,
+ CatalogKind,
+ ICamelComponentDefinition,
+ ICamelProcessorDefinition,
+ IKameletDefinition,
+} from '../../models';
import { ITile } from '../Catalog';
import { PropertiesModal } from './PropertiesModal';
+import { getFirstCatalogMap } from '../../stubs/test-load-catalog';
-describe('Component tile', () => {
- const tile: ITile = {
- type: CatalogKind.Component,
- name: 'atom',
- title: 'Atom',
- description: 'Poll Atom RSS feeds.',
- headerTags: ['Stable'],
- tags: ['document', '4.0.0'],
- rawObject: {
- component: {
- kind: CatalogKind.Component,
- name: 'atom',
- title: 'Atom',
- description: 'Poll Atom RSS feeds.',
- },
- componentProperties: {
- bridgeErrorHandler: {
- kind: 'property',
- displayName: 'Bridge Error Handler',
- group: 'common',
- required: true,
- javaType: 'java.lang.String',
- description: 'Allows for bridging the consumer to the Camel',
- },
- },
- properties: {
- name: {
- kind: 'path',
- group: 'common',
- required: true,
- autowired: false,
- javaType: 'java.lang.String',
- description: 'Name of component',
- },
- hostname: {
- kind: 'parameter',
- group: 'advanced',
- required: false,
- autowired: true,
- javaType: 'java.lang.String',
- defaultValue: 'http',
- description: 'The hostname of the asterisk server',
- },
- },
- headers: {
- CamelAsteriskEventName: {
- kind: 'header',
- displayName: '',
- group: 'producer',
- description: 'The event name header',
- javaType: 'org.apache.camel.spi.ExceptionHandler',
- autowired: true,
- enum: ['first', 'second'],
- },
- },
- apis: {
- client: {
- consumerOnly: true,
- producerOnly: true,
- description: 'Client api',
- methods: {
- send: {
- description: 'Send ediMessage to trading partner',
- signatures: [''],
- },
- },
- },
- client2: {
- consumerOnly: false,
- producerOnly: true,
- description: 'Client2 api',
- methods: {
- send: {
- description: 'Client2 send',
- signatures: [''],
- },
- },
- },
- },
- apiProperties: {
- client: {
- methods: {
- send: {
- properties: {
- as2From: {
- index: 0,
- kind: 'parameter',
- displayName: 'As2 From',
- group: 'producer',
- required: true,
- type: 'String',
- javaType: 'java.lang.String',
- description: 'AS2 name of sender',
- },
- },
- },
- },
- },
- },
- },
- };
-
- it('renders component properties table correctly', async () => {
- // modal uses React portals so baseElement needs to be used here
- const { baseElement } = render(
);
- // info
- expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Atom');
- expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Poll Atom RSS feeds.');
- // tab 0
- expect(screen.getByTestId('tab-0')).toHaveTextContent('Component Options (1)');
- // headers
- expect(screen.getByTestId('tab-0-table-0-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-0-table-0-header-description')).toHaveTextContent('description');
- expect(screen.getByTestId('tab-0-table-0-header-default')).toHaveTextContent('default');
- expect(screen.getByTestId('tab-0-table-0-header-type')).toHaveTextContent('type');
-
- // rows
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-name')).toHaveTextContent('bridgeErrorHandler (common)');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-description')).toHaveTextContent(
- 'Required Allows for bridging the consumer to the Camel',
- );
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-default')).toHaveTextContent('');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-type')).toHaveTextContent('String');
-
- //tab 1
- expect(screen.getByTestId('tab-1')).toHaveTextContent('Endpoint Options (2)');
- //table1
- screen.getByTestId('tab-1').click();
- await new Promise(process.nextTick);
- expect(screen.getByTestId('tab-1-table-0-properties-modal-table-caption')).toHaveTextContent('path parameters (1)');
- //headers
- expect(screen.getByTestId('tab-1-table-0-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-1-table-0-header-description')).toHaveTextContent('description');
- expect(screen.getByTestId('tab-1-table-0-header-default')).toHaveTextContent('default');
- expect(screen.getByTestId('tab-1-table-0-header-type')).toHaveTextContent('type');
- //rows
- expect(screen.getByTestId('tab-1-table-0-row-0-cell-name')).toHaveTextContent('name (common)');
- expect(screen.getByTestId('tab-1-table-0-row-0-cell-description')).toHaveTextContent('Required Name of component');
- expect(screen.getByTestId('tab-1-table-0-row-0-cell-default')).toHaveTextContent('');
- expect(screen.getByTestId('tab-1-table-0-row-0-cell-type')).toHaveTextContent('String');
+describe('PropertiesModal', () => {
+ let componentCatalogMap: Record
;
+ let kameletCatalogMap: Record;
+ let modelCatalogMap: Record;
- //table2
- expect(screen.getByTestId('tab-1-table-1-properties-modal-table-caption')).toHaveTextContent(
- 'query parameters (1)',
- );
- //headers
- expect(screen.getByTestId('tab-1-table-1-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-1-table-1-header-description')).toHaveTextContent('description');
- expect(screen.getByTestId('tab-1-table-1-header-default')).toHaveTextContent('default');
- expect(screen.getByTestId('tab-1-table-1-header-type')).toHaveTextContent('type');
- //rows
- expect(screen.getByTestId('tab-1-table-1-row-0-cell-name')).toHaveTextContent('hostname (advanced)');
- expect(screen.getByTestId('tab-1-table-1-row-0-cell-description')).toHaveTextContent(
- 'Autowired The hostname of the asterisk server',
- );
- expect(screen.getByTestId('tab-1-table-1-row-0-cell-default')).toHaveTextContent('http');
- expect(screen.getByTestId('tab-1-table-1-row-0-cell-type')).toHaveTextContent('String');
+ beforeAll(async () => {
+ const catalogsMap = await getFirstCatalogMap(catalogLibrary as CatalogLibrary);
+ componentCatalogMap = catalogsMap.componentCatalogMap;
+ componentCatalogMap.asterisk.properties = {};
+ componentCatalogMap.asterisk.headers = {};
+ componentCatalogMap.asterisk.componentProperties = {};
- //tab 2
- expect(screen.getByTestId('tab-2')).toHaveTextContent('Message Headers (1)');
- //headers
- screen.getByTestId('tab-2').click();
- await new Promise(process.nextTick);
- expect(screen.getByTestId('tab-2-table-0-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-2-table-0-header-description')).toHaveTextContent('description');
- expect(screen.getByTestId('tab-2-table-0-header-default')).toHaveTextContent('default');
- expect(screen.getByTestId('tab-2-table-0-header-type')).toHaveTextContent('type');
- //rows
- expect(screen.getByTestId('tab-2-table-0-row-0-cell-name')).toHaveTextContent('CamelAsteriskEventName (producer)');
- expect(screen.getByTestId('tab-2-table-0-row-0-cell-description')).toHaveTextContent(
- 'Autowired The event name header',
- );
- expect(screen.getByTestId('tab-2-table-0-row-0-cell-description-enum-0')).toHaveTextContent('first');
- expect(screen.getByTestId('tab-2-table-0-row-0-cell-description-enum-1')).toHaveTextContent('second');
+ kameletCatalogMap = catalogsMap.kameletsCatalogMap;
+ kameletCatalogMap['nats-sink'].spec.definition.properties = {};
- expect(screen.getByTestId('tab-2-table-0-row-0-cell-type')).toHaveTextContent('ExceptionHandler');
- expect(screen.getByTestId('tab-2-table-0-row-0-cell-default')).toHaveTextContent('');
+ modelCatalogMap = catalogsMap.modelCatalogMap;
+ modelCatalogMap.asn1.properties = {};
- //tab 3
- expect(screen.getByTestId('tab-3')).toHaveTextContent('APIs (2)');
- //headers
- screen.getByTestId('tab-3').click();
- await new Promise(process.nextTick);
- expect(screen.getByTestId('tab-3-table-0-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-3-table-0-header-description')).toHaveTextContent('description');
- expect(screen.getByTestId('tab-3-table-0-header-type')).toHaveTextContent('type');
- // rows
- expect(screen.getByTestId('tab-3-table-0-row-0-cell-apiKind')).toHaveTextContent('Api');
- expect(screen.getByTestId('tab-3-table-0-row-0-cell-name')).toHaveTextContent('client');
- expect(screen.getByTestId('tab-3-table-0-row-0-cell-description')).toHaveTextContent('Client api');
- expect(screen.getByTestId('tab-3-table-0-row-0-cell-type')).toHaveTextContent('Both');
-
- expect(screen.getByTestId('tab-3-table-0-row-1-cell-apiKind')).toHaveTextContent('Method');
- expect(screen.getByTestId('tab-3-table-0-row-1-cell-name')).toHaveTextContent('send');
- expect(screen.getByTestId('tab-3-table-0-row-1-cell-description')).toHaveTextContent(
- 'Send ediMessage to trading partner',
- );
- expect(screen.getByTestId('tab-3-table-0-row-1-cell-type')).toHaveTextContent('');
+ CamelCatalogService.setCatalogKey(CatalogKind.Component, componentCatalogMap);
+ CamelCatalogService.setCatalogKey(CatalogKind.Kamelet, kameletCatalogMap);
+ CamelCatalogService.setCatalogKey(CatalogKind.Processor, modelCatalogMap);
+ CamelCatalogService.setCatalogKey(CatalogKind.Pattern, catalogsMap.patternCatalogMap);
+ CamelCatalogService.setCatalogKey(CatalogKind.Language, catalogsMap.languageCatalog);
+ CamelCatalogService.setCatalogKey(CatalogKind.Dataformat, catalogsMap.dataformatCatalog);
+ CamelCatalogService.setCatalogKey(CatalogKind.Loadbalancer, catalogsMap.loadbalancerCatalog);
+ CamelCatalogService.setCatalogKey(CatalogKind.Entity, catalogsMap.entitiesCatalog);
+ });
- expect(screen.getByTestId('tab-3-table-0-row-2-cell-apiKind')).toHaveTextContent('Param');
- expect(screen.getByTestId('tab-3-table-0-row-2-cell-name')).toHaveTextContent('as2From');
- expect(screen.getByTestId('tab-3-table-0-row-2-cell-description')).toHaveTextContent('Required AS2 name of sender');
- expect(screen.getByTestId('tab-3-table-0-row-2-cell-type')).toHaveTextContent('String');
+ describe('Component tile', () => {
+ const tile: ITile = {
+ type: CatalogKind.Component,
+ name: 'atom',
+ title: 'Atom',
+ description: 'Poll Atom RSS feeds.',
+ headerTags: ['Stable'],
+ tags: ['document'],
+ };
- expect(screen.getByTestId('tab-3-table-0-row-3-cell-apiKind')).toHaveTextContent('Api');
- expect(screen.getByTestId('tab-3-table-0-row-3-cell-name')).toHaveTextContent('client2');
- expect(screen.getByTestId('tab-3-table-0-row-3-cell-description')).toHaveTextContent('Client2 api');
- expect(screen.getByTestId('tab-3-table-0-row-3-cell-type')).toHaveTextContent('Producer');
- });
+ it('renders component properties table correctly', async () => {
+ // modal uses React portals so baseElement needs to be used here
+ const { baseElement } = render();
+ // info
+ expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Atom');
+ expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Poll Atom RSS feeds.');
+ // tab 0
+ expect(screen.getByTestId('tab-0')).toHaveTextContent('Component Options (2)');
+ // headers
+ expect(screen.getByTestId('tab-0-table-0-header-name')).toHaveTextContent('name');
+ expect(screen.getByTestId('tab-0-table-0-header-description')).toHaveTextContent('description');
+ expect(screen.getByTestId('tab-0-table-0-header-default')).toHaveTextContent('default');
+ expect(screen.getByTestId('tab-0-table-0-header-type')).toHaveTextContent('type');
- it('switchs between tabs and apis', async () => {
- // modal uses React portals so baseElement needs to be used here
- render();
- // switch to API tab
- expect(screen.getByTestId('tab-0-table-0-properties-modal-table-caption')).toBeVisible();
- expect(screen.getByTestId('tab-3')).toHaveAttribute('aria-selected', 'false');
- screen.getByTestId('tab-3').click();
- await new Promise(process.nextTick);
- expect(screen.getByTestId('tab-3-table-0-properties-modal-table-caption')).toBeVisible();
- expect(screen.getByTestId('tab-3')).toHaveAttribute('aria-selected', 'true');
+ // rows
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-name')).toHaveTextContent('bridgeErrorHandler (consumer)');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-description')).toHaveTextContent(
+ 'Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.',
+ );
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-default')).toHaveTextContent('false');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-type')).toHaveTextContent('boolean');
- // expand api
- expect(screen.getByLabelText('Expand row 0')).toHaveAttribute('aria-expanded', 'false');
- screen.getByLabelText('Expand row 0').click();
- await new Promise(process.nextTick);
- expect(screen.getByLabelText('Collapse row 0')).toHaveAttribute('aria-expanded', 'true');
+ //tab 1
+ expect(screen.getByTestId('tab-1')).toHaveTextContent('Endpoint Options (24)');
+ //table1
+ screen.getByTestId('tab-1').click();
+ await new Promise(process.nextTick);
+ expect(screen.getByTestId('tab-1-table-0-properties-modal-table-caption')).toHaveTextContent(
+ 'path parameters (1)',
+ );
+ //headers
+ expect(screen.getByTestId('tab-1-table-0-header-name')).toHaveTextContent('name');
+ expect(screen.getByTestId('tab-1-table-0-header-description')).toHaveTextContent('description');
+ expect(screen.getByTestId('tab-1-table-0-header-default')).toHaveTextContent('default');
+ expect(screen.getByTestId('tab-1-table-0-header-type')).toHaveTextContent('type');
+ //rows
+ expect(screen.getByTestId('tab-1-table-0-row-0-cell-name')).toHaveTextContent('feedUri (consumer)');
+ expect(screen.getByTestId('tab-1-table-0-row-0-cell-description')).toHaveTextContent(
+ 'Required The URI to the feed to poll.',
+ );
+ expect(screen.getByTestId('tab-1-table-0-row-0-cell-default')).toHaveTextContent('');
+ expect(screen.getByTestId('tab-1-table-0-row-0-cell-type')).toHaveTextContent('String');
- // expand method
- expect(screen.getByLabelText('Expand row 1')).toHaveAttribute('aria-expanded', 'false');
- screen.getByLabelText('Expand row 1').click();
- await new Promise(process.nextTick);
- expect(screen.getByLabelText('Collapse row 1')).toHaveAttribute('aria-expanded', 'true');
+ //table2
+ expect(screen.getByTestId('tab-1-table-1-properties-modal-table-caption')).toHaveTextContent(
+ 'query parameters (23)',
+ );
+ //headers
+ expect(screen.getByTestId('tab-1-table-1-header-name')).toHaveTextContent('name');
+ expect(screen.getByTestId('tab-1-table-1-header-description')).toHaveTextContent('description');
+ expect(screen.getByTestId('tab-1-table-1-header-default')).toHaveTextContent('default');
+ expect(screen.getByTestId('tab-1-table-1-header-type')).toHaveTextContent('type');
+ //rows
+ expect(screen.getByTestId('tab-1-table-1-row-0-cell-name')).toHaveTextContent(
+ 'sendEmptyMessageWhenIdle (consumer)',
+ );
+ expect(screen.getByTestId('tab-1-table-1-row-0-cell-description')).toHaveTextContent(
+ 'If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead.',
+ );
+ expect(screen.getByTestId('tab-1-table-1-row-0-cell-default')).toHaveTextContent('false');
+ expect(screen.getByTestId('tab-1-table-1-row-0-cell-type')).toHaveTextContent('boolean');
- // close api, method is invisible but should still be expanded
- screen.getByLabelText('Collapse row 0').click();
- await new Promise(process.nextTick);
- expect(screen.getByLabelText('Expand row 0')).toHaveAttribute('aria-expanded', 'false');
- expect(screen.getByLabelText('Collapse row 1')).not.toBeVisible();
- expect(screen.getByLabelText('Collapse row 1')).toHaveAttribute('aria-expanded', 'true');
- screen.getByLabelText('Expand row 0').click();
- await new Promise(process.nextTick);
- expect(screen.getByLabelText('Collapse row 1')).toBeVisible();
- expect(screen.getByLabelText('Collapse row 1')).toHaveAttribute('aria-expanded', 'true');
+ //tab 2
+ expect(screen.getByTestId('tab-2')).toHaveTextContent('Message Headers (1)');
+ //headers
+ screen.getByTestId('tab-2').click();
+ await new Promise(process.nextTick);
+ expect(screen.getByTestId('tab-2-table-0-header-name')).toHaveTextContent('name');
+ expect(screen.getByTestId('tab-2-table-0-header-description')).toHaveTextContent('description');
+ expect(screen.getByTestId('tab-2-table-0-header-default')).toHaveTextContent('default');
+ expect(screen.getByTestId('tab-2-table-0-header-type')).toHaveTextContent('type');
+ //rows
+ expect(screen.getByTestId('tab-2-table-0-row-0-cell-name')).toHaveTextContent('CamelAtomFeed (consumer)');
+ expect(screen.getByTestId('tab-2-table-0-row-0-cell-description')).toHaveTextContent(
+ 'When consuming the List object is set to this header.',
+ );
+ expect(screen.getByTestId('tab-2-table-0-row-0-cell-type')).toHaveTextContent('List');
+ expect(screen.getByTestId('tab-2-table-0-row-0-cell-default')).toHaveTextContent('');
+ });
});
-});
-describe('Component tile with empty properties and no headers/apis', () => {
- const tile: ITile = {
- type: CatalogKind.Component,
- name: 'atom',
- title: 'Atom',
- description: 'Poll Atom RSS feeds.',
- headerTags: ['Stable'],
- tags: ['document', '4.0.0'],
- rawObject: {
- component: {
- kind: CatalogKind.Component,
- name: 'atom',
- title: 'Atom',
- description: 'Poll Atom RSS feeds.',
- },
- properties: {},
- componentProperties: {},
- },
- };
+ describe('Component tile with empty properties and no headers/apis', () => {
+ const tile: ITile = {
+ type: CatalogKind.Component,
+ name: 'asterisk',
+ title: 'Asterisk',
+ description: 'Interact with Asterisk PBX Server (VoIP).',
+ headerTags: ['Stable'],
+ tags: ['document', '4.0.0'],
+ };
- it('renders property modal correctly', () => {
- // modal uses React portals so baseElement needs to be used here
- const { baseElement } = render();
- // info
- expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Atom');
- expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Poll Atom RSS feeds.');
- expect(screen.getByTestId('empty-state')).toHaveTextContent('No properties found for atom');
+ it('renders property modal correctly', () => {
+ // modal uses React portals so baseElement needs to be used here
+ const { baseElement } = render();
+ // info
+ expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Asterisk');
+ expect(screen.getByTestId('properties-modal-description')).toHaveTextContent(
+ 'Interact with Asterisk PBX Server (VoIP).',
+ );
+ expect(screen.getByTestId('empty-state')).toHaveTextContent('No properties found for asterisk');
+ });
});
-});
-describe('Processor tile', () => {
- const tile: ITile = {
- type: CatalogKind.Processor,
- name: 'apiKey',
- title: 'Api Key',
- description: 'Rest security basic auth definition',
- headerTags: ['Stable'],
- tags: ['document', '4.0.0'],
- rawObject: {
- model: {
- kind: 'model',
- name: 'apiKey',
- title: 'Api Key',
- description: 'Rest security basic auth definition',
- },
- properties: {
- instanceClassName: {
- index: 0,
- displayName: 'Instance Class Name',
- kind: 'attribute',
- required: true,
- javaType: 'java.lang.String',
- description: 'Class name to use for marshal and unmarshalling',
- type: 'string',
- deprecated: false,
- autowired: false,
- enum: ['first', 'second'],
- secret: false,
- },
- },
- },
- };
+ describe('Processor tile', () => {
+ const tile: ITile = {
+ type: CatalogKind.Processor,
+ name: 'apiKey',
+ title: 'Api Key',
+ description: 'Rest security basic auth definition',
+ headerTags: ['Stable'],
+ tags: ['document'],
+ };
- it('renders property modal correctly', () => {
- // modal uses React portals so baseElement needs to be used here
- const { baseElement } = render();
- // info
- expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Api Key');
- expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Rest security basic auth definition');
- expect(screen.getByTestId('tab-0')).toHaveTextContent('Options (1)');
- // headers
- expect(screen.getByTestId('tab-0-table-0-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-0-table-0-header-default')).toHaveTextContent('default');
- expect(screen.getByTestId('tab-0-table-0-header-type')).toHaveTextContent('type');
- expect(screen.getByTestId('tab-0-table-0-header-description')).toHaveTextContent('description');
- // row
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-name')).toHaveTextContent('instanceClassName');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-default')).toHaveTextContent('');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-type')).toHaveTextContent('String');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-description')).toHaveTextContent(
- 'Required Class name to use for marshal and unmarshalling',
- );
+ it('renders property modal correctly', () => {
+ // modal uses React portals so baseElement needs to be used here
+ const { baseElement } = render();
+ // info
+ expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Api Key');
+ expect(screen.getByTestId('properties-modal-description')).toHaveTextContent(
+ 'Rest security basic auth definition',
+ );
+ expect(screen.getByTestId('tab-0')).toHaveTextContent('Options (6)');
+ // headers
+ expect(screen.getByTestId('tab-0-table-0-header-name')).toHaveTextContent('name');
+ expect(screen.getByTestId('tab-0-table-0-header-default')).toHaveTextContent('default');
+ expect(screen.getByTestId('tab-0-table-0-header-type')).toHaveTextContent('type');
+ expect(screen.getByTestId('tab-0-table-0-header-description')).toHaveTextContent('description');
+ // row
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-name')).toHaveTextContent('description');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-default')).toHaveTextContent('');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-type')).toHaveTextContent('String');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-description')).toHaveTextContent(
+ 'A short description for security scheme.',
+ );
+ });
});
-});
-describe('Processor tile with empty properties', () => {
- const tile: ITile = {
- type: CatalogKind.Processor,
- name: 'apiKey',
- title: 'Api Key',
- description: 'Rest security basic auth definition',
- headerTags: ['Stable'],
- tags: ['document', '4.0.0'],
- rawObject: {
- model: {
- kind: 'model',
- name: 'apiKey',
- title: 'Api Key',
- description: 'Rest security basic auth definition',
- },
- properties: {},
- },
- };
+ describe('Processor tile with empty properties', () => {
+ const tile: ITile = {
+ type: CatalogKind.Processor,
+ name: 'asn1',
+ title: 'ASN.1 File',
+ description: 'Encode and decode data structures using Abstract Syntax Notation One (ASN.1).',
+ headerTags: ['Stable'],
+ tags: ['document', '4.0.0'],
+ };
- it('renders property modal correctly', () => {
- // modal uses React portals so baseElement needs to be used here
- const { baseElement } = render();
- // info
- expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent('Api Key');
- expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Rest security basic auth definition');
- expect(screen.getByTestId('empty-state')).toHaveTextContent('No properties found for apiKey');
+ it('renders property modal correctly', () => {
+ // modal uses React portals so baseElement needs to be used here
+ const { baseElement } = render();
+ // info
+ expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent(
+ 'ASN.1 File',
+ );
+ expect(screen.getByTestId('properties-modal-description')).toHaveTextContent(
+ 'Encode and decode data structures using Abstract Syntax Notation One (ASN.1).',
+ );
+ expect(screen.getByTestId('empty-state')).toHaveTextContent('No properties found for asn1');
+ });
});
-});
-describe('Kamelet tile', () => {
- const tile: ITile = {
- type: CatalogKind.Kamelet,
- name: 'aws-ddb-streams-source',
- title: 'AWS DynamoDB Streams Source',
- description: 'Receive events from Amazon DynamoDB Streams.',
- headerTags: ['Stable'],
- tags: ['source', '4.0.0-RC1'],
- rawObject: {
- apiVersion: 'camel.apache.org/v1alpha1',
- kind: 'Kamelet',
- metadata: {
- name: 'aws-ddb-streams-source',
- },
- spec: {
- definition: {
- title: 'AWS DynamoDB Streams Source',
- description: 'Receive events',
- required: ['table'],
- type: 'object',
- properties: {
- table: {
- title: 'Table with space',
- description: 'The name of the DynamoDB table.',
- type: 'string',
- },
- key: {
- title: 'Key',
- description: 'New key',
- type: 'string',
- default: 'amazonaws.com',
- example: 'whatever',
- },
- },
- },
- },
- },
- };
+ describe('Kamelet tile', () => {
+ const tile: ITile = {
+ type: CatalogKind.Kamelet,
+ name: 'aws-ddb-streams-source',
+ title: 'AWS DynamoDB Streams Source',
+ description: 'Receive events from Amazon DynamoDB Streams.',
+ headerTags: ['Stable'],
+ tags: ['source'],
+ };
- it('renders property modal correctly', () => {
- // modal uses React portals so baseElement needs to be used here
- const { baseElement } = render();
- // info
- expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent(
- 'AWS DynamoDB Streams Source',
- );
- expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Receive events');
- expect(screen.getByTestId('tab-0')).toHaveTextContent('Options (2)');
- // headers
- expect(screen.getByTestId('tab-0-table-0-header-property')).toHaveTextContent('property');
- expect(screen.getByTestId('tab-0-table-0-header-name')).toHaveTextContent('name');
- expect(screen.getByTestId('tab-0-table-0-header-description')).toHaveTextContent('description');
- expect(screen.getByTestId('tab-0-table-0-header-type')).toHaveTextContent('type');
- expect(screen.getByTestId('tab-0-table-0-header-default')).toHaveTextContent('default');
- expect(screen.getByTestId('tab-0-table-0-header-example')).toHaveTextContent('example');
+ it('renders property modal correctly', () => {
+ // modal uses React portals so baseElement needs to be used here
+ const { baseElement } = render();
+ // info
+ expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent(
+ 'AWS DynamoDB Streams Source',
+ );
+ expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Receive events');
+ expect(screen.getByTestId('tab-0')).toHaveTextContent('Options (9)');
+ // headers
+ expect(screen.getByTestId('tab-0-table-0-header-property')).toHaveTextContent('property');
+ expect(screen.getByTestId('tab-0-table-0-header-name')).toHaveTextContent('name');
+ expect(screen.getByTestId('tab-0-table-0-header-description')).toHaveTextContent('description');
+ expect(screen.getByTestId('tab-0-table-0-header-type')).toHaveTextContent('type');
+ expect(screen.getByTestId('tab-0-table-0-header-default')).toHaveTextContent('default');
+ expect(screen.getByTestId('tab-0-table-0-header-example')).toHaveTextContent('example');
- // row
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-property')).toHaveTextContent('table');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-name')).toHaveTextContent('Table with space');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-description')).toHaveTextContent(
- 'Required The name of the DynamoDB table.',
- );
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-type')).toHaveTextContent('string');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-default')).toHaveTextContent('');
- expect(screen.getByTestId('tab-0-table-0-row-0-cell-example')).toHaveTextContent('');
- expect(screen.getByTestId('tab-0-table-0-row-1-cell-property')).toHaveTextContent('key');
- expect(screen.getByTestId('tab-0-table-0-row-1-cell-name')).toHaveTextContent('Key');
- expect(screen.getByTestId('tab-0-table-0-row-1-cell-description')).toHaveTextContent('New key');
- expect(screen.getByTestId('tab-0-table-0-row-1-cell-type')).toHaveTextContent('string');
- expect(screen.getByTestId('tab-0-table-0-row-1-cell-default')).toHaveTextContent('amazonaws.com');
- expect(screen.getByTestId('tab-0-table-0-row-1-cell-example')).toHaveTextContent('whatever');
+ // row
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-property')).toHaveTextContent('table');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-name')).toHaveTextContent('Table');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-description')).toHaveTextContent(
+ 'Required The name of the DynamoDB table.',
+ );
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-type')).toHaveTextContent('string');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-default')).toHaveTextContent('');
+ expect(screen.getByTestId('tab-0-table-0-row-0-cell-example')).toHaveTextContent('');
+ expect(screen.getByTestId('tab-0-table-0-row-1-cell-property')).toHaveTextContent('accessKey');
+ expect(screen.getByTestId('tab-0-table-0-row-1-cell-name')).toHaveTextContent('Access Key');
+ expect(screen.getByTestId('tab-0-table-0-row-1-cell-description')).toHaveTextContent(
+ 'The access key obtained from AWS.',
+ );
+ expect(screen.getByTestId('tab-0-table-0-row-1-cell-type')).toHaveTextContent('string');
+ expect(screen.getByTestId('tab-0-table-0-row-1-cell-default')).toHaveTextContent('');
+ expect(screen.getByTestId('tab-0-table-0-row-1-cell-example')).toHaveTextContent('');
+ });
});
-});
-describe('Kamelet tile with no properties', () => {
- const tile: ITile = {
- type: CatalogKind.Kamelet,
- name: 'aws-ddb-streams-source',
- title: 'AWS DynamoDB Streams Source',
- description: 'Receive events from Amazon DynamoDB Streams.',
- headerTags: ['Stable'],
- tags: ['source', '4.0.0-RC1'],
- rawObject: {
- apiVersion: 'camel.apache.org/v1alpha1',
- kind: 'Kamelet',
- metadata: {
- name: 'aws-ddb-streams-source',
- },
- spec: {
- definition: {
- title: 'AWS DynamoDB Streams Source',
- description: 'Receive events',
- required: ['table'],
- type: 'object',
- },
- },
- },
- };
+ describe('Kamelet tile with no properties', () => {
+ const tile: ITile = {
+ type: CatalogKind.Kamelet,
+ name: 'nats-sink',
+ title: 'NATS Sink',
+ description: 'Send data to NATS topics.',
+ headerTags: ['Stable'],
+ tags: ['source', '4.0.0-RC1'],
+ };
- it('renders property modal correctly', () => {
- // modal uses React portals so baseElement needs to be used here
- const { baseElement } = render();
- // info
- expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent(
- 'AWS DynamoDB Streams Source',
- );
- expect(screen.getByTestId('properties-modal-description')).toHaveTextContent(
- 'Receive events from Amazon DynamoDB Streams.',
- );
- expect(screen.getByTestId('empty-state')).toHaveTextContent('No properties found for aws-ddb-streams-source');
+ it('renders property modal correctly', () => {
+ // modal uses React portals so baseElement needs to be used here
+ const { baseElement } = render();
+ // info
+ expect(baseElement.getElementsByClassName('pf-v5-c-modal-box__title-text').item(0)).toHaveTextContent(
+ 'NATS Sink',
+ );
+ expect(screen.getByTestId('properties-modal-description')).toHaveTextContent('Send data to NATS topics.');
+ expect(screen.getByTestId('empty-state')).toHaveTextContent('No properties found for nats-sink');
+ });
});
-});
-describe('Unknown tile', () => {
- const tile: ITile = {
- type: 'tile-type',
- name: 'tile-name',
- title: 'tile-title',
- description: 'tile-description',
- tags: ['tag1', 'tag2'],
- headerTags: ['header-tag1', 'header-tag2'],
- rawObject: {},
- };
+ describe('Unknown tile', () => {
+ const tile: ITile = {
+ type: 'tile-type',
+ name: 'tile-name',
+ title: 'tile-title',
+ description: 'tile-description',
+ tags: ['tag1', 'tag2'],
+ headerTags: ['header-tag1', 'header-tag2'],
+ };
- // it suppresses error in the console.log since it is expected
- const consoleErrorFn = jest.spyOn(console, 'error').mockImplementation(() => jest.fn());
+ // it suppresses error in the console.log since it is expected
+ const consoleErrorFn = jest.spyOn(console, 'error').mockImplementation(() => jest.fn());
- afterAll(() => {
- consoleErrorFn.mockRestore();
- });
+ afterAll(() => {
+ consoleErrorFn.mockRestore();
+ });
- it('fires error for property modal', () => {
- expect(() => render()).toThrow(
- 'Unknown CatalogKind during rendering modal: tile-type',
- );
+ it('fires error for property modal', () => {
+ expect(() => render()).toThrow(
+ 'Unknown CatalogKind during rendering modal: tile-type',
+ );
+ });
});
});
diff --git a/packages/ui/src/components/PropertiesModal/PropertiesModal.tsx b/packages/ui/src/components/PropertiesModal/PropertiesModal.tsx
index 10cf8615e..ca678230d 100644
--- a/packages/ui/src/components/PropertiesModal/PropertiesModal.tsx
+++ b/packages/ui/src/components/PropertiesModal/PropertiesModal.tsx
@@ -1,16 +1,17 @@
import { Modal, ModalBoxBody, Tab, Tabs } from '@patternfly/react-core';
-import { FunctionComponent, useEffect, useMemo, useState } from 'react';
+import { FunctionComponent, useContext, useEffect, useMemo, useState } from 'react';
import { IPropertiesTab } from './PropertiesModal.models';
import {
transformCamelComponentIntoTab,
transformCamelProcessorComponentIntoTab,
transformKameletComponentIntoTab,
} from '../../camel-utils/camel-to-tabs.adapter';
-import { CatalogKind, ICamelComponentDefinition, ICamelProcessorDefinition, IKameletDefinition } from '../../models';
+import { CatalogKind } from '../../models';
import { ITile } from '../Catalog';
import './PropertiesModal.scss';
import { PropertiesTabs } from './PropertiesTabs';
import { EmptyTableState } from './Tables';
+import { CatalogContext } from '../../providers';
interface IPropertiesModalProps {
tile: ITile;
@@ -19,16 +20,19 @@ interface IPropertiesModalProps {
}
export const PropertiesModal: FunctionComponent = (props) => {
+ const catalogService = useContext(CatalogContext);
const tabs = useMemo(() => {
switch (props.tile.type) {
case CatalogKind.Component: {
- return transformCamelComponentIntoTab(props.tile.rawObject as ICamelComponentDefinition);
+ return transformCamelComponentIntoTab(catalogService.getComponent(CatalogKind.Component, props.tile.name));
}
case CatalogKind.Processor: {
- return transformCamelProcessorComponentIntoTab(props.tile.rawObject as ICamelProcessorDefinition);
+ return transformCamelProcessorComponentIntoTab(
+ catalogService.getComponent(CatalogKind.Processor, props.tile.name),
+ );
}
case CatalogKind.Kamelet: {
- return transformKameletComponentIntoTab(props.tile.rawObject as IKameletDefinition);
+ return transformKameletComponentIntoTab(catalogService.getComponent(CatalogKind.Kamelet, props.tile.name));
}
default:
throw Error('Unknown CatalogKind during rendering modal: ' + props.tile.type);
diff --git a/packages/ui/src/stubs/tiles.ts b/packages/ui/src/stubs/tiles.ts
index 27c87d2aa..75e5a6678 100644
--- a/packages/ui/src/stubs/tiles.ts
+++ b/packages/ui/src/stubs/tiles.ts
@@ -99,3 +99,366 @@ export const tiles: ITile[] = [
componentKubernetesSecretsTile,
componentCronTile,
];
+
+export const longTileList: ITile[] = [
+ {
+ name: 'activemq',
+ tags: ['messaging'],
+ title: 'ActiveMQ 5.x',
+ type: 'component',
+ },
+ {
+ name: 'activemq6',
+ tags: ['messaging'],
+ title: 'ActiveMQ 6.x',
+ type: 'component',
+ },
+ {
+ name: 'amqp',
+ tags: ['messaging'],
+ title: 'AMQP',
+ type: 'component',
+ },
+ {
+ name: 'arangodb',
+ tags: ['database'],
+ title: 'ArangoDb',
+ type: 'component',
+ },
+ {
+ name: 'as2',
+ tags: ['file'],
+ title: 'AS2',
+ type: 'component',
+ },
+ {
+ name: 'cxf',
+ tags: ['http'],
+ title: 'CXF',
+ type: 'component',
+ },
+ {
+ name: 'exec',
+ tags: ['messaging'],
+ title: 'Exec',
+ type: 'component',
+ },
+ {
+ name: 'toD',
+ tags: ['eip'],
+ title: 'to D',
+ type: 'processor',
+ },
+ {
+ name: 'doTry',
+ tags: ['eip'],
+ title: 'doTry',
+ type: 'processor',
+ },
+ {
+ name: 'Validate',
+ tags: ['eip'],
+ title: 'Validate',
+ type: 'processor',
+ },
+ {
+ name: 'when',
+ tags: ['eip'],
+ title: 'when',
+ type: 'processor',
+ },
+ {
+ name: 'onException',
+ tags: ['eip'],
+ title: 'onException',
+ type: 'processor',
+ },
+ {
+ name: 'wireTap',
+ tags: ['eip'],
+ title: 'wireTap',
+ type: 'processor',
+ },
+ {
+ name: 'intercept',
+ tags: ['eip'],
+ title: 'intercept',
+ type: 'processor',
+ },
+ {
+ name: 'saga',
+ tags: ['eip'],
+ title: 'saga',
+ type: 'processor',
+ },
+ {
+ name: 'script',
+ tags: ['eip'],
+ title: 'script',
+ type: 'processor',
+ },
+ {
+ name: 'sort',
+ tags: ['eip'],
+ title: 'sort',
+ type: 'processor',
+ },
+ {
+ name: 'sink',
+ tags: ['sink'],
+ title: 'Kamelet Sink',
+ type: 'kamelet',
+ },
+ {
+ name: 'kafka-source',
+ tags: ['source'],
+ title: 'Kafka Source',
+ type: 'kamelet',
+ },
+ {
+ name: 'http-source',
+ tags: ['source'],
+ title: 'http-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'ssh-source',
+ tags: ['source'],
+ title: 'ssh-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'jira-source',
+ tags: ['source'],
+ title: 'jira-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'coffee-source',
+ tags: ['source'],
+ title: 'coffee-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'mariadb-source',
+ tags: ['source'],
+ title: 'mariadbsource',
+ type: 'kamelet',
+ },
+ {
+ name: 'dropbox-source',
+ tags: ['source'],
+ title: 'dropbox-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'cassandra-source',
+ tags: ['source'],
+ title: 'cassandrasource',
+ type: 'kamelet',
+ },
+ {
+ name: 'aws-redshift-source',
+ tags: ['source'],
+ title: 'aws-redshift-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'redis-source',
+ tags: ['source'],
+ title: 'redis-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'pulsar-sink',
+ tags: ['sink'],
+ title: 'pulsar-sink',
+ type: 'kamelet',
+ },
+ {
+ name: 'dropbox-sink',
+ tags: ['source'],
+ title: 'dropbox-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'activemq-1',
+ tags: ['messaging'],
+ title: 'ActiveMQ 5.x',
+ type: 'component',
+ },
+ {
+ name: 'activemq6-1',
+ tags: ['messaging'],
+ title: 'ActiveMQ 6.x',
+ type: 'component',
+ },
+ {
+ name: 'amqp-1',
+ tags: ['messaging'],
+ title: 'AMQP',
+ type: 'component',
+ },
+ {
+ name: 'arangodb-1',
+ tags: ['database'],
+ title: 'ArangoDb',
+ type: 'component',
+ },
+ {
+ name: 'as2-1',
+ tags: ['file'],
+ title: 'AS2',
+ type: 'component',
+ },
+ {
+ name: 'cxf-1',
+ tags: ['http'],
+ title: 'CXF',
+ type: 'component',
+ },
+ {
+ name: 'exec-1',
+ tags: ['messaging'],
+ title: 'Exec',
+ type: 'component',
+ },
+ {
+ name: 'toD-1',
+ tags: ['eip'],
+ title: 'to D',
+ type: 'processor',
+ },
+ {
+ name: 'doTry-1',
+ tags: ['eip'],
+ title: 'doTry',
+ type: 'processor',
+ },
+ {
+ name: 'Validate-1',
+ tags: ['eip'],
+ title: 'Validate',
+ type: 'processor',
+ },
+ {
+ name: 'when-1',
+ tags: ['eip'],
+ title: 'when',
+ type: 'processor',
+ },
+ {
+ name: 'onException-1',
+ tags: ['eip'],
+ title: 'onException',
+ type: 'processor',
+ },
+ {
+ name: 'wireTap-1',
+ tags: ['eip'],
+ title: 'wireTap',
+ type: 'processor',
+ },
+ {
+ name: 'intercept-1',
+ tags: ['eip'],
+ title: 'intercept',
+ type: 'processor',
+ },
+ {
+ name: 'saga-1',
+ tags: ['eip'],
+ title: 'saga',
+ type: 'processor',
+ },
+ {
+ name: 'script-1',
+ tags: ['eip'],
+ title: 'script',
+ type: 'processor',
+ },
+ {
+ name: 'sort-1',
+ tags: ['eip'],
+ title: 'sort',
+ type: 'processor',
+ },
+ {
+ name: 'sink-1',
+ tags: ['sink'],
+ title: 'Kamelet Sink',
+ type: 'kamelet',
+ },
+ {
+ name: 'kafka-source-1',
+ tags: ['source'],
+ title: 'Kafka Source',
+ type: 'kamelet',
+ },
+ {
+ name: 'http-source-1',
+ tags: ['source'],
+ title: 'http-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'ssh-source-1',
+ tags: ['source'],
+ title: 'ssh-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'jira-source-1',
+ tags: ['source'],
+ title: 'jira-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'coffee-source-1',
+ tags: ['source'],
+ title: 'coffee-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'mariadb-source-1',
+ tags: ['source'],
+ title: 'mariadbsource',
+ type: 'kamelet',
+ },
+ {
+ name: 'dropbox-source-1',
+ tags: ['source'],
+ title: 'dropbox-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'cassandra-source-1',
+ tags: ['source'],
+ title: 'cassandrasource',
+ type: 'kamelet',
+ },
+ {
+ name: 'aws-redshift-source-1',
+ tags: ['source'],
+ title: 'aws-redshift-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'redis-source-1',
+ tags: ['source'],
+ title: 'redis-source',
+ type: 'kamelet',
+ },
+ {
+ name: 'pulsar-sink-1',
+ tags: ['sink'],
+ title: 'pulsar-sink',
+ type: 'kamelet',
+ },
+ {
+ name: 'dropbox-sink-1',
+ tags: ['source'],
+ title: 'dropbox-source',
+ type: 'kamelet',
+ },
+];