Keep workflow nodes initialized
This commit is contained in:
@@ -67,6 +67,8 @@ export default function WorkflowCanvas({
|
||||
id: node.id,
|
||||
type: "workflow" as const,
|
||||
position: node.position,
|
||||
initialWidth: 190,
|
||||
initialHeight: 56,
|
||||
selected: node.id === selectedNodeId,
|
||||
data: {
|
||||
label: node.label,
|
||||
@@ -171,7 +173,13 @@ export default function WorkflowCanvas({
|
||||
nodeTypes={nodeTypes}
|
||||
onInit={setInstance}
|
||||
onNodesChange={(changes) => {
|
||||
if (!readOnly) updateNodes(applyNodeChanges(changes, nodes));
|
||||
if (readOnly) return;
|
||||
const graphChanges = changes.filter(
|
||||
(change) => change.type !== "dimensions"
|
||||
);
|
||||
if (graphChanges.length) {
|
||||
updateNodes(applyNodeChanges(graphChanges, nodes));
|
||||
}
|
||||
}}
|
||||
onEdgesChange={(changes) => {
|
||||
if (!readOnly) updateEdges(applyEdgeChanges(changes, edges));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createElement, lazy } from "react";
|
||||
import type { PlatformWebModule } from "@govoplan/core-webui";
|
||||
import "./styles/workflow.css";
|
||||
import "@xyflow/react/dist/style.css";
|
||||
import "./styles/workflow.css";
|
||||
|
||||
const WorkflowPage = lazy(() => import("./features/workflow/WorkflowPage"));
|
||||
const readScopes = [
|
||||
|
||||
Reference in New Issue
Block a user