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