Skip to content

Commit 4f35e80

Browse files
committed
3002-updated parent components to render newly created workflow executions components
1 parent c9db1b4 commit 4f35e80

File tree

3 files changed

+152
-147
lines changed

3 files changed

+152
-147
lines changed

client/src/ee/pages/embedded/workflow-executions/components/workflow-execution-sheet/WorkflowExecutionSheet.tsx

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
import {ResizableHandle, ResizablePanel, ResizablePanelGroup} from '@/components/ui/resizable';
12
import {Sheet, SheetContent} from '@/components/ui/sheet';
3+
import {Spinner} from '@/components/ui/spinner';
24
import WorkflowExecutionSheetWorkflowPanel from '@/ee/pages/embedded/workflow-executions/components/workflow-execution-sheet/WorkflowExecutionSheetWorkflowPanel';
35
import {useGetComponentDefinitionsQuery} from '@/ee/shared/queries/embedded/componentDefinitions.queries';
46
import {useGetIntegrationWorkflowExecutionQuery} from '@/ee/shared/queries/embedded/workflowExecutions.queries';
57
import {WorkflowReadOnlyProvider} from '@/pages/platform/workflow-editor/providers/workflowEditorProvider';
8+
import {useCallback} from 'react';
69
import {useShallow} from 'zustand/react/shallow';
710

811
import useWorkflowExecutionSheetStore from '../../stores/useWorkflowExecutionSheetStore';
9-
import WorkflowExecutionSheetAccordion from './WorkflowExecutionSheetAccordion';
12+
import WorkflowExecutionSheetContent from './WorkflowExecutionSheetContent';
1013

1114
const WorkflowExecutionSheet = () => {
1215
const {setWorkflowExecutionSheetOpen, workflowExecutionId, workflowExecutionSheetOpen} =
@@ -25,31 +28,45 @@ const WorkflowExecutionSheet = () => {
2528
workflowExecutionSheetOpen
2629
);
2730

31+
const handleOpenChange = useCallback(() => {
32+
setWorkflowExecutionSheetOpen(!workflowExecutionSheetOpen);
33+
}, [workflowExecutionSheetOpen, setWorkflowExecutionSheetOpen]);
34+
2835
return (
29-
<Sheet
30-
onOpenChange={() => setWorkflowExecutionSheetOpen(!workflowExecutionSheetOpen)}
31-
open={workflowExecutionSheetOpen}
32-
>
33-
<SheetContent className="flex w-11/12 gap-0 p-0 sm:max-w-screen-xl">
34-
{workflowExecutionLoading && <span>Loading...</span>}
35-
36-
<div className="flex w-7/12 flex-col border-r border-r-border/50 bg-white">
37-
{workflowExecution?.job && (
38-
<WorkflowExecutionSheetAccordion
39-
job={workflowExecution.job}
40-
triggerExecution={workflowExecution?.triggerExecution}
41-
/>
42-
)}
43-
</div>
44-
45-
{workflowExecution && (
46-
<WorkflowReadOnlyProvider
47-
value={{
48-
useGetComponentDefinitionsQuery: useGetComponentDefinitionsQuery,
49-
}}
50-
>
51-
<WorkflowExecutionSheetWorkflowPanel workflowExecution={workflowExecution} />
52-
</WorkflowReadOnlyProvider>
36+
<Sheet onOpenChange={handleOpenChange} open={workflowExecutionSheetOpen}>
37+
<SheetContent className="flex h-full w-[90%] gap-0 p-0 sm:max-w-[90%]">
38+
{workflowExecutionLoading ? (
39+
<div className="flex size-full items-center justify-center">
40+
<Spinner className="size-6" />
41+
</div>
42+
) : (
43+
<ResizablePanelGroup direction="horizontal">
44+
<ResizablePanel
45+
className="flex h-full w-1/2 flex-col border-r border-stroke-neutral-secondary bg-surface-neutral-primary"
46+
defaultSize={50}
47+
>
48+
{workflowExecution?.job && (
49+
<WorkflowExecutionSheetContent
50+
job={workflowExecution.job}
51+
triggerExecution={workflowExecution?.triggerExecution}
52+
/>
53+
)}
54+
</ResizablePanel>
55+
56+
<ResizableHandle />
57+
58+
<ResizablePanel className="w-1/2" defaultSize={50}>
59+
{workflowExecution && (
60+
<WorkflowReadOnlyProvider
61+
value={{
62+
useGetComponentDefinitionsQuery: useGetComponentDefinitionsQuery,
63+
}}
64+
>
65+
<WorkflowExecutionSheetWorkflowPanel workflowExecution={workflowExecution} />
66+
</WorkflowReadOnlyProvider>
67+
)}
68+
</ResizablePanel>
69+
</ResizablePanelGroup>
5370
)}
5471
</SheetContent>
5572
</Sheet>

client/src/pages/automation/workflow-executions/components/workflow-execution-sheet/WorkflowExecutionSheet.tsx

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import {ResizableHandle, ResizablePanel, ResizablePanelGroup} from '@/components/ui/resizable';
12
import {Sheet, SheetContent} from '@/components/ui/sheet';
3+
import {Spinner} from '@/components/ui/spinner';
24
import {WorkflowReadOnlyProvider} from '@/pages/platform/workflow-editor/providers/workflowEditorProvider';
35
import {useGetComponentDefinitionsQuery} from '@/shared/queries/automation/componentDefinitions.queries';
46
import {useGetProjectWorkflowExecutionQuery} from '@/shared/queries/automation/workflowExecutions.queries';
7+
import {useCallback} from 'react';
58
import {useShallow} from 'zustand/react/shallow';
69

710
import useWorkflowExecutionSheetStore from '../../stores/useWorkflowExecutionSheetStore';
8-
import WorkflowExecutionSheetAccordion from './WorkflowExecutionSheetAccordion';
11+
import WorkflowExecutionSheetContent from './WorkflowExecutionSheetContent';
912
import WorkflowExecutionSheetWorkflowPanel from './WorkflowExecutionSheetWorkflowPanel';
1013

1114
const WorkflowExecutionSheet = () => {
@@ -25,31 +28,45 @@ const WorkflowExecutionSheet = () => {
2528
workflowExecutionSheetOpen
2629
);
2730

31+
const handleOpenChange = useCallback(() => {
32+
setWorkflowExecutionSheetOpen(!workflowExecutionSheetOpen);
33+
}, [workflowExecutionSheetOpen, setWorkflowExecutionSheetOpen]);
34+
2835
return (
29-
<Sheet
30-
onOpenChange={() => setWorkflowExecutionSheetOpen(!workflowExecutionSheetOpen)}
31-
open={workflowExecutionSheetOpen}
32-
>
33-
<SheetContent className="flex w-11/12 gap-0 p-0 sm:max-w-screen-xl">
34-
{workflowExecutionLoading && <span>Loading...</span>}
35-
36-
<div className="flex min-w-workflow-execution-sheet-width max-w-workflow-execution-sheet-width flex-col border-r border-r-border/50 bg-white">
37-
{workflowExecution?.job && (
38-
<WorkflowExecutionSheetAccordion
39-
job={workflowExecution.job}
40-
triggerExecution={workflowExecution?.triggerExecution}
41-
/>
42-
)}
43-
</div>
44-
45-
{workflowExecution && (
46-
<WorkflowReadOnlyProvider
47-
value={{
48-
useGetComponentDefinitionsQuery: useGetComponentDefinitionsQuery,
49-
}}
50-
>
51-
<WorkflowExecutionSheetWorkflowPanel workflowExecution={workflowExecution} />
52-
</WorkflowReadOnlyProvider>
36+
<Sheet onOpenChange={handleOpenChange} open={workflowExecutionSheetOpen}>
37+
<SheetContent className="flex h-full w-[90%] gap-0 p-0 sm:max-w-[90%]">
38+
{workflowExecutionLoading ? (
39+
<div className="flex size-full items-center justify-center">
40+
<Spinner className="size-6" />
41+
</div>
42+
) : (
43+
<ResizablePanelGroup direction="horizontal">
44+
<ResizablePanel
45+
className="flex h-full w-1/2 flex-col border-r border-stroke-neutral-secondary bg-surface-neutral-primary"
46+
defaultSize={50}
47+
>
48+
{workflowExecution?.job && (
49+
<WorkflowExecutionSheetContent
50+
job={workflowExecution.job}
51+
triggerExecution={workflowExecution?.triggerExecution}
52+
/>
53+
)}
54+
</ResizablePanel>
55+
56+
<ResizableHandle />
57+
58+
<ResizablePanel className="w-1/2" defaultSize={50}>
59+
{workflowExecution && (
60+
<WorkflowReadOnlyProvider
61+
value={{
62+
useGetComponentDefinitionsQuery: useGetComponentDefinitionsQuery,
63+
}}
64+
>
65+
<WorkflowExecutionSheetWorkflowPanel workflowExecution={workflowExecution} />
66+
</WorkflowReadOnlyProvider>
67+
)}
68+
</ResizablePanel>
69+
</ResizablePanelGroup>
5370
)}
5471
</SheetContent>
5572
</Sheet>

0 commit comments

Comments
 (0)