This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch feature-836 in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
commit c1c184b541b829f642c09cdd1c5b9f11b7ecbe6e Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Thu Aug 24 19:57:53 2023 -0400 Fixed issue with Select Steps #836 --- karavan-designer/public/example/demo.camel.yaml | 130 ++++++++++----------- karavan-designer/src/designer/KaravanStore.ts | 6 + karavan-designer/src/designer/route/DslElement.tsx | 12 +- 3 files changed, 75 insertions(+), 73 deletions(-) diff --git a/karavan-designer/public/example/demo.camel.yaml b/karavan-designer/public/example/demo.camel.yaml index 46692463..bfd20666 100644 --- a/karavan-designer/public/example/demo.camel.yaml +++ b/karavan-designer/public/example/demo.camel.yaml @@ -7,68 +7,68 @@ - filter: expression: {} id: filter-064f -# - choice: -# when: -# - expression: {} -# id: when-064f -# steps: -# - multicast: -# id: multicast-38cea -# steps: -# - bean: -# id: bean-3b8e -# - log: -# message: ${body} -# id: log-546f -# - loop: -# expression: {} -# id: loop-4635 -# steps: -# - convertBodyTo: -# id: convertBodyTo-1cae -# otherwise: -# id: otherwise-0b09 -# steps: -# - filter: -# expression: {} -# id: filter-a02b -# id: choice-c53c -# - doTry: -# id: doTry-8fd5 -# doCatch: -# - id: doCatch-1071 -# - id: doCatch-c38e -# steps: -# - routingSlip: -# expression: {} -# id: routingSlip-a85a -#- route: -# id: route-178a -# from: -# uri: kamelet:aws-cloudtrail-source -# id: from-3e7d -# steps: -# - multicast: -# id: multicast-eef7 -# steps: -# - bean: -# id: bean-a5ef -# - aggregate: -# id: aggregate-f5d8 -# - aggregate: -# id: aggregate-b9e7 -# - aggregate: -# id: aggregate-5eb8 -# - aggregate: -# id: aggregate-c57e -# - aggregate: -# id: aggregate-1cd4 -# - bean: -# id: bean-72a1 -# - choice: -# when: -# - expression: {} -# id: when-a56b -# otherwise: -# id: otherwise-9f31 -# id: choice-1905 + - choice: + when: + - expression: {} + id: when-064f + steps: + - multicast: + id: multicast-38cea + steps: + - bean: + id: bean-3b8e + - log: + message: ${body} + id: log-546f + - loop: + expression: {} + id: loop-4635 + steps: + - convertBodyTo: + id: convertBodyTo-1cae + otherwise: + id: otherwise-0b09 + steps: + - filter: + expression: {} + id: filter-a02b + id: choice-c53c + - doTry: + id: doTry-8fd5 + doCatch: + - id: doCatch-1071 + - id: doCatch-c38e + steps: + - routingSlip: + expression: {} + id: routingSlip-a85a +- route: + id: route-178a + from: + uri: kamelet:aws-cloudtrail-source + id: from-3e7d + steps: + - multicast: + id: multicast-eef7 + steps: + - bean: + id: bean-a5ef + - aggregate: + id: aggregate-f5d8 + - aggregate: + id: aggregate-b9e7 + - aggregate: + id: aggregate-5eb8 + - aggregate: + id: aggregate-c57e + - aggregate: + id: aggregate-1cd4 + - bean: + id: bean-72a1 + - choice: + when: + - expression: {} + id: when-a56b + otherwise: + id: otherwise-9f31 + id: choice-1905 diff --git a/karavan-designer/src/designer/KaravanStore.ts b/karavan-designer/src/designer/KaravanStore.ts index 3bc87681..30d6ee85 100644 --- a/karavan-designer/src/designer/KaravanStore.ts +++ b/karavan-designer/src/designer/KaravanStore.ts @@ -143,6 +143,8 @@ export const useConnectionsStore = createWithEqualityFn<ConnectionsState>((set) interface DesignerState { dark: boolean; setDark: (dark: boolean) => void; + showLogDSL: boolean; + setShowLogDSL: (showLogDSL: boolean) => void; shiftKeyPressed: boolean; setShiftKeyPressed: (shiftKeyPressed: boolean) => void; showDeleteConfirmation: boolean; @@ -168,6 +170,7 @@ interface DesignerState { export const useDesignerStore = createWithEqualityFn<DesignerState>((set) => ({ dark: false, + showLogDSL: true, shiftKeyPressed: false, showDeleteConfirmation: false, showMoveConfirmation: false, @@ -178,6 +181,9 @@ export const useDesignerStore = createWithEqualityFn<DesignerState>((set) => ({ setDark: (dark: boolean) => { set({dark: dark}) }, + setShowLogDSL: (showLogDSL: boolean) => { + set({showLogDSL: showLogDSL}) + }, setShiftKeyPressed: (shiftKeyPressed: boolean) => { set({shiftKeyPressed: shiftKeyPressed}) }, diff --git a/karavan-designer/src/designer/route/DslElement.tsx b/karavan-designer/src/designer/route/DslElement.tsx index 383700b0..b69e4f9a 100644 --- a/karavan-designer/src/designer/route/DslElement.tsx +++ b/karavan-designer/src/designer/route/DslElement.tsx @@ -45,16 +45,12 @@ interface Props { export const DslElement = (props: Props) => { const headerRef = React.useRef<HTMLDivElement>(null); - const {deleteElement, selectElement, moveElement, onShowDeleteConfirmation, openSelector} = useRouteDesignerHook(); + const {selectElement, moveElement, onShowDeleteConfirmation, openSelector} = useRouteDesignerHook(); - const [integration, setIntegration] = useIntegrationStore((s) => [s.integration, s.setIntegration], shallow) + const [integration] = useIntegrationStore((s) => [s.integration, s.setIntegration], shallow) - const [showDeleteConfirmation, propertyOnly, deleteMessage, selectedUuids, clipboardSteps, selectedStep, showMoveConfirmation, - setShowDeleteConfirmation, setPropertyOnly, setDeleteMessage, setSelectedUuids, setClipboardSteps, setPosition, setShowMoveConfirmation, - width, height, top, left] = useDesignerStore((s) => - [s.showDeleteConfirmation, s.propertyOnly, s.deleteMessage, s.selectedUuids, s.clipboardSteps, s.selectedStep, s.showMoveConfirmation, - s.setShowDeleteConfirmation, s.setPropertyOnly, s.setDeleteMessage, s.setSelectedUuids, s.setClipboardSteps, s.setPosition, s.setShowMoveConfirmation, - s.width, s.height, s.top, s.left], shallow) + const [selectedUuids, selectedStep, showMoveConfirmation, setShowMoveConfirmation] = useDesignerStore((s) => + [s.selectedUuids, s.selectedStep, s.showMoveConfirmation, s.setShowMoveConfirmation,], shallow) const [isDragging, setIsDragging] = useState<boolean>(false); const [isDraggedOver, setIsDraggedOver] = useState<boolean>(false);