Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 25 additions & 27 deletions client/src/pages/platform/workflow-editor/WorkflowEditorLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,37 +177,35 @@ const WorkflowEditorLayout = ({includeComponents, runDisabled, showWorkflowInput
<DialogContent className="absolute bottom-4 left-16 top-12 h-[calc(100vh-64px)] w-[calc(100vw-80px)] max-w-none translate-x-0 translate-y-0 gap-2 bg-surface-main p-0">
<ClusterElementsWorkflowEditor />

{currentComponent && (
<>
<WorkflowNodeDetailsPanel
className="fixed inset-y-0 right-0 rounded-l-none border-none"
invalidateWorkflowQueries={invalidateWorkflowQueries!}
<WorkflowNodeDetailsPanel
className="fixed inset-y-0 right-0 rounded-l-none"
closeButton={
<DialogClose asChild>
<Button
className="absolute right-2 top-2"
size="icon"
title="Close the canvas"
variant="ghost"
>
<XIcon />
</Button>
</DialogClose>
}
invalidateWorkflowQueries={invalidateWorkflowQueries!}
previousComponentDefinitions={previousComponentDefinitions}
updateWorkflowMutation={updateWorkflowMutation!}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>

{dataPillPanelOpen && (
<Suspense fallback={<DataPillPanelSkeleton />}>
<DataPillPanel
className="fixed inset-y-0 right-[465px] rounded-none"
previousComponentDefinitions={previousComponentDefinitions}
updateWorkflowMutation={updateWorkflowMutation!}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>

{dataPillPanelOpen && (
<Suspense fallback={<DataPillPanelSkeleton />}>
<DataPillPanel
className="fixed inset-y-0 right-[465px] rounded-none"
previousComponentDefinitions={previousComponentDefinitions}
workflowNodeOutputs={filteredWorkflowNodeOutputs ?? []}
/>
</Suspense>
)}
</>
</Suspense>
)}

<DialogClose asChild>
<Button
className="absolute right-2 top-2 size-10 border bg-white p-2 shadow-none [&_svg]:size-5"
title="Close the canvas"
variant="ghost"
>
<XIcon />
</Button>
</DialogClose>
</DialogContent>
</Dialog>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
import {TooltipPortal} from '@radix-ui/react-tooltip';
import {useQueryClient} from '@tanstack/react-query';
import {InfoIcon, XIcon} from 'lucide-react';
import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {ReactNode, useCallback, useEffect, useMemo, useRef, useState} from 'react';
import isEqual from 'react-fast-compare';
import InlineSVG from 'react-inlinesvg';
import {twMerge} from 'tailwind-merge';
Expand Down Expand Up @@ -106,6 +106,7 @@

interface WorkflowNodeDetailsPanelProps {
className?: string;
closeButton?: ReactNode;
invalidateWorkflowQueries: () => void;
previousComponentDefinitions: Array<ComponentDefinitionBasic>;
updateWorkflowMutation: UpdateWorkflowMutationType;
Expand All @@ -114,6 +115,7 @@

const WorkflowNodeDetailsPanel = ({
className,
closeButton,
invalidateWorkflowQueries,
previousComponentDefinitions,
updateWorkflowMutation,
Expand Down Expand Up @@ -898,6 +900,7 @@
currentActionFetched,
currentOperationProperties?.length,
currentComponentDefinition?.name,
currentWorkflowNodeConnections.length,
]);

// If the current component requires a connection, set the active tab to 'connection'
Expand Down Expand Up @@ -1155,13 +1158,17 @@
</Tooltip>
)}

<button
aria-label="Close the node details dialog"
className="ml-auto pr-0"
onClick={handlePanelClose}
>
<XIcon aria-hidden="true" className="size-4 cursor-pointer" />
</button>
{closeButton ? (
closeButton
) : (
<button
aria-label="Close the node details dialog"
className="ml-auto pr-0"
onClick={handlePanelClose}
>
<XIcon aria-hidden="true" className="size-4 cursor-pointer" />
</button>
)}

Check warning on line 1171 in client/src/pages/platform/workflow-editor/components/WorkflowNodeDetailsPanel.tsx

View check run for this annotation

SonarQubeCloud / [client] SonarCloud Code Analysis

Unnecessary use of conditional expression for default assignment.

See more on https://sonarcloud.io/project/issues?id=bytechef_client&issues=AZp0yP3Vn2iNHoFqzSi0&open=AZp0yP3Vn2iNHoFqzSi0&pullRequest=3489
</header>

<main className="flex h-full flex-col overflow-hidden">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ export default function useNodeClick(data: NodeDataType, id: NodeProps['id'], ac

if (!!data.clusterRoot && !clusterElementsCanvasOpen) {
setClusterElementsCanvasOpen(true);

setCurrentComponent(undefined);

setWorkflowNodeDetailsPanelOpen(false);

return;
}

setWorkflowNodeDetailsPanelOpen(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default function handleDeleteTask({
});

if (currentNode?.name === data.name) {
useWorkflowNodeDetailsPanelStore.getState().reset();
useWorkflowNodeDetailsPanelStore.getState().setWorkflowNodeDetailsPanelOpen(true);

setCurrentNode({
...rootClusterElementNodeData,
Expand Down
Loading