This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
commit 64bce310a041d032a88363339a6bf85dbf3fef70 Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Mon Feb 10 15:31:41 2025 -0500 RouteConfiguration Id --- karavan-designer/public/example/demo.camel.yaml | 26 +++++++++++++++------- .../src/designer/property/PropertiesHeader.tsx | 12 ++++++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/karavan-designer/public/example/demo.camel.yaml b/karavan-designer/public/example/demo.camel.yaml index f8e0248f..cf7b8ed0 100644 --- a/karavan-designer/public/example/demo.camel.yaml +++ b/karavan-designer/public/example/demo.camel.yaml @@ -1,22 +1,32 @@ -- beans: - - name: userService - type: "org.apache.camel.example.rest.UserService" - route: + id: route-1eda from: + id: from-b189 uri: direct parameters: name: getUser steps: - to: + id: to-6d55 uri: bean parameters: beanName: userService - method: "getUser(${header.id})" + method: getUser(${header.id}) - filter: - simple: - expression: "${body} == null" + id: filter-64ac + expression: + simple: + id: simple-12cd + expression: ${body} == null steps: - setHeader: + id: setHeader-392d name: Exchange.HTTP_RESPONSE_CODE - constant: - expression: 404 \ No newline at end of file + expression: + constant: + id: constant-9d21 + expression: 404 +#- beans: +# - name: userService +# type: org.apache.camel.example.rest.UserService +- routeConfiguration: {} diff --git a/karavan-designer/src/designer/property/PropertiesHeader.tsx b/karavan-designer/src/designer/property/PropertiesHeader.tsx index 6498a856..4e99422c 100644 --- a/karavan-designer/src/designer/property/PropertiesHeader.tsx +++ b/karavan-designer/src/designer/property/PropertiesHeader.tsx @@ -25,7 +25,7 @@ import { MenuToggle, DropdownList, DropdownItem, Flex, Popover, FlexItem, Badge, ClipboardCopy, - Switch, Tooltip, Label, + Switch, Tooltip, Label, Button, } from '@patternfly/react-core'; import './DslProperties.css'; import "@patternfly/patternfly/patternfly.css"; @@ -300,9 +300,13 @@ export function PropertiesHeader(props: Props) { function getIdInput() { return ( - <Label isEditable color='blue' isCompact onEditComplete={(event, newText) => onPropertyChange("id", newText)}> - {(selectedStep as any)?.id || ''} - </Label> + (selectedStep as any)?.id !== undefined + ? <Label isEditable color='blue' isCompact onEditComplete={(event, newText) => onPropertyChange("id", newText)}> + {(selectedStep as any)?.id || ''} + </Label> + : <Button variant="link" onClick={event => onPropertyChange("id", "rc-" + Math.floor(1000 + Math.random() * 9000).toString())}> + Add Id + </Button> ) }