Skip to content
Open
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
93 changes: 41 additions & 52 deletions src/Routes/SidebarRight/AddPipeline/Wizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const Wizard = ({
const [isStreamingPipeline, setIsStreamingPipeline] = useState(
initialState.kind === 'stream'
);
const [pageLoaded, setPageLoaded] = useState(false);
const [initStepNames] = useState(
isRunPipeline ? RunPipelineStepNames : stepNames
);
Expand Down Expand Up @@ -158,14 +157,6 @@ const Wizard = ({
if (!currentKind) {
resetKind(undefined);
}

// Ensure valuesState is synchronized with initial form state
const currentFormValues = form.getFieldsValue();
if (currentFormValues && Object.keys(currentFormValues).length > 0) {
setValuesState(currentFormValues);
}

setPageLoaded(true);
}, []);

useLayoutEffect(() => {
Expand Down Expand Up @@ -235,50 +226,48 @@ const Wizard = ({
</Splitter.Panel>

<Splitter.Panel>
{pageLoaded && (
<ContenerJsonGraph>
<Splitter
lazy
onResizeEnd={() => setReloadGraphPreview(!reloadGraphPreview)}
orientation="vertical"
style={{ boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)' }}>
<Splitter.Panel>
<ContenerGraph>
{valuesState &&
valuesState.nodes &&
valuesState.nodes.length > 0 ? (
<GraphPreview
pipeline={valuesState}
isBuildAllFlows={isStreamingPipeline}
isMinified
clickNode={selectNodeFromGraph}
reload={reloadGraphPreview}
/>
) : (
<div style={{ padding: '20px', color: '#999' }}>
{!valuesState
? 'Loading pipeline data...'
: !valuesState.nodes
? 'No nodes defined...'
: 'Waiting for pipeline data...'}
</div>
)}
</ContenerGraph>
</Splitter.Panel>
<Splitter.Panel>
<ContenerJsonButton>
<ButtonSticky onClick={handleToggle}>
Text editor
</ButtonSticky>
<JsonView
src={getFormattedFormValues()}
collapsed={undefined}
<ContenerJsonGraph>
<Splitter
lazy
onResizeEnd={() => setReloadGraphPreview(!reloadGraphPreview)}
orientation="vertical"
style={{ boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)' }}>
<Splitter.Panel>
<ContenerGraph>
{valuesState &&
valuesState.nodes &&
valuesState.nodes.length > 0 ? (
<GraphPreview
pipeline={valuesState}
isBuildAllFlows={isStreamingPipeline}
isMinified
clickNode={selectNodeFromGraph}
reload={reloadGraphPreview}
/>
</ContenerJsonButton>
</Splitter.Panel>
</Splitter>
</ContenerJsonGraph>
)}
) : (
<div style={{ padding: '20px', color: '#999' }}>
{!valuesState
? 'Loading pipeline data...'
: !valuesState.nodes
? 'No nodes defined...'
: 'Waiting for pipeline data...'}
</div>
)}
</ContenerGraph>
</Splitter.Panel>
<Splitter.Panel>
<ContenerJsonButton>
<ButtonSticky onClick={handleToggle}>
Text editor
</ButtonSticky>
<JsonView
src={getFormattedFormValues()}
collapsed={undefined}
/>
</ContenerJsonButton>
</Splitter.Panel>
</Splitter>
</ContenerJsonGraph>
</Splitter.Panel>
</Splitter>
</Body>
Expand Down
Loading