Skip to content

Commit 20162c5

Browse files
committed
Designer fixes
1 parent 53acc1f commit 20162c5

File tree

27 files changed

+465
-333
lines changed

27 files changed

+465
-333
lines changed

karavan-app/src/main/webui/src/designer/beans/BeansDesigner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function BeansDesigner() {
104104
return (
105105
<DrawerPanelContent isResizable
106106
hasNoBorder
107-
defaultSize={'400px'}
107+
defaultSize={'800px'}
108108
maxSize={'800px'}
109109
minSize={'400px'}>
110110
<DslProperties designerType={'beans'}/>

karavan-app/src/main/webui/src/designer/icons/KaravanIcons.tsx

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ export function getDesignerIcon(icon: string): React.JSX.Element {
268268
viewBox="0 0 32 32"
269269
>
270270
<title>{"application"}</title>
271-
<path d="M16 18H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2ZM6 6v10h10V6ZM26 12v4h-4v-4h4m0-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2ZM26 22v4h-4v-4h4m0-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2ZM16 22v4h-4v-4h4m0-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2Z" />
271+
<path
272+
d="M16 18H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2ZM6 6v10h10V6ZM26 12v4h-4v-4h4m0-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2ZM26 22v4h-4v-4h4m0-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2ZM16 22v4h-4v-4h4m0-2h-4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2Z"/>
272273
<path
273274
d="M0 0h32v32H0z"
274275
data-name="&lt;Transparent Rectangle&gt;"
@@ -277,7 +278,7 @@ export function getDesignerIcon(icon: string): React.JSX.Element {
277278
}}
278279
/>
279280
</svg>
280-
)
281+
)
281282
if (icon === 'code') return (
282283
<svg
283284

@@ -307,7 +308,8 @@ export function getDesignerIcon(icon: string): React.JSX.Element {
307308
if (icon === 'route') return (
308309
<svg className="top-icon" width="32px" height="32px" viewBox="0 0 32 32" id="icon">
309310
<title>{"category"}</title>
310-
<path d="M27 22.141V18a2 2 0 0 0-2-2h-8v-4h2a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2h-6a2.002 2.002 0 0 0-2 2v6a2.002 2.002 0 0 0 2 2h2v4H7a2 2 0 0 0-2 2v4.142a4 4 0 1 0 2 0V18h8v4.142a4 4 0 1 0 2 0V18h8v4.141a4 4 0 1 0 2 0ZM13 4h6l.001 6H13ZM8 26a2 2 0 1 1-2-2 2.002 2.002 0 0 1 2 2Zm10 0a2 2 0 1 1-2-2 2.003 2.003 0 0 1 2 2Zm8 2a2 2 0 1 1 2-2 2.002 2.002 0 0 1-2 2Z" />
311+
<path
312+
d="M27 22.141V18a2 2 0 0 0-2-2h-8v-4h2a2.002 2.002 0 0 0 2-2V4a2.002 2.002 0 0 0-2-2h-6a2.002 2.002 0 0 0-2 2v6a2.002 2.002 0 0 0 2 2h2v4H7a2 2 0 0 0-2 2v4.142a4 4 0 1 0 2 0V18h8v4.142a4 4 0 1 0 2 0V18h8v4.141a4 4 0 1 0 2 0ZM13 4h6l.001 6H13ZM8 26a2 2 0 1 1-2-2 2.002 2.002 0 0 1 2 2Zm10 0a2 2 0 1 1-2-2 2.003 2.003 0 0 1 2 2Zm8 2a2 2 0 1 1 2-2 2.002 2.002 0 0 1-2 2Z"/>
311313
<path
312314
d="M0 0h32v32H0z"
313315
data-name="&lt;Transparent Rectangle&gt;"
@@ -382,7 +384,7 @@ export function getDesignerIcon(icon: string): React.JSX.Element {
382384
height="32"/>
383385
</svg>)
384386
if (icon === 'routeConfiguration') return (
385-
<svg className="top-icon" width="32" height="32" viewBox="0 0 32 32">
387+
<svg className="top-icon" width="32" height="32" viewBox="0 0 32 32">
386388
<path
387389
d="M28.83 21.17L25 17.37l.67-.67a1 1 0 000-1.41l-6-6a1 1 0 00-1.41 0l-.79.79-6.76-6.79a1 1 0 00-1.41 0l-4 4-.12.15-4 6a1 1 0 00.12 1.26l3 3a1 1 0 001.42 0L10 13.41l2.09 2.09-4.8 4.79a1 1 0 000 1.41l2 2a1 1 0 00.71.3 1 1 0 00.52-.15l4.33-2.6 2.44 2.45a1 1 0 001.41 0l.67-.7 3.79 3.83a4 4 0 005.66-5.66zM10 10.58l-5 5-1.71-1.71 3.49-5.24L10 5.41l6.09 6.09-2.59 2.58zm8 11l-2.84-2.84-5 3-.74-.74L19 11.41 23.59 16zm9.42 3.83a2 2 0 01-2.83 0l-3.8-3.79 2.83-2.83 3.8 3.79a2 2 0 010 2.83z"></path>
388390
<path
@@ -492,4 +494,42 @@ export class ConceptIcon extends React.Component<any> {
492494
</svg>
493495
)
494496
}
497+
}
498+
499+
export function JKubeIcon(className?: string) {
500+
return (
501+
<svg
502+
xmlns="http://www.w3.org/2000/svg"
503+
viewBox="0 0 59.799997 68.099998"
504+
className={className ? className + " icon" : "icon"}
505+
>
506+
<style id="style1" type="text/css">
507+
{".jkube-icon-outer{fill-rule:evenodd;clip-rule:evenodd;fill:#0a4e9b}"}
508+
</style>
509+
<g id="g8" transform="translate(-9.2 -8.3)">
510+
<path
511+
id="path6"
512+
d="M9.3 59.8c.9.8 2.5 1.5 3.5 2.1l21.6 12.5c1 .6 2.5 1.6 3.6 2v-6.3L14.8 56.6V29.8c-1.6-.4-4.2-2.7-5.6-2.9Z"
513+
className="jkube-icon-outer"
514+
/>
515+
<path
516+
id="path7"
517+
d="m69 59.8-.1-33c-1.5.5-3.9 2.6-5.5 3v26.9c-.8.8-4.9 2.9-6.1 3.6l-12.3 7c-5.1 3-4.8 2-4.8 4.9l.1 4.2z"
518+
className="jkube-icon-outer"
519+
/>
520+
<path
521+
id="path8"
522+
d="M15.9 28c1.9-.7 4.3-2.4 6-3.4l5.7-3.3c2.1-1.2 3.7-2.2 5.8-3.4 1.7-.9 4.1-2.6 5.7-3.2l14.3 8.2c2.4 1.4 4.7 2.7 7.2 4.1 2.1 1.2 1.6 1 3.7-.1 1-.6 2.7-1.4 3.4-2.1-.7-.7-28.3-16.5-28.5-16.5-.2 0-27.8 15.7-28.7 16.6Z"
523+
className="jkube-icon-outer"
524+
/>
525+
</g>
526+
<path
527+
id="path9"
528+
d="M30 9.5 8.6 21.8v24.7L30 58.8l21.4-12.3V21.8Zm7.4 29c0 1.8-.5 3.6-1.4 5.1-.9 1.6-2.2 2.8-3.8 3.7-1.6.9-3.3 1.4-5.2 1.4-1.9 0-3.6-.5-5.2-1.4-1.6-.9-2.9-2.2-3.8-3.7-.9-1.6-1.4-3.3-1.4-5.1h6.8c0 .9.3 1.7 1 2.4s1.5 1 2.5 1 1.8-.3 2.5-1 1-1.5 1-2.4V28.2H24v-6.8h13.3v17.1z"
529+
style={{
530+
fill: "#0a4e9b",
531+
}}
532+
/>
533+
</svg>
534+
)
495535
}

karavan-app/src/main/webui/src/designer/kamelet/KameletDefinitionPropertyCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export function KameletDefinitionPropertyCard(props: Props) {
7272

7373

7474
function getPropertyField(field: string, label: string, isRequired: boolean, span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) {
75-
return (<KameletInput elementKey={key + field} label={label} span={span} value={getPropertyValue(field)} setValue={(value: string) => setPropertyValue(field, value)} type='text' isRequired={isRequired}/>);
75+
return (<KameletInput elementKey={key + field} label={label} span={span} value={getPropertyValue(field)} setValue={(value: string) => setPropertyValue(field, value)} type='text' isRequired={isRequired}/>);
7676
}
7777

7878
function getPropertyTypeField(field: string, label: string, isRequired: boolean, span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12) {
@@ -214,6 +214,7 @@ export function KameletDefinitionPropertyCard(props: Props) {
214214

215215
function deleteProperty() {
216216
if (integration.spec.definition?.properties) {
217+
integration.spec.definition.required = integration.spec.definition.required.filter(r => r !== key);
217218
delete integration.spec.definition.properties[key];
218219
setIntegration(integration, true);
219220
}

karavan-app/src/main/webui/src/designer/karavan.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
}
2020

2121
.karavan .tools-section {
22-
padding-top: 0px;
23-
padding-bottom: 0px;
22+
padding-top: 0;
23+
padding-bottom: 0;
2424
padding-right: 0;
2525
border-bottom: 1px solid #eee;
2626
background-color: white;

karavan-app/src/main/webui/src/designer/property/DslProperties.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export function DslProperties(props: Props) {
191191
}
192192
{selectedStep && propertiesAdvanced.length > 0 &&
193193
<ExpandableSection
194-
toggleText={'EIP advanced properties'}
194+
toggleText={'Processors advanced properties'}
195195
onToggle={(_event, isExpanded) => setShowAdvanced(!showAdvanced)}
196196
isExpanded={getShowExpanded()}>
197197
<div className="parameters">

karavan-app/src/main/webui/src/designer/property/property/DslPropertyField.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ export function DslPropertyField(props: Props) {
470470
}
471471

472472
function showCode(name: string, javaType: string) {
473-
console.log(name, javaType)
474473
const {property} = props;
475474
InfrastructureAPI.onGetCustomCode?.(name, property.javaType).then(value => {
476475
if (value === undefined) {
@@ -487,10 +486,11 @@ export function DslPropertyField(props: Props) {
487486
function getJavaTypeGeneratedInput(property: PropertyMeta, value: any) {
488487
const {dslLanguage} = props;
489488
const selectOptions: SelectOptionProps[] = [];
489+
const allBeansByJavaInterface = SpiBeanApi.findByInterfaceType(property.javaType);
490+
const allBeansJavaTypes: (string | undefined)[] = allBeansByJavaInterface.map(b => b.javaType).filter(b => b !== undefined) || [];
490491
if (beans) {
491-
console.log(beans)
492-
selectOptions.push(...beans.map((bean) => {
493-
return {value: beanPrefix + bean.name, children: bean.name}
492+
selectOptions.push(...beans.filter(bean => allBeansJavaTypes.includes(bean.type.replace('#class:', ''))).map((bean) => {
493+
return {value: beanPrefix + bean.name, children: bean.name, description: bean.name}
494494
}));
495495
selectOptions.push(...SpiBeanApi.findByInterfaceTypeSimple(property.javaType).map((bean) => {
496496
return {
@@ -499,9 +499,9 @@ export function DslPropertyField(props: Props) {
499499
})
500500
);
501501
}
502-
if (selectOptions.filter(o => o.value === value?.toString()).length === 0) {
502+
if (value !== undefined && value.length > 0 && selectOptions.filter(o => o.value === value?.toString()).length === 0) {
503503
selectOptions.push({
504-
value: value, children: value, description: 'Custom Bean'
504+
value: value, children: value, description: 'Custom Java Class'
505505
})
506506
}
507507
return (

0 commit comments

Comments
 (0)